Skip to content

feat(promote): scope hotfix rejoin cleanup to the component - #524

Merged
joshua-temple merged 1 commit into
mainfrom
feat/rejoin-component-cleanup
Jul 8, 2026
Merged

joshua-temple merged 1 commit into
mainfrom
feat/rejoin-component-cleanup

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

After hotfix branches became env/<component>/<env> and hotfix tags component-namespaced, the promote rejoin cleanup still deleted env/<env> and collected hotfix tags with the manifest default grammar. For a multi-component repo that orphans or cross-deletes a component's branch and never sees its tags.

Fix

  • On a diverged rejoin, the cleanup recovers the component by parsing the recorded env ref (ParseEnvBranch) before it is cleared, and threads it onto the rejoin event.
  • Branch deletion targets env/<component>/<env> via EnvBranchName; tag collection resolves the component's strict tag grammar.
  • A single-component rejoin parses to an empty component, deletes env/<env>, and uses the default grammar, byte-identical.

Scope is the rejoin/lifecycle-cleanup path. Rollback per-component and the generator emitting --component on the hotfix workflow are separate changes.

Verification

go build ./..., go test ./... (2628 pass), go test ./... -race (2628 pass), golangci-lint run ./... clean; single-component byte-identical baseline gate green. Tests prove component-scoped branch deletion (env/api/test), no sibling cross-delete (env/web/staging never touched), tag collection scoped to the component's namespace, and the single-component path unchanged.

Refs #293.

When a hotfix rejoins trunk, the lifecycle cleanup recovers the component by parsing the recorded env ref before it is cleared, then deletes env/<component>/<env> (via EnvBranchName) and collects hotfix tags under the component's strict tag grammar. A single-component rejoin parses to an empty component, deletes env/<env>, and uses the default grammar, byte-identical. This keeps a component's rejoin from orphaning or cross-deleting a sibling's env branch and from missing its own component-namespaced hotfix tags.

Refs #293.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit a6036d3 into main Jul 8, 2026
20 checks passed
@joshua-temple
joshua-temple deleted the feat/rejoin-component-cleanup branch July 8, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant