cli icon indicating copy to clipboard operation
cli copied to clipboard

[Feature] Do not warn about no files to sync

Open svatopluk-sperka opened this issue 1 year ago • 3 comments

Hi Databricks,

we use DABs to deploy Scala-based project that only needs its JAR artifact to run. So we do not need any files to sync to Databricks workspace. However, when we exclude all files from sync via

sync:
  exclude:
    - "*"

we get Warning: There are no files to sync, please check your .gitignore and sync.exclude configuration when validating the bundle. This forces us to add some random file so that validation succeeds.

As I understand, it is a common need to sync some files. But it would be great if there was a way to tell the DABs that I really do not want to sync anything and it is intentional. What comes to mind is an ability to silence this warning so that sync does not become more complicated than it is.

Thank you for considering this!

svatopluk-sperka avatar Aug 08 '24 07:08 svatopluk-sperka

Thanks for raising this.

There is a somewhat related change in progress to enable specifying the paths to synchronize (as opposed to always defaulting to . relative to the bundle root directory). This field can also be set to nil or an empty sequence (example) and it will have the same outcome as what you're looking for.

pietern avatar Aug 21 '24 14:08 pietern

Happy to see the mentioned change to specifying paths, but: We have the same use case as @svatopluk-sperka, but with these sync settings from your example:

sync:
  paths: []

I'm still getting the message (with Databricks CLI 0.227.0): Warning: There are no files to sync, please check your .gitignore We're deploying an artifact wheel, so this is a bit confusing for our developers.

benedikt-mayer avatar Aug 23 '24 09:08 benedikt-mayer

Warning itself should be handled separately because using sync.paths is just a new one to instruct to not sync any path cc @pietern

andrewnester avatar Aug 23 '24 09:08 andrewnester

Hey all, thanks for your patience on this. The fix for this has been merged and will be included in the next CLI release.

pietern avatar Nov 21 '24 20:11 pietern