Repository navigation
Commit 7619e92
committed
feat(featuregate): version-keyed feature gates with readiness-gated alpha opt-ins (#1275)
Introduce solo-provisioner's feature-gate system, a thin adapter over
github.com/automa-saga/gatekit that lets a behaviour or contract change land
behind an off-by-default gate instead of forcing every change to stay
backward-compatible. Layer 1 of epic #1275 (gate + maturity); Layer 2 (finalize,
state-backed activation axis, gated migrations) is out of scope.
Core model (internal/featuregate)
- A registry keys every gated behaviour by an activation version (ActiveFrom) and
tags it with a maturity (Alpha/Beta/GA). CurrentActivationVersion is the in-force
version (1, the GA floor); SupportWindow is the single source of the window W.
- Two axes: a feature is on when the last spec with ActiveFrom <= current resolves
on; Alpha needs an operator opt-in, Beta/GA follow the version axis alone.
Readiness-gated opt-ins
- An operator opt-in (--experimental or SOLO_PROVISIONER_ENABLE_<FEATURE>) enables an
alpha only when its spec is ready (Default:true). An unfinished Alpha,Default:false
feature is dormant: no opt-in can turn it on, yet gate.Enabled(f) still compiles and
returns false, so a feature can be merged incrementally with no risk of exposing a
half-done path. --experimental is command-scoped and shares one gate with business
code, so command availability and in-code behaviour are one decision.
CLI
- `solo-provisioner feature list` inspects the catalog (maturity, ActiveFrom, enabled,
opt-in env var) with filters; read-only, runs unprivileged.
- common.GateFeature / GateFeatureFlag gate a command or a single flag by maturity: an
alpha is hidden from --help and refused unless opted in; a persistent flag is gated
on PersistentPreRunE so inheriting subcommands are covered too. A golden --help
surface test pins the visible command/flag surface so accidental exposure can't merge.
- `kube cluster upgrade` moved onto the KubeClusterUpgrade alpha gate.
Lints (ordinary CI, pure-Go)
- Removal lint, baseline lint (against testdata/baseline_registry.json, regenerated
only at release with -update-baseline), and a dev-gate-window warning.
Docs
- docs/dev/feature-gates.md: the model, defining and promoting a feature, the opt-in
surfaces, development vs compatibility gates, and the lints.
Replaces the bespoke --experimental command gate (GateExperimental) and moves the
whole system onto gatekit v0.7.0.
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>1 parent d0a29a7 commit 7619e92
24 files changed
Lines changed: 2031 additions & 186 deletions
File tree
- cmd/cli/commands
- common
- consensus
- feature
- kube/cluster
- testdata
- docs/dev
- internal/featuregate
- testdata
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
0 commit comments