-
Notifications
You must be signed in to change notification settings - Fork 142
Add validation state machine for Databricks Apps #4431
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
base: main
Are you sure you want to change the base?
Conversation
- Auto-validate on deploy when state missing or code changed - Track validation state with checksum in .databricks_app_state - Remove --skip-tests flag (tests always run during validation) - Add --skip-validation flag to bypass validation entirely
libs/apps/validation/state.go
Outdated
| "time" | ||
| ) | ||
|
|
||
| const StateFileName = ".databricks_app_state" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a bundle context, you can use b.CacheDir() for this.
It goes into .databricks/ which is typically already present in the .gitignore file.
You can use the git.NewRepository() and fileset packages to get a list of non-ignored files in a tree. We use this for synchronizing files into the workspace tree for bundles and for the sync command.
cc @fjakobs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- State file now stored in .databricks/bundle/<target>/app_validation_state.json - Validation without bundle context runs but skips state save - Deploy always has bundle context so state is always managed
c4f7a29 to
37c88f6
Compare
|
Commit: 37c88f6
24 interesting tests: 8 flaky, 7 KNOWN, 5 SKIP, 4 RECOVERED
Top 50 slowest tests (at least 2 minutes):
|
| var stateDir string | ||
| b := root.TryConfigureBundle(cmd) | ||
| if b != nil { | ||
| stateDir = b.GetLocalStateDir(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a different "state" you're dealing with here.
You can use b.CacheDir() with an apps-specific suffix.
Changes
Add validation state machine for Databricks Apps that auto-validates on deploy when needed:
.databricks/bundle/<target>/app_validation_state.json--skip-testsflag (tests always run during validation)--skip-validationflag to bypass validation entirelyWhy
This change enforces the validation: users can only skip it when they explicitly use YOLO flag
--skip-validation.Tests
Added unit tests for state management (
state_test.go):