feat(orchestrate): record per-component seed state and read it on promote - #520
Merged
Merged
Conversation
…mote Orchestrate now records a component's built version at state.components.<name>.<env> instead of the shared flat state.<env>, so two components no longer overwrite each other's seed. The generated per-component workflow writes state.components.<name>.<env> via its inline state edit, and the orchestrate CLI serializes through WriteScopedState when a component is selected; an empty component records flat state.<env> byte-identical. Because the promote source read previously consumed the flat seed that orchestrate wrote, scoping the write alone would leave a component's promote with no source deployments; the promote preflight now reads the component's own seed via ReadComponentState and overlays it, keeping single-component reads flat. Two components can now orchestrate to the first environment independently, each keeping its own state, without interleaving. Refs #290, #292. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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 writes isolated state, but orchestrate still recorded the built version into the shared flat
state.<env>, and promote read its source from there. Two components would overwrite each other's seed, and the independent-promotion scenario had to interleave to avoid it.Fix (coupled write + read)
state.components.<name>.<env>. The generated per-component workflow writes it via its inline state edit (generator.go), and the orchestrate CLI serializes throughWriteScopedStatewhen a component is selected (orchestrator.go,command.go). An empty component records flatstate.<env>, byte-identical.ReadComponentStateand overlays it (statemerge.go,promote.go,command_preflight.go); single-component reads stay flat.Result: two components orchestrate to the first environment independently, each keeping its own state, with no interleaving.
Verification
go build ./...,go test ./...(2596 pass),go test -raceon orchestrate/promote/config (790 pass),golangci-lint run ./...clean; e2e build+vet clean. Single-component byte-identical baseline gate green (the generator state-edit change does not alter single-component output). Concurrent-orchestrate re-apply preserves an unmodeled sibling verbatim (component_seed_test.go). New scenario52-component-orchestrate-isolation.yaml(two components orchestrate to dev with no interleaving; bothstate.components.<name>.devcoexist) passes locally in the harness (30.2s); the promotion-isolation (40.5s) and single-component (55.7s) scenarios also pass locally.Refs #290, #292.