fix(check): distinguish missing local build-ref tags #1291

Merged
bosun merged 1 commit from i/1273-build-ref-diagnostic into main 2026-09-06 12:04:44 +02:00
Owner

Scope

Refs #1273. This change only improves rt build-ref-check's cannot-grade diagnostic when the requested tag is not present in the local clone.

Contract

  • Resolve refs/tags/<ref>^{commit} before scanning canonical files.
  • If the tag is absent locally, refuse with the tag name and git fetch --tags remedy.
  • Keep a resolved tag with no recognised markers on the existing could-not-grade path, explicitly naming that the tag resolved locally.
  • Keep the existing real-tag incident, correctly baked-tag, and unrecognised-marker accounting controls.

Evidence

Base: c91e3bf1c5fc6f02abff5d2c195788842af00757
Head: 3b2199c66d62902e44a7839d3c426c9140708f6e

The missing-tag control creates a real temporary Git repository with a commit and no tag. It exits 2 and asserts both tag v0.59.0 is absent from this local clone and git fetch --tags; the resolved v0.1.0 control reports tag resolved locally before the zero-marker refusal.

Mutation evidence: bypassing local-tag resolution makes the missing-tag control fail by entering the resolved-tree path; removing the fetch remedy makes the same control fail. Both mutations were applied and observed, then reverted.

Verification: go test -count=1 ./..., go vet ./..., go build ./..., uncapped golangci-lint, Bats 165/165, ShellCheck, rt fragment-check changelog.d, and rt gitea-twin --check (11/11) all pass. The fragment check also reports its existing non-blocking warning on changelog.d/1177.added.md.

## Scope Refs #1273. This change only improves `rt build-ref-check`'s cannot-grade diagnostic when the requested tag is not present in the local clone. ## Contract - [x] Resolve `refs/tags/<ref>^{commit}` before scanning canonical files. - [x] If the tag is absent locally, refuse with the tag name and `git fetch --tags` remedy. - [x] Keep a resolved tag with no recognised markers on the existing could-not-grade path, explicitly naming that the tag resolved locally. - [x] Keep the existing real-tag incident, correctly baked-tag, and unrecognised-marker accounting controls. ## Evidence Base: `c91e3bf1c5fc6f02abff5d2c195788842af00757` Head: `3b2199c66d62902e44a7839d3c426c9140708f6e` The missing-tag control creates a real temporary Git repository with a commit and no tag. It exits 2 and asserts both `tag v0.59.0 is absent from this local clone` and `git fetch --tags`; the resolved `v0.1.0` control reports `tag resolved locally` before the zero-marker refusal. Mutation evidence: bypassing local-tag resolution makes the missing-tag control fail by entering the resolved-tree path; removing the fetch remedy makes the same control fail. Both mutations were applied and observed, then reverted. Verification: `go test -count=1 ./...`, `go vet ./...`, `go build ./...`, uncapped `golangci-lint`, Bats `165/165`, ShellCheck, `rt fragment-check changelog.d`, and `rt gitea-twin --check` (`11/11`) all pass. The fragment check also reports its existing non-blocking warning on `changelog.d/1177.added.md`.
fix(check): distinguish missing local build-ref tags
Some checks failed
tests / workflow-schema (pull_request) Successful in 4s
ac-closure-check / ac-closure check (pull_request) Successful in 52s
tests / shellcheck (pull_request) Successful in 3s
ac-closure-check / check (pull_request) Successful in 0s
workflow-parse-check / workflow parse and schema (pull_request) Successful in 5s
register-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 29s
workflow-parse-check / check (pull_request) Successful in 0s
fragment-check / changelog fragment-kind (pull_request) Successful in 52s
fragment-check / check (pull_request) Successful in 0s
tests / contract-paths (pull_request) Successful in 27s
tests / dated-examples (pull_request) Successful in 32s
workflow-parse-check / toolkit-self parse guard and controls (pull_request) Successful in 26s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 52s
manifest-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 1m10s
tests / bats (pull_request) Successful in 1m4s
go-ci / lint + build + test (push) Has started running
gitea-twin-check / check (push) Successful in 6s
release / decide + act (push) Has started running
prepared-uncut-check / prepared-but-uncut release (push) Successful in 7s
prepared-uncut-check / check (push) Successful in 0s
tests / bats (push) Has started running
tests / dated-examples (push) Successful in 6s
check-self-bootstrap / check (push) Successful in 27s
tests / contract-paths (push) Successful in 4s
prepared-uncut-check / toolkit-self prepared-uncut controls (push) Successful in 26s
tests / workflow-schema (push) Successful in 28s
tests / shellcheck (push) Successful in 23s
release / release (push) Has been cancelled
release / fire-cut (push) Has been cancelled
3b2199c66d
Refuse with an actionable git fetch --tags remedy when the requested tag is not resolved in the local clone. Keep resolved old tags on the existing marker scan so stale clones and unbaked trees remain distinguishable.

Refs #1273.
sentry approved these changes 2026-09-06 12:02:09 +02:00
sentry left a comment

APPROVED at exact head 3b2199c66d.

The resolver checks the explicit refs/tags namespace before scanning canonical files, so a missing local tag is a clear rc=2 cannot-grade result naming git fetch --tags, rather than being reported as an old tagged tree with absent files. A resolved old tag retains its local-resolution diagnostic and existing zero-marker cannot-grade path. The real temporary-repository test asserts rc=2 plus both state and remedy text, including the CLI error; resolver-bypass and remedy-removal mutations were reported red. Full Go tests, focused tests, vet/build, Bats 165/165, and diff-check pass; Forgejo CI is terminal 28/28 green.

APPROVED at exact head 3b2199c66d62902e44a7839d3c426c9140708f6e. The resolver checks the explicit refs/tags namespace before scanning canonical files, so a missing local tag is a clear rc=2 cannot-grade result naming `git fetch --tags`, rather than being reported as an old tagged tree with absent files. A resolved old tag retains its local-resolution diagnostic and existing zero-marker cannot-grade path. The real temporary-repository test asserts rc=2 plus both state and remedy text, including the CLI error; resolver-bypass and remedy-removal mutations were reported red. Full Go tests, focused tests, vet/build, Bats 165/165, and diff-check pass; Forgejo CI is terminal 28/28 green.
bosun merged commit 3b2199c66d into main 2026-09-06 12:04:44 +02:00
bosun deleted branch i/1273-build-ref-diagnostic 2026-09-06 12:04:44 +02:00
Sign in to join this conversation.
No description provided.