feat: reserve gitops deploy target branch and sha-tracking fields - #232
Merged
Merged
Conversation
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
Issue #2 asks to reserve a cross-repo GitOps deploy-target shape before the v1 manifest schema freezes. A literal new
gitops_targets:block would duplicate and orphan the already-reserveddeploy_targetblock (modes dispatch|gitops), whose doc-comment promises it is the GitOps-mirror home.Fix
Converge onto the existing
deploy_targetblock (no new key). Additive, shape-only, no generator output, noschema_versionbump:DeployTarget.Branch(branch,omitempty) andDeployTarget.TrackSHA(track_sha,omitempty), both reserved and meaningful only whenmode: gitops.DeployState.TargetSHA(target_sha,omitempty), mirroring the external-deploy SHA concept; state structs are not part of the JSON schema.validateDeployTargetnow rejectstrack_sha/branchundermode: dispatchand rejects an unsafebranchref (leading/trailing slash or whitespace).deployTargetdefinition gainsbranch/track_sha; all three on-disk copies regenerated byte-identical viacascade schema.external:guidance now points atdeploy_target{mode: gitops}for the GitOps mirror; a new reserved-shape section in versioning.md.Verification
go build ./cmd/... ./internal/...,go test ./...(1487 pass),golangci-lint run ./...(0 issues), e2ego build+go vetclean.TestPlan_MatchesGeneratedBytesstay green: generated bytes are identical with and without the new fields.24-gitops-deploy-target-reserved.yamlparses/validates and proves regeneration drift-free (verify exit 0).Closes #2