Skip to content

Fix FindNoneUserPath with immutable folders - #6826

Open
deelaka wants to merge 1 commit into
databricks:mainfrom
deelaka:fix/immutable-on-dev
Open

deelaka wants to merge 1 commit into
databricks:mainfrom
deelaka:fix/immutable-on-dev

Conversation

@deelaka

@deelaka deelaka commented Sep 24, 2026 •

Copy link
Copy Markdown

Changes

Skip checking file_path and artifact_path for username or shortname if experimental.immutable_folder is set to true.

Why

With #6084, immutable folders are uploaded as an internal resource, And as such they do not have either username or shortname within the file_path or artifact_path, This causes a validation failure on development mode when performing databricks bundle deploy. The error currently being:

Error: file_path must start with '~/' or contain the current username to ensure uniqueness when using 'mode: development'

Tests

Added a test to validate FindNoneUserPath().

Version

The bug is reproducible on databricks CLI v1.18.0.

@deelaka
deelaka requested review from a team as code owners September 24, 2026 02:41
@github-actions github-actions Bot added the DABs DABs related issues label Sep 24, 2026
@deelaka
deelaka force-pushed the fix/immutable-on-dev branch 2 times, most recently from 8942939 to 5a45a0b Compare September 25, 2026 08:28
file_path is an internal path when the immutable folder option is
toggled on, and thus has no username or shortname in the path.
@deelaka
deelaka force-pushed the fix/immutable-on-dev branch from 5a45a0b to 469eeeb Compare September 25, 2026 08:32
@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: 6826
  • Commit SHA: 469eeeb3dc568b74cdab19212c564e7758476f4d

Checks will be approved automatically on success.

@simonfaltum simonfaltum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found two issues with enabling immutable folders in development mode. The focused Go tests and existing immutable-path acceptance test pass, but that acceptance test does not exercise development mode. Details inline.

if b.Config.Workspace.FilePath != "" && !containsName(b.Config.Workspace.FilePath) {
return "file_path"
}
if b.Config.Workspace.ArtifactPath != "" && !containsName(b.Config.Workspace.ArtifactPath) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An explicitly configured workspace.artifact_path survives DefineDefaultWorkspacePaths because it only fills empty values, but this guard now skips it for every immutable bundle. For example, with artifact_path: /Workspace/Shared/libs, a job library at ${workspace.artifact_path}/.internal/pkg.whl resolves to that shared path, while immutable deployment packages the wheel under the snapshot's artifacts/.internal and skips the normal library upload. The job can point to a missing or stale wheel. Please reject an explicit artifact_path in immutable mode, as TranslatePaths already does for file_path, or restrict this exemption to the generated snapshot path. The new test at line 184 uses an explicit /Shared path and would need to change accordingly.

}
if b.Config.Workspace.FilePath != "" && !containsName(b.Config.Workspace.FilePath) {
return "file_path"
if !b.IsImmutableFolder() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Databricks Runtime, development mode automatically enables source-linked deployment for bundles under /Workspace. With immutable folders enabled, TranslatePaths sends relative resource paths to the snapshot, but ${workspace.file_path} references in resources still resolve to the mutable sync root through the source-linked lookup. This skip makes that combination pass validation, so a single job can mix snapshot paths with source-tree paths that change without a deploy. Please disable source linking for immutable bundles or make those references resolve to the snapshot; a full-pipeline development-mode test would catch the mismatch.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants