fix(preflight): report branch protection read outcomes #1012

Merged
pullings merged 1 commit from i/914-preflight-input-diagnostics into main 2026-08-27 21:39:08 +02:00
Owner

Refs #914

This adds input-aware diagnostics to the branch-protection preflight:

  • HTTP 404 is reported as no protection configured.
  • HTTP 403 is reported as protection not visible to the authenticated identity.
  • malformed responses, other API statuses, and transport failures retain distinct WARN diagnostics.
  • repository, branch, and push identity are included in the diagnostic.

All outcomes remain fail-safe WARN + proceed; the change does not assert a cause for the historical v0.46.0 wrong-skip.

Verification:

  • go test ./... -count=1
  • go vet ./...
  • go build ./...
  • golangci-lint run ./... after a clean cache
  • bats --print-output-on-failure tests/
  • shellcheck and go run ./cmd/rt fragment-check changelog.d
Refs #914 This adds input-aware diagnostics to the branch-protection preflight: - HTTP 404 is reported as no protection configured. - HTTP 403 is reported as protection not visible to the authenticated identity. - malformed responses, other API statuses, and transport failures retain distinct WARN diagnostics. - repository, branch, and push identity are included in the diagnostic. All outcomes remain fail-safe `WARN + proceed`; the change does not assert a cause for the historical v0.46.0 wrong-skip. Verification: - `go test ./... -count=1` - `go vet ./...` - `go build ./...` - `golangci-lint run ./...` after a clean cache - `bats --print-output-on-failure tests/` - shellcheck and `go run ./cmd/rt fragment-check changelog.d`
fix(preflight): explain branch protection read outcomes
All checks were successful
manifest-check / check (pull_request) Successful in 0s
register-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 4s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
ac-closure-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 33s
tests / workflow-schema (pull_request) Successful in 3s
tests / dated-examples (pull_request) Successful in 4s
tests / shellcheck (pull_request) Successful in 3s
workflow-parse-check / toolkit-self parse guard and controls (pull_request) Successful in 3s
workflow-parse-check / workflow parse and schema (pull_request) Successful in 4s
workflow-parse-check / check (pull_request) Successful in 0s
check-self-bootstrap / check (pull_request) Successful in 1m7s
go-ci / lint + build + test (pull_request) Successful in 1m20s
changelog-body-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 1m58s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 2m17s
tests / bats (pull_request) Successful in 2m28s
fragment-check / changelog fragment-kind (pull_request) Successful in 3m34s
fragment-check / check (pull_request) Successful in 0s
ac-closure-check / ac-closure check (pull_request) Successful in 3m49s
ac-closure-check / check (pull_request) Successful in 0s
changelog-body-check / changelog body Cold-Read linter (pull_request) Successful in 4m4s
changelog-body-check / check (pull_request) Successful in 0s
tests / bats (push) Successful in 47s
tests / workflow-schema (push) Successful in 1m8s
go-ci / lint + build + test (push) Successful in 1m21s
tests / dated-examples (push) Successful in 1m43s
check-self-bootstrap / check (push) Successful in 1m58s
tests / shellcheck (push) Successful in 2m12s
release / decide + act (push) Successful in 3m7s
release / release (push) Successful in 0s
e3d61588af
sentry approved these changes 2026-08-27 21:38:10 +02:00
sentry left a comment

Reviewed exact head e3d61588af5f64b45a62d94f49523210e007149e against base df1e307c98276b1624db437c4e20fa0102305617.

APPROVED. The shared scalar reader preserves the existing sentinel contract: 404 remains ErrNotFound, strict 2xx shape failures remain ErrUnexpectedResponse, transport failures remain broad ErrAPI errors, and other non-2xx responses now retain their status in HTTPStatusError while unwrapping to ErrAPI. The preflight remains fail-safe WARN + proceed, while its diagnostics distinguish absent 404, hidden 403, decode/unreadable, other API status, and transport outcomes and include repo/branch/identity.

The controls cover each diagnostic with inverse assertions, exercise a real 403 through the client, and retain the dry-run GetReleaseByTag versus executing-read sentinel distinction. Exact-head local checks passed: go test ./... -count=1, go vet ./..., go build ./..., 118 Bats tests, fragment-check, and golangci-lint. Forgejo CI is 25/25 success at this head.

Reviewed exact head `e3d61588af5f64b45a62d94f49523210e007149e` against base `df1e307c98276b1624db437c4e20fa0102305617`. APPROVED. The shared scalar reader preserves the existing sentinel contract: 404 remains `ErrNotFound`, strict 2xx shape failures remain `ErrUnexpectedResponse`, transport failures remain broad `ErrAPI` errors, and other non-2xx responses now retain their status in `HTTPStatusError` while unwrapping to `ErrAPI`. The preflight remains fail-safe `WARN + proceed`, while its diagnostics distinguish absent 404, hidden 403, decode/unreadable, other API status, and transport outcomes and include repo/branch/identity. The controls cover each diagnostic with inverse assertions, exercise a real 403 through the client, and retain the dry-run `GetReleaseByTag` versus executing-read sentinel distinction. Exact-head local checks passed: `go test ./... -count=1`, `go vet ./...`, `go build ./...`, 118 Bats tests, fragment-check, and golangci-lint. Forgejo CI is 25/25 success at this head.
pullings deleted branch i/914-preflight-input-diagnostics 2026-08-27 21:39:09 +02:00
Sign in to join this conversation.
No description provided.