diff --git a/.nextchanges/bundles/warn-for-missing-databricks-yml.md b/.nextchanges/bundles/warn-for-missing-databricks-yml.md new file mode 100644 index 00000000000..8f89ae17a47 --- /dev/null +++ b/.nextchanges/bundles/warn-for-missing-databricks-yml.md @@ -0,0 +1 @@ +Provide an actionable error message if databricks.yml is missing ([#5953](https://github.com/databricks/cli/pull/5953)). diff --git a/acceptance/bundle/run/inline-script/no-bundle/output.txt b/acceptance/bundle/run/inline-script/no-bundle/output.txt index 870f682634f..4c41b8e366d 100644 --- a/acceptance/bundle/run/inline-script/no-bundle/output.txt +++ b/acceptance/bundle/run/inline-script/no-bundle/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle run -- echo hello -Error: unable to locate bundle root: databricks.yml not found +Error: unable to locate bundle root: databricks.yml not found. Run 'databricks bundle init' to create a bundle, or run this command from a directory that already contains one Exit code: 1 diff --git a/acceptance/bundle/run/inline-script/no-separator/output.txt b/acceptance/bundle/run/inline-script/no-separator/output.txt index 7a35cab72e4..937988ce833 100644 --- a/acceptance/bundle/run/inline-script/no-separator/output.txt +++ b/acceptance/bundle/run/inline-script/no-separator/output.txt @@ -1,6 +1,6 @@ >>> [CLI] bundle run echo hello -Error: unable to locate bundle root: databricks.yml not found +Error: unable to locate bundle root: databricks.yml not found. Run 'databricks bundle init' to create a bundle, or run this command from a directory that already contains one Exit code: 1 diff --git a/bundle/root.go b/bundle/root.go index 9ea9a8c13fe..9f6f2c5f6bb 100644 --- a/bundle/root.go +++ b/bundle/root.go @@ -45,7 +45,7 @@ func getRootWithTraversal() (string, error) { } } - return "", fmt.Errorf(`unable to locate bundle root: %s not found`, config.FileNames[0]) + return "", fmt.Errorf(`unable to locate bundle root: %s not found. Run 'databricks bundle init' to create a bundle, or run this command from a directory that already contains one`, config.FileNames[0]) } // mustGetRoot returns a bundle root or an error if one cannot be found.