Expand description
gtc op revisions {stage,warm,drain,archive,list} (A3).
Manages Environment.revisions: Vec<Revision> and the per-deployment
current_revisions list on each BundleDeployment. Lifecycle transitions
are validated against the spec’s pure
is_valid_transition
predicate so the operator can’t put a Revision into an impossible state.
Heavy lifting deferred:
- Bundle-archive staging (resolving
.gtbundle→pack_listvia the distributor-client’sstage_bundlecall, digest-verifying the artifact, and writing the pack-list lockfile atomically before the revision becomesStaged) is Phase D work — tracked at https://github.com/greenticai/greentic-deployer/issues/209. Todaystagetrusts caller-suppliedbundle_digest/pack_list/*_reffields verbatim. A5 delivered the lifecycle storage guard (environment::lifecycle::apply_revision_transition) and the distributor-client’sset_bundle_stateatomic-write + transition matrix, but did NOT integratestage_bundlehere. - Runner warm/drain hooks (route-table build, in-flight session
accounting) are owned by
greentic-start; A3 only updates the lifecycle bit and stampswarmed_at. The full warm/drain dance lands when the dispatcher lands.
Structs§
Functions§
- archive
op revisions archive. Transitions the lifecycle toarchivedand removes the revision fromBundleDeployment.current_revisions. Refuses archival of any revision still referenced by a liveTrafficSplit— callers must rebalance traffic throughgtc op traffic setfirst.- drain
op revisions drain.ready → draining. The full in-flight drain dance (sessions, WebSocket cleanup, etc.) lives in the runtime; this command records the intent and stamps the lifecycle.- list
op revisions list <env>(filterable by--deployment <id>later).- payload_
from_ stage_ args - Build a
RevisionStagePayloadfrom direct CLI args, orNonewhen no positional args were supplied (deferring to--answers/--schema). Mirrorstraffic::payload_from_set_args: all clap fields are optional so the answers/schema paths keep working unchanged. - stage
op revisions stage. Creates a Revision atinactive → staged. Bumps the sequence to one past the deployment’s current max.- warm
op revisions warm.staged → warming → ready. The two-step move is collapsed here for A3 because no async warm hooks exist yet; Phase D wires the runner warm API.- warm_
with_ health_ gate - Gate-aware variant of
warm(B9 ofplans/next-gen-deployment.md).