Skip to content

bundle/direct: add a feature-flag list to the direct deployment state#5660

Open
shreyas-goenka wants to merge 1 commit into
mainfrom
shreyas-goenka/direct-state-feature-flags
Open

bundle/direct: add a feature-flag list to the direct deployment state#5660
shreyas-goenka wants to merge 1 commit into
mainfrom
shreyas-goenka/direct-state-feature-flags

Conversation

@shreyas-goenka

@shreyas-goenka shreyas-goenka commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

This PR adds boolean feature flags to direct state. Every new feature that needs is not backwards compatible should add a feature flag rather than upgrading state version, if the state structure does not change.

We can consider adding a "per-feature" version but omitting this for now.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 329e0fc

Run: 28854679126

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 230 1064 4:49
💚​ aws windows 4 4 232 1062 5:44
💚​ aws-ucws linux 4 4 314 982 5:19
💚​ aws-ucws windows 4 4 316 980 5:54
💚​ azure linux 4 4 230 1063 5:02
💚​ azure windows 4 4 232 1061 5:48
💚​ azure-ucws linux 4 4 316 979 5:48
💚​ azure-ucws windows 4 4 318 977 6:04
💚​ gcp linux 4 4 229 1065 4:56
💚​ gcp windows 4 4 231 1063 5:41
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 10 slowest tests (at least 2 minutes):
duration env testname
5:02 azure-ucws windows TestAccept
5:01 aws windows TestAccept
4:54 azure windows TestAccept
4:54 aws-ucws windows TestAccept
4:51 gcp windows TestAccept
2:59 azure linux TestAccept
2:58 gcp linux TestAccept
2:56 aws linux TestAccept
2:51 aws-ucws linux TestAccept
2:50 azure-ucws linux TestAccept

@shreyas-goenka shreyas-goenka force-pushed the shreyas-goenka/direct-state-feature-flags branch 2 times, most recently from 663ad08 to a1b0613 Compare June 29, 2026 09:30
for name := range db.Features {
names = append(names, name)
}
slices.Sort(names)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes tests with multiple features deterministic.

@shreyas-goenka shreyas-goenka force-pushed the shreyas-goenka/direct-state-feature-flags branch from a1b0613 to a550105 Compare June 29, 2026 12:55
@shreyas-goenka shreyas-goenka marked this pull request as ready for review June 29, 2026 12:57
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

22 files changed
Suggested: @denik
Also eligible: @pietern, @janniklasrose, @andrewnester, @anton-107, @lennartkats-db

/bundle/ - needs approval

Files: bundle/direct/dstate/migrate.go, bundle/direct/dstate/state.go, bundle/direct/dstate/state_test.go
Suggested: @denik
Also eligible: @pietern, @janniklasrose, @andrewnester, @anton-107, @lennartkats-db

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @simonfaltum, @renaudhartert-db, @janniklasrose) can approve all areas.
See OWNERS for ownership rules.

Comment thread bundle/direct/dstate/state.go Outdated
// RecordFeature marks the state as depending on the named feature, stamping the
// minimum CLI version required to read it (from featureMinCLIVersion). It must be
// called before the WAL is started (UpgradeToWrite) so the change is persisted.
func (db *DeploymentState) RecordFeature(name string) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of this function - make this decision at open.

{
"state_version": 3,
"features": {
"dummy": "1.2.0"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

talk to Julia, if aligned get rid of versions from state and consider hosting every feature on our docs page.

@shreyas-goenka shreyas-goenka force-pushed the shreyas-goenka/direct-state-feature-flags branch from a550105 to 2d62964 Compare July 6, 2026 23:04
@shreyas-goenka shreyas-goenka force-pushed the shreyas-goenka/direct-state-feature-flags branch from 2d62964 to e559fca Compare July 7, 2026 00:26
@shreyas-goenka shreyas-goenka force-pushed the shreyas-goenka/direct-state-feature-flags branch from e559fca to c62c873 Compare July 7, 2026 08:59
@shreyas-goenka shreyas-goenka force-pushed the shreyas-goenka/direct-state-feature-flags branch from c62c873 to 1a7c392 Compare July 7, 2026 09:01
@shreyas-goenka shreyas-goenka force-pushed the shreyas-goenka/direct-state-feature-flags branch from 1a7c392 to d6fdd85 Compare July 7, 2026 09:04
Bumps the direct state schema to version 3, adding a per-state feature list
(Header.Features) that maps each feature flag to the minimum CLI version required
to read a state recording it. On load the CLI rejects any state recording a
feature it does not know, pointing the user at the recorded version, so older
CLIs fail with an actionable message instead of silently mishandling the state.

Feature flags are defined in a static registry (featureMinCLIVersion) and written
into the state via RecordFeature. A dummy feature is included to exercise the
mechanism in tests; no real deployment records one yet.

Co-authored-by: Isaac
@shreyas-goenka shreyas-goenka force-pushed the shreyas-goenka/direct-state-feature-flags branch from d6fdd85 to 329e0fc Compare July 7, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants