bundle/direct: add a feature-flag list to the direct deployment state#5660
Draft
shreyas-goenka wants to merge 1 commit into
Draft
bundle/direct: add a feature-flag list to the direct deployment state#5660shreyas-goenka wants to merge 1 commit into
shreyas-goenka wants to merge 1 commit into
Conversation
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
Collaborator
Integration test reportCommit: 7e4166c
20 interesting tests: 13 SKIP, 7 KNOWN
Top 24 slowest tests (at least 2 minutes):
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
The direct deployment state needs a forward-compatibility mechanism: as the engine gains capabilities, a state written by a newer CLI may rely on something an older CLI doesn't understand. Rather than bump the schema version for every capability, the state carries a generic feature-flag list, and an older CLI that finds a feature it doesn't recognize fails with an actionable message instead of silently mishandling the state.
What
Header.Features— a map of feature flag → the minimum CLI version required to read a state recording it. (Older CLIs, max v2, reject v3 with the existing "upgrade the CLI" error; this is the one schema bump, after which capabilities are feature flags, not version bumps.)featureMinCLIVersion) — adding one is a single map entry. A deploy records a flag viaRecordFeature, which stamps the registry's min version into the state.Openrejects any state recording a feature absent from the registry:the deployment state requires feature "X" which this CLI (<v>) does not support; upgrade to <minVersion> or newer.Tests
dstate): schema-version pin + migrations-completeness tripwire, legacy→current migration, reject-newer-version,RecordFeatureround-trip + panic-if-WAL-started, andcheckSupportedFeatures(known accepted / unknown rejected).bundle/state/feature_flags: a state recording the dummy (known) feature is accepted; a state recording an unknown feature is rejected with the recorded min version.state_version: 3.This pull request and its description were written by Isaac.