Skip to content

Preserve .designer.ipynb suffix when translating notebook task paths#5370

Merged
andrewnester merged 2 commits into
databricks:mainfrom
artchen-db:bundle/preserve-designer-ipynb-suffix
Jun 1, 2026
Merged

Preserve .designer.ipynb suffix when translating notebook task paths#5370
andrewnester merged 2 commits into
databricks:mainfrom
artchen-db:bundle/preserve-designer-ipynb-suffix

Conversation

@artchen-db
Copy link
Copy Markdown
Contributor

Summary

Lakeflow Designer files keep their full .designer.ipynb suffix when imported into the workspace, unlike regular notebooks (.py, .ipynb, .r, .scala, .sql) which lose their extension on import.

translateNotebookPath in bundle/config/mutator/translate_paths.go unconditionally stripped path.Ext(localRelPath). For a foo.designer.ipynb path, path.Ext returns .ipynb, leaving foo.designer — the deployed job's notebook_path then points at a file that does not exist.

Fix

Add notebook.ExtensionDesigner = ".designer.ipynb" and a StripExtension helper in libs/notebook/ext.go that special-cases the designer suffix. Apply it in both branches of translateNotebookPath (the skipLocalFileValidation branch and the post-detection branch).

Reproduction

A bundle with:

resources:
  jobs:
    designer_job:
      tasks:
        - task_key: t
          notebook_task:
            notebook_path: ./foo.designer.ipynb
Before After
File in workspace foo.designer.ipynb (DESIGNER_FILE) ✓ foo.designer.ipynb (DESIGNER_FILE) ✓
Deployed notebook_path foo.designer → 404 ✗ foo.designer.ipynb

Tests

  • libs/notebook/ext_test.goTestStripExtension covers .py / .ipynb / .r / .scala / .sql, the .designer.ipynb keep-case, and no-extension input.
  • bundle/config/mutator/translate_paths_test.goTestTranslatePathsDesignerNotebook (file present, mixed designer + regular tasks) and TestTranslatePathsDesignerNotebookSkipLocalFileValidation (config-remote-sync branch). Both assert designer suffix is preserved and .py / .ipynb are still stripped.

Out of scope

Other call sites strip path.Ext in the same pattern (libs/sync/snapshot_state.go, bundle/generate/downloader.go, cmd/workspace/workspace/import_dir.go, libs/filer/workspace_files_extensions_client.go). The job-task path covers the reported user-visible bug; whether designer files need the same special-case in sync / generate / import-dir flows depends on whether they round-trip through those paths in a way the workspace API doesn't already handle. Happy to extend in a follow-up if reviewers want.

…ask paths

Lakeflow Designer files keep their full `.designer.ipynb` suffix when imported into the workspace, unlike regular notebooks (`.py`, `.ipynb`, `.r`, `.scala`, `.sql`) which lose their extension. `translateNotebookPath` unconditionally stripped `path.Ext(localRelPath)` — which is `.ipynb` for a `foo.designer.ipynb` path — leaving `foo.designer` and pointing the job's `notebook_path` at a file that does not exist.

Add `notebook.ExtensionDesigner` and a `StripExtension` helper that special-cases the designer suffix. Apply it in both branches of `translateNotebookPath` (the `skipLocalFileValidation` branch and the post-detection branch).

Reproduces with a bundle that has `tasks[].notebook_task.notebook_path: ./foo.designer.ipynb`: before this change the file synced as `foo.designer.ipynb` (correct, type `DESIGNER_FILE`) but the deployed job pointed at `foo.designer` (404). After this change the job points at `foo.designer.ipynb`.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Approval status: pending

/acceptance/bundle/ - needs approval

5 files changed
Suggested: @pietern
Also eligible: @janniklasrose, @andrewnester, @denik, @shreyas-goenka, @lennartkats-db, @anton-107

/bundle/ - needs approval

Files: bundle/config/mutator/translate_paths.go, bundle/config/mutator/translate_paths_test.go
Suggested: @pietern
Also eligible: @janniklasrose, @andrewnester, @denik, @shreyas-goenka, @lennartkats-db, @anton-107

General files (require maintainer)

Files: NEXT_CHANGELOG.md, libs/notebook/ext.go, libs/notebook/ext_test.go
Based on git history:

  • @simonfaltum -- recent work in ./

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db) can approve all areas.
See OWNERS for ownership rules.

Adds `acceptance/bundle/paths/designer_notebook/` exercising the mutator pipeline change end-to-end via `bundle validate -o json` and verifying that:

- `./src/test.designer.ipynb` resolves to a workspace path that keeps the full `.designer.ipynb` suffix.
- A sibling regular `./src/regular.ipynb` still loses its extension.

This satisfies the project rule that mutator-pipeline changes prefer acceptance tests (`.agent/rules/testing.md`).

Also adds the corresponding `NEXT_CHANGELOG.md` entry under Bundles.
@github-actions
Copy link
Copy Markdown
Contributor

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 5370
  • Commit SHA: 6df2ca043921b7d6de3b3a6b98f9316b2caf858e

Checks will be approved automatically on success.

@andrewnester andrewnester changed the title bundle: preserve .designer.ipynb suffix when translating notebook task paths Preserve .designer.ipynb suffix when translating notebook task paths Jun 1, 2026
@andrewnester andrewnester merged commit 65d9bf9 into databricks:main Jun 1, 2026
15 of 23 checks passed
@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

Commit: 65d9bf9

Run: 26746408577

bernardo-rodriguez pushed a commit to bernardo-rodriguez/b-cli that referenced this pull request Jun 2, 2026
The `designer_notebook` acceptance test (added in databricks#5370) was missing its
generated `out.test.toml`. The file is written as a side effect of test
discovery and explicitly excluded from output comparison, so a missing
copy never fails a test — and the post-test `git diff --exit-code` guard
didn't catch it either, because plain `git diff` ignores untracked
files. The result: the file silently regenerated as an untracked change
in every worktree that ran the acceptance suite.

This adds the missing `out.test.toml` and fixes the CI guard to register
untracked files with `git add --intent-to-add .` before diffing, so any
new file appearing after a test run now fails the build. Gitignored test
artifacts are unaffected, since intent-to-add respects `.gitignore`.

This pull request and its description were written by Isaac.
deco-sdk-tagging Bot added a commit that referenced this pull request Jun 4, 2026
## Release v1.2.0

### CLI
* `experimental open` now opens every DABs resource type that has a workspace URL, picking up `catalogs`, `schemas`, `volumes`, `database_instances`, `database_catalogs`, `synced_database_tables`, `postgres_catalogs`, `postgres_synced_tables`, `quality_monitors`, `vector_search_endpoints`, and `vector_search_indexes` ([#5346](#5346)).

### Bundles
* Retry transient HTTP 5xx and 408 errors in direct deployment engine ([#5349](#5349), [#5364](#5364)).
* Preserve `.designer.ipynb` suffix when translating notebook task paths so Lakeflow Designer files referenced from a `notebook_task` resolve correctly in the workspace ([#5370](#5370)).
* Fix script output dropping last line without trailing newline ([#4995](#4995)).
* engine/direct: Add `--select` flag to `bundle plan` and `bundle deploy` to plan/deploy a subset of resources (e.g. `--select my_job` or `--select jobs.my_job`); resources referenced by the selection are included transitively ([#5413](#5413)).
* Support `purge_on_delete: true` on `postgres_projects` so bundles can hard-delete a Lakebase project on destroy (skipping the soft-delete retention window) ([#5414](#5414)).
* Support terraform references in direct engine ([#5392](#5392))
* Support lifecycle.started for SQL warehouses ([#5348](#5348))

### Dependency updates
* Bump Go toolchain to 1.26.4 ([#5420](#5420)).
* Bump `github.com/databricks/databricks-sdk-go` from v0.136.0 to v0.141.0 ([#5361](#5361))
* Bump Terraform provider from v1.115.0 to v1.117.0 ([#5421](#5421))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants