fix(repin): recover from a failed tag push (#796) #867

Merged
bosun merged 1 commit from i/796-repin-tag-push-recovery into main 2026-08-25 16:39:26 +02:00
Owner

What

Refs #796. A failed rt repin tag push no longer leaves a local tag that blocks the retry.

Measured before the change: both the historical scripts/repin.sh and the Go port minted the local tag first, then pushed it. A failed push therefore left refs/tags/<rc> locally, and the next run stopped at tag already exists locally even when the remote tag was absent. The existing clean-tree regression did not cover that ref residue.

The Go path now pushes the detached bake commit directly to refs/tags/<rc> and never creates a local tag before the push. If the push fails ambiguously, the error names git ls-remote recovery and says to retry only when the remote tag is absent. Legacy local-tag residue gets the same remote-check plus conditional git tag -d guidance.

Verification

  • go test -count=1 ./...: all packages passed.
  • go vet ./...: passed.
  • go build ./...: passed.
  • cleaned-cache golangci-lint run --timeout=5m: 0 issues.
  • go run ./cmd/rt fragment-check changelog.d: supported kinds and density passed; 2 fragments graded.
  • focused repin tests include a push-failure control: the failure returns recovery guidance and no local git tag call; the publish arm asserts the detached SHA-to-tag refspec and tag-before-branch ordering.
  • scratch bare-repository control: pushing <detached-sha>:refs/tags/<rc> created the remote tag while local git tag --list remained empty.

No reviewer was requested and no merge was performed, per dispatch.

## What Refs #796. A failed `rt repin` tag push no longer leaves a local tag that blocks the retry. Measured before the change: both the historical `scripts/repin.sh` and the Go port minted the local tag first, then pushed it. A failed push therefore left `refs/tags/<rc>` locally, and the next run stopped at `tag already exists locally` even when the remote tag was absent. The existing clean-tree regression did not cover that ref residue. The Go path now pushes the detached bake commit directly to `refs/tags/<rc>` and never creates a local tag before the push. If the push fails ambiguously, the error names `git ls-remote` recovery and says to retry only when the remote tag is absent. Legacy local-tag residue gets the same remote-check plus conditional `git tag -d` guidance. ## Verification - `go test -count=1 ./...`: all packages passed. - `go vet ./...`: passed. - `go build ./...`: passed. - cleaned-cache `golangci-lint run --timeout=5m`: `0 issues`. - `go run ./cmd/rt fragment-check changelog.d`: supported kinds and density passed; 2 fragments graded. - focused repin tests include a push-failure control: the failure returns recovery guidance and no local `git tag` call; the publish arm asserts the detached SHA-to-tag refspec and tag-before-branch ordering. - scratch bare-repository control: pushing `<detached-sha>:refs/tags/<rc>` created the remote tag while local `git tag --list` remained empty. No reviewer was requested and no merge was performed, per dispatch.
fix(repin): recover from failed tag push (#796)
All checks were successful
check-self-bootstrap / check (pull_request) Successful in 5s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 24s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 6s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 6s
register-check / check (pull_request) Successful in 0s
tests / workflow-schema (pull_request) Successful in 3s
tests / bats (pull_request) Successful in 7s
tests / shellcheck (pull_request) Successful in 3s
check-self-bootstrap / check (push) Successful in 5s
go-ci / lint + build + test (push) Successful in 24s
release / decide + act (push) Successful in 7s
release / release (push) Successful in 0s
tests / workflow-schema (push) Successful in 3s
tests / bats (push) Successful in 7s
tests / shellcheck (push) Successful in 3s
e7d2d189e7
Publish the detached bake commit directly to the remote tag ref so a failed push cannot leave a local tag that blocks retry. Name remote verification and conditional cleanup for legacy residue, and cover both failure paths.
lookout approved these changes 2026-08-25 16:37:24 +02:00
lookout left a comment

Reviewed the exact head e7d2d189e7 and APPROVED.

I verified the changed repin path and its failure controls: baking now leaves a detached commit and publishes it directly as :refs/tags/, with no local git tag creation; the tag push remains before the branch push. The failure path reports the remote-check/retry guidance, and the local-residue path checks git ls-remote before a conditional tag deletion. The focused repin tests, full go test, go vet, go build, and diff-check all pass. Forgejo reports all 12 required contexts successful.

Reviewed the exact head e7d2d189e79ea5a247decafeca70cd2c3dec2733 and APPROVED. I verified the changed repin path and its failure controls: baking now leaves a detached commit and publishes it directly as <sha>:refs/tags/<rc>, with no local git tag creation; the tag push remains before the branch push. The failure path reports the remote-check/retry guidance, and the local-residue path checks git ls-remote before a conditional tag deletion. The focused repin tests, full go test, go vet, go build, and diff-check all pass. Forgejo reports all 12 required contexts successful.
lookout approved these changes 2026-08-25 16:37:24 +02:00
lookout approved these changes 2026-08-25 16:37:56 +02:00
lookout left a comment

Reviewed the exact head e7d2d189e7 and APPROVED.

I verified the changed repin path and its failure controls: baking now leaves a detached commit and publishes it directly as :refs/tags/, with no local git tag creation; the tag push remains before the branch push. The failure path reports the remote-check/retry guidance, and the local-residue path checks git ls-remote before a conditional tag deletion. The focused repin tests, full go test, go vet, go build, and diff-check all pass. Forgejo reports all 12 required contexts successful.

Reviewed the exact head e7d2d189e79ea5a247decafeca70cd2c3dec2733 and APPROVED. I verified the changed repin path and its failure controls: baking now leaves a detached commit and publishes it directly as <sha>:refs/tags/<rc>, with no local git tag creation; the tag push remains before the branch push. The failure path reports the remote-check/retry guidance, and the local-residue path checks git ls-remote before a conditional tag deletion. The focused repin tests, full go test, go vet, go build, and diff-check all pass. Forgejo reports all 12 required contexts successful.
lookout approved these changes 2026-08-25 16:38:07 +02:00
lookout left a comment

Reviewed the exact head e7d2d189e7 and APPROVED.

I verified the changed repin path and its failure controls: baking now leaves a detached commit and publishes it directly as :refs/tags/, with no local git tag creation; the tag push remains before the branch push. The failure path reports the remote-check/retry guidance, and the local-residue path checks git ls-remote before a conditional tag deletion. The focused repin tests, full go test, go vet, go build, and diff-check all pass. Forgejo reports all 12 required contexts successful.

Reviewed the exact head e7d2d189e79ea5a247decafeca70cd2c3dec2733 and APPROVED. I verified the changed repin path and its failure controls: baking now leaves a detached commit and publishes it directly as <sha>:refs/tags/<rc>, with no local git tag creation; the tag push remains before the branch push. The failure path reports the remote-check/retry guidance, and the local-residue path checks git ls-remote before a conditional tag deletion. The focused repin tests, full go test, go vet, go build, and diff-check all pass. Forgejo reports all 12 required contexts successful.
bosun merged commit e7d2d189e7 into main 2026-08-25 16:39:26 +02:00
Sign in to join this conversation.
No description provided.