Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong YAML configuration file used #2344

Open
nogitting opened this issue Feb 12, 2025 · 2 comments
Open

Wrong YAML configuration file used #2344

nogitting opened this issue Feb 12, 2025 · 2 comments
Labels
DABs DABs related issues Enhancement New feature or request

Comments

@nogitting
Copy link

Describe the issue

The CLI picks the wrong configuration file. What happens is, it starts from the working directory and goes up to the root for every supported configuration file, in this order: databricks.yml > databricks.yaml > bundle.yml > bundle.yaml, the first one found will be used.
So, I reckon it makes sense to look for any of those files at every filesystem traversal iteration (i.e. searching by directory, not by configuration file) and/or to add support for a bundle_path option.

Steps to reproduce the behavior

  1. Have a databricks.yml under /a.
  2. Have a bundle.yml under /a/b/c.
  3. From /a/b/c (as your PWD), try to run databricks bundle deploy ... for example.

Expected Behavior

bundle.yml should be used.

Actual Behavior

databricks.yml will be picked instead (and you will likely run into a no-such-target error).

OS and CLI version

macOS | v0.230.0

Is this a regression?

No.

Debug Logs

N/A

@nogitting nogitting added the CLI CLI related issues label Feb 12, 2025
@pietern
Copy link
Contributor

pietern commented Feb 13, 2025

Thanks for creating the issue.

We allow the other filenames for backward compatibility with very old revisions, not because we recommend using those files. If you want the behavior you describe, I recommend using databricks.yml as an entry point everywhere and not mixing and matching different names.

Alternatively, you can configure the DATABRICKS_BUNDLE_ROOT environment variable to force the CLI to use the specified directory as the bundle root. The directory you specify must contain a valid entry point configuration file.

Could you elaborate on why you have a setup with nested bundles? (regardless of the entry point filename)

@nogitting
Copy link
Author

We allow the other filenames for backward compatibility with very old revisions

Yes, even though my suggestion should take care of it without altering backward compatibility. (I am considering it an enhancement rather than a bug per se.)

I recommend using databricks.yml as an entry point everywhere and not mixing and matching different names.

We are definitely on the same page. However, the mix-and-match may happen (especially since the difference between .yml and .yaml matters), so ideally it should be safely caught or explicitly highlighted.

Alternatively, you can configure the DATABRICKS_BUNDLE_ROOT environment variable to force the CLI to use the specified directory as the bundle root

👍

Could you elaborate on why you have a setup with nested bundles? (regardless of the entry point filename)

A monorepo setup can increase the probability of this event.

@andrewnester andrewnester added Enhancement New feature or request DABs DABs related issues and removed CLI CLI related issues labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DABs DABs related issues Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants