Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

bundle validate warns "Pattern ... does not match any files" for sync.include/exclude when the sync root is above the bundle root

Ouverte
#7,115 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
78/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
go
Domaine
cli, testing

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.go sets the sync root to the common ancestor of sync.paths and rewrites each sync.include and sync.exclude entry relative to it (prefixing the bundle root's path from the sync root, here app/).
  • bundle/config/validate/validate_sync_patterns.go then globs each rewritten pattern with fileset.NewGlobSet(b.BundleRoot, ...), that is, against the bundle directory instead of the sync root. app/tests/** does not exist under app/, 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.

Langage dominant
Go
Étoiles
405
Forks
250
Merge moyen
1 j 11 h
PR mergées (30 j)
203

Préparer son environnement

  • Fournit un Dockerfile ou un fichier Docker Compose
  • Propose un modèle de pull request
  • Aucun guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de databricks/cli

Toutes les issues de databricks/cli

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.