-
Notifications
You must be signed in to change notification settings - Fork 199
bundle/direct/dstate: read-only feature-flag gate for direct deployment state #5660
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
Merged
shreyas-goenka
merged 4 commits into
main
from
shreyas-goenka/direct-state-feature-flags
Jul 15, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1a9b970
bundle/direct/dstate: read-only feature-flag gate for direct deployme…
shreyas-goenka 904c439
bundle/direct/dstate: add supportedStateVersion for the read ceiling
shreyas-goenka be41023
bundle/direct/dstate: keep on-disk version at 3, do not flip to 2
shreyas-goenka 2625500
minimize diff
shreyas-goenka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| bundle: | ||
| name: test-bundle | ||
|
|
||
| resources: | ||
| jobs: | ||
| my_job: | ||
| name: "my job" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
|
|
||
| === a version-3 state recording a feature is rejected (this CLI records no features yet) | ||
| >>> errcode [CLI] bundle plan | ||
| Error: migrating state [TEST_TMP_DIR]/.databricks/bundle/default/resources.json: the deployment state requires features this CLI does not support: future_feature; upgrade to the latest CLI version and see https://docs.databricks.com/aws/en/dev-tools/bundles/state-features#state-features for more information | ||
|
|
||
|
|
||
| Exit code: 1 | ||
|
|
||
| === a version-3 state with an empty features map is accepted, and a deploy keeps it at version 3 (no flip to 2) | ||
| >>> [CLI] bundle plan | ||
| create jobs.my_job | ||
|
|
||
| Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> gron.py .databricks/bundle/default/resources.json | ||
| json.state_version = 3; |
8 changes: 8 additions & 0 deletions
8
acceptance/bundle/state/feature_flags/resources.empty_features.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "state_version": 3, | ||
| "features": {}, | ||
| "cli_version": "0.0.0-dev", | ||
| "lineage": "test-lineage", | ||
| "serial": 1, | ||
| "state": {} | ||
| } |
10 changes: 10 additions & 0 deletions
10
acceptance/bundle/state/feature_flags/resources.with_feature.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "state_version": 3, | ||
| "features": { | ||
| "future_feature": {} | ||
| }, | ||
| "cli_version": "0.0.0-dev", | ||
| "lineage": "test-lineage", | ||
| "serial": 1, | ||
| "state": {} | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| mkdir -p .databricks/bundle/default | ||
|
|
||
| title "a version-3 state recording a feature is rejected (this CLI records no features yet)" | ||
| cp resources.with_feature.json .databricks/bundle/default/resources.json | ||
| trace errcode $CLI bundle plan 2>&1 | contains.py "requires features this CLI does not support: future_feature" "upgrade to the latest CLI version" "https://docs.databricks.com/aws/en/dev-tools/bundles/state-features#state-features" | ||
|
|
||
| title "a version-3 state with an empty features map is accepted, and a deploy keeps it at version 3 (no flip to 2)" | ||
| cp resources.empty_features.json .databricks/bundle/default/resources.json | ||
| trace $CLI bundle plan | contains.py "Plan:" | ||
| trace $CLI bundle deploy | ||
| trace gron.py .databricks/bundle/default/resources.json | grep state_version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Ignore = [".databricks"] | ||
|
|
||
| [EnvMatrix] | ||
| DATABRICKS_BUNDLE_ENGINE = ["direct"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| state version 999 is newer than supported version 2; upgrade the CLI | ||
| state version 999 is newer than supported version 3; upgrade the CLI | ||
|
|
||
| Exit code: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.