feat(promote): record per-component finalize state via scoped writes - #517
Merged
Merged
Conversation
joshua-temple
force-pushed
the
feat/promote-component-state
branch
from
July 8, 2026 05:23
03ef25f to
58d56ef
Compare
When a component is selected, the promotion finalizer records state at state.components.<name>.<env> through the scoped serializer instead of rebuilding the whole flat state node. This keeps a sibling component's recorded state intact when a concurrent finalizer re-applies on a 409: the finalizer routes writeStateViaAPI and WriteConfig through WriteScopedState with per-component StateWrite entries. An empty component takes the original path, so single-component finalize is byte-identical. Threads --component from the promote command into the finalizer. Refs #290. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
joshua-temple
force-pushed
the
feat/promote-component-state
branch
from
July 8, 2026 05:39
58d56ef to
4874d30
Compare
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.
Problem
Per-component promotion must record each component's state at
state.components.<name>.<env>without clobbering a sibling. The finalizer today rebuilds the whole flatstatenode from a typed map, so under theCommitWithRetry409 re-apply a concurrent finalizer would deletestate.components.<sibling>.Fix
Finalizergains acomponentfield (set viaWithComponent, threaded from the promote--componentflag). When set,writeStateViaAPIandWriteConfigroute throughWriteScopedStatewith one per-componentStateWriteper promoted env (plus latest on publish), instead of the whole-node rebuild.Scope is the runtime finalize behavior only. Generator
promote-<name>.yamlfan-out, the harness per-component execution extension, and the promotion end-to-end scenarios are separate changes.Verification
go build ./...,go test ./...(2578 pass),go test -race ./...(2578 pass),golangci-lint run ./...clean; single-component byte-identical baseline gate green. Keystone testTestFinalizer_ConcurrentFinalize_SiblingSurvivesThrough409Reapplydrives the realwriteStateViaAPI -> CommitWithRetry -> stateMutationpath: a fake 409s the first PUT and injects a concurrent sibling finalizer's subtree; the re-applied write lands this component's node and preserves the sibling verbatim, including an unmodeled key.Refs #290.