bundle/direct: add a feature-flag list to the direct deployment state#5660
bundle/direct: add a feature-flag list to the direct deployment state#5660shreyas-goenka wants to merge 1 commit into
Conversation
Integration test reportCommit: 329e0fc
8 interesting tests: 4 RECOVERED, 4 SKIP
Top 10 slowest tests (at least 2 minutes):
|
663ad08 to
a1b0613
Compare
| for name := range db.Features { | ||
| names = append(names, name) | ||
| } | ||
| slices.Sort(names) |
There was a problem hiding this comment.
makes tests with multiple features deterministic.
a1b0613 to
a550105
Compare
Approval status: pending
|
| // 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) { |
There was a problem hiding this comment.
Get rid of this function - make this decision at open.
| { | ||
| "state_version": 3, | ||
| "features": { | ||
| "dummy": "1.2.0" |
There was a problem hiding this comment.
talk to Julia, if aligned get rid of versions from state and consider hosting every feature on our docs page.
a550105 to
2d62964
Compare
2d62964 to
e559fca
Compare
e559fca to
c62c873
Compare
c62c873 to
1a7c392
Compare
1a7c392 to
d6fdd85
Compare
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
d6fdd85 to
329e0fc
Compare
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.