immutable_folder cannot be used with a mode: development target

已關閉
#6,963 0 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@andrewnester 已經在處理了。

開始於 2026年10月9日。

  • #7027 來自 @andrewnester —— 已合併

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
go
領域
cli, devtools

研究方向

Start by tracing how experimental.immutable_folder is parsed and resolved, then inspect the development-mode uniqueness validation that rejects the snapshot file_path; the issue names no source files or tests. Reproduce with the supplied configuration using databricks bundle validate -t dev and -t prod. Done means the supported behavior is implemented and validation handles the dev and production targets as expected.

由索引模型根據 Issue 內容生成。

描述

Bug DABs
Describe the issue

experimental.immutable_folder: true cannot be used in a bundle that has a target with mode: development.

  1. A mode: development target fails validation. The development-mode uniqueness check rejects the snapshot file_path.
  2. A target cannot set experimental, so the flag cannot be turned off for the development target only.
  3. The flag ignores a bundle variable. immutable_folder: ${var.immutable} stays off when the variable is true.

So a bundle with a development target and a shared production target cannot use the feature. Together with #6960, which blocks bundle validate when a top-level permissions block is present, the usual dev and prod bundle layout cannot adopt immutable_folder.

Configuration
bundle:
  name: immutable-dev-repro
  engine: direct

experimental:
  immutable_folder: true

resources:
  jobs:
    hello:
      name: hello
      tasks:
        - task_key: hello
          environment_key: default
          spark_python_task:
            python_file: ./src/hello.py
      environments:
        - environment_key: default
          spec:
            environment_version: "2"

targets:
  dev:
    mode: development
    default: true
  prod:
    mode: production
    workspace:
      root_path: /Workspace/Shared/immutable-dev-repro/prod
Steps to reproduce the behavior
  1. Run databricks bundle validate -t dev. Result:
    Error: file_path must start with '~/' or contain the current username to ensure uniqueness when using 'mode: development'
    
  2. Move the flag under the prod target (targets.prod.experimental.immutable_folder: true) and run databricks bundle validate -t prod. Result: Warning: unknown field: experimental. The flag has no effect.
  3. Set experimental.immutable_folder: ${var.immutable} with default: false, and set immutable: true in targets.prod.variables. Run databricks bundle validate -t prod -o json. Result: workspace.file_path is /Workspace/Shared/immutable-dev-repro/prod/files, not a snapshot path. The flag stays off.
Expected Behavior

One of these:

  • The development-mode check accepts the snapshot file_path, because each snapshot is already unique.
  • A target can set experimental.immutable_folder, so development can keep it off.
  • The flag resolves a bundle variable.
Actual Behavior

The development target fails validation, and there is no supported way to turn the flag on only for non-development targets.

OS and CLI version

Databricks CLI v1.18.0, macOS. The 1.19.0 release notes do not mention immutable_folder.

Is this a regression?

No. immutable_folder is new.

Debug Logs

The validation error in step 1 is the only output. I can attach --log-level=debug output on request.

主要語言
Go
星號
424
分支
261
平均合併
1 天 19 小時
30 天內合併 PR
218

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 有 Pull Request 範本
  • 沒有貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

databricks/cli 的其他 Issue

查看 databricks/cli 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。