bundle validate warns "Pattern ... does not match any files" for sync.include/exclude when the sync root is above the bundle root
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with bundle/config/validate/validate_sync_patterns.go and bundle/config/mutator/sync_infer_root.go to trace how the sync root and rewritten patterns are used. Add a regression test for sync.paths reaching above the bundle root, using the provided reproduction, and run the relevant validation tests. Done means the matching exclude no longer warns under --strict.
索引モデルが issue の本文から書いたものです。
説明
Describe the issue
databricks bundle validate reports Pattern ... does not match any files for a sync.exclude (or sync.include) pattern that does match files, when sync.paths reaches above the bundle directory. With --strict the warning becomes an error, so validate exits 1 even though the exclusion works.
Steps to reproduce
shared/a.py
app/tests/x.py
app/databricks.yml
app/databricks.yml:
bundle:
name: repro
sync:
paths: [../shared, .]
exclude: [tests/**]
From app/: databricks bundle validate --strict -o json
Expected behavior
No warning. tests/** matches app/tests/x.py, and the resolved config already excludes it.
Actual behavior
Exit code 1 on v1.19.0:
Warning: Pattern app/tests/** does not match any files
at sync.exclude[0]
in databricks.yml:5:13
Error: 1 warning was found. Warnings are not allowed in strict mode
The resolved config (-o json) shows sync.exclude rewritten to ["app/tests/**"] and sync.paths to ["shared", "app"], so the sync itself uses the right pattern. Removing paths from the sync block makes the warning disappear.
Cause
From reading the source on main:
bundle/config/mutator/sync_infer_root.gosets the sync root to the common ancestor ofsync.pathsand rewrites eachsync.includeandsync.excludeentry relative to it (prefixing the bundle root's path from the sync root, hereapp/).bundle/config/validate/validate_sync_patterns.gothen globs each rewritten pattern withfileset.NewGlobSet(b.BundleRoot, ...), that is, against the bundle directory instead of the sync root.app/tests/**does not exist underapp/, so it warns.
Suggested fix: glob against the sync root in validate_sync_patterns.go, and add a test for a sync root above the bundle root.
OS and CLI version
Reproduced on Databricks CLI v1.19.0, macOS. Source reading only for main; I did not run later releases.
- 主要言語
- Go
- スター
- 409
- フォーク
- 253
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 212
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
databricks/cli のほかの issue
-
Apps commands only accept relative path to app.yml対応中かも @yuri-rod が 17 日前に担当しました。 オープンCLI
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
databricks/cli#6910 ·
メンテナーはふだん 1 日以内に返信
-
DABs
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
databricks/cli#6670 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bundle validate does not catch missing trigger.table_update.condition with multiple tables対応中かも @yuri-rod が 3 日前に担当しました。 オープンDABs Enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
databricks/cli#7101 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
databricks/cli#7100 ·
メンテナーはふだん 1 日以内に返信
-
DABs Enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
databricks/cli#7099 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
pre-migration
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
client.HTTPFetcher doesn't close non-200 response bodies, so connections leak対応中かも @grempe が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
transparency-dev/tessera#1245 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
bug e2e
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
shaiknoorullah/hg-mono#1086 ·
メンテナーはふだん 1 日以内に返信
-
native
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
prime-radiant-inc/evener#4839 ·
メンテナーはふだん 1 日以内に返信