test(forgejo): pin lookup PR refusal controls #1352

Merged
bosun merged 1 commit from i/1301-lookup-pr-controls into main 2026-09-06 17:24:49 +02:00
Owner

Scope

Adds independent regression controls for both lookup_pr refusal paths that previously fell through to the empty no-PR result:

  • transport failure returns a named ErrAPI refusal, not ErrNotFound;
  • HTTP 200 with a malformed pull-request body returns a named ErrUnexpectedResponse, not an empty result.

The existing merge-SHA mismatch control remains unchanged. This is test coverage and a changelog fragment; production behavior was already fail-closed.

AC evidence

  • Transport failure arm asserts nonzero/error, ErrAPI, not ErrNotFound, and the transport detail.
  • Malformed 200 arm asserts nonzero/error, ErrUnexpectedResponse, not ErrNotFound, and the missing field.
  • Each arm reddens independently under a single applied mutation; results are recorded below.

Independent mutation evidence

  • reads.go transport-error return changed to return PullRequest{}, nil: applied=1; TestFindPRByMergeSHATransportFailureRefuses failed with transport failure returned a zero PR without an error (rc=1).
  • reads.go strict-decode error return changed to return PullRequest{}, nil: applied=1; TestFindPRByMergeSHAMalformed200Refuses failed with malformed 200 response returned a zero PR without an error (rc=1).

Verification

  • Verification base at run: f2e4affe407166cb475881efb3ff4941cffc8de5
  • Current PR base: f2e4affe407166cb475881efb3ff4941cffc8de5
  • Head: 8321fa36538a72fe212943c06cbb6362270c25aa
  • go test ./... -count=1: pass
  • go vet ./...: pass
  • go build ./...: pass
  • bats tests/: 1..180, all pass
  • targeted register-check: 0 register-drift hits
  • targeted fragment-check: fragment present, density PASS
  • git diff --check: pass

#1301 STAYS OPEN pending merge and AC closeout.
Refs #1301

## Scope Adds independent regression controls for both `lookup_pr` refusal paths that previously fell through to the empty no-PR result: - transport failure returns a named `ErrAPI` refusal, not `ErrNotFound`; - HTTP 200 with a malformed pull-request body returns a named `ErrUnexpectedResponse`, not an empty result. The existing merge-SHA mismatch control remains unchanged. This is test coverage and a changelog fragment; production behavior was already fail-closed. ## AC evidence - [x] Transport failure arm asserts nonzero/error, `ErrAPI`, not `ErrNotFound`, and the transport detail. - [x] Malformed 200 arm asserts nonzero/error, `ErrUnexpectedResponse`, not `ErrNotFound`, and the missing field. - [x] Each arm reddens independently under a single applied mutation; results are recorded below. ## Independent mutation evidence - `reads.go` transport-error return changed to `return PullRequest{}, nil`: `applied=1`; `TestFindPRByMergeSHATransportFailureRefuses` failed with `transport failure returned a zero PR without an error` (rc=1). - `reads.go` strict-decode error return changed to `return PullRequest{}, nil`: `applied=1`; `TestFindPRByMergeSHAMalformed200Refuses` failed with `malformed 200 response returned a zero PR without an error` (rc=1). ## Verification - Verification base at run: `f2e4affe407166cb475881efb3ff4941cffc8de5` - Current PR base: `f2e4affe407166cb475881efb3ff4941cffc8de5` - Head: `8321fa36538a72fe212943c06cbb6362270c25aa` - `go test ./... -count=1`: pass - `go vet ./...`: pass - `go build ./...`: pass - `bats tests/`: `1..180`, all pass - targeted `register-check`: `0 register-drift hits` - targeted `fragment-check`: fragment present, density PASS - `git diff --check`: pass #1301 STAYS OPEN pending merge and AC closeout. Refs #1301
test(forgejo): pin lookup PR refusal controls
Some checks failed
base-divergence-check / check (pull_request) Failing after 6s
fork-pr-approval-notice / explain fork workflow approval (pull_request_target) Successful in 26s
check-self-bootstrap / check (pull_request) Successful in 31s
gitea-twin-check / check (pull_request) Successful in 31s
go-ci / lint + build + test (pull_request) Successful in 30s
changelog-body-check / changelog body Cold-Read linter (pull_request) Successful in 49s
changelog-body-check / check (pull_request) Successful in 0s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 50s
manifest-check / check (pull_request) Successful in 0s
ac-closure-check / check (pull_request) Has been cancelled
ac-closure-check / ac-closure check (pull_request) Has been cancelled
fragment-check / check (pull_request) Has been cancelled
fragment-check / changelog fragment-kind (pull_request) Has been cancelled
go-ci / page landing-tree failure (pull_request) Has been cancelled
register-check / check (pull_request) Has been cancelled
toolkit-self-gates / toolkit-self gates (PR's own rt) (pull_request) Has been cancelled
tests / shellcheck (pull_request) Has been cancelled
workflow-parse-check / check (pull_request) Has been cancelled
workflow-parse-check / toolkit-self parse guard and controls (pull_request) Has been cancelled
workflow-parse-check / workflow parse and schema (pull_request) Has been cancelled
tests / contract-paths (pull_request) Has been cancelled
tests / dated-examples (pull_request) Has been cancelled
tests / bats (pull_request) Has been cancelled
tests / workflow-schema (pull_request) Has been cancelled
register-check / register-drift check (pull_request) Has been cancelled
prep-order-check / check (pull_request) Has been cancelled
57751cb0df
carpenter force-pushed i/1301-lookup-pr-controls from 57751cb0df
Some checks failed
base-divergence-check / check (pull_request) Failing after 6s
fork-pr-approval-notice / explain fork workflow approval (pull_request_target) Successful in 26s
check-self-bootstrap / check (pull_request) Successful in 31s
gitea-twin-check / check (pull_request) Successful in 31s
go-ci / lint + build + test (pull_request) Successful in 30s
changelog-body-check / changelog body Cold-Read linter (pull_request) Successful in 49s
changelog-body-check / check (pull_request) Successful in 0s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 50s
manifest-check / check (pull_request) Successful in 0s
ac-closure-check / check (pull_request) Has been cancelled
ac-closure-check / ac-closure check (pull_request) Has been cancelled
fragment-check / check (pull_request) Has been cancelled
fragment-check / changelog fragment-kind (pull_request) Has been cancelled
go-ci / page landing-tree failure (pull_request) Has been cancelled
register-check / check (pull_request) Has been cancelled
toolkit-self-gates / toolkit-self gates (PR's own rt) (pull_request) Has been cancelled
tests / shellcheck (pull_request) Has been cancelled
workflow-parse-check / check (pull_request) Has been cancelled
workflow-parse-check / toolkit-self parse guard and controls (pull_request) Has been cancelled
workflow-parse-check / workflow parse and schema (pull_request) Has been cancelled
tests / contract-paths (pull_request) Has been cancelled
tests / dated-examples (pull_request) Has been cancelled
tests / bats (pull_request) Has been cancelled
tests / workflow-schema (pull_request) Has been cancelled
register-check / register-drift check (pull_request) Has been cancelled
prep-order-check / check (pull_request) Has been cancelled
to 8321fa3653
All checks were successful
check-self-bootstrap / check (pull_request) Successful in 6s
gitea-twin-check / check (pull_request) Successful in 6s
fork-pr-approval-notice / explain fork workflow approval (pull_request_target) Successful in 28s
go-ci / record reviewed vs landed commit (pull_request) Has been skipped
base-divergence-check / check (pull_request) Successful in 34s
go-ci / lint + build + test (pull_request) Successful in 33s
changelog-body-check / changelog body Cold-Read linter (pull_request) Successful in 52s
ac-closure-check / check (pull_request) Successful in 0s
changelog-body-check / check (pull_request) Successful in 0s
tests / workflow-schema (pull_request) Successful in 4s
tests / contract-paths (pull_request) Successful in 4s
tests / shellcheck (pull_request) Successful in 4s
fragment-check / check (pull_request) Successful in 0s
prep-order-check / check (pull_request) Successful in 36s
workflow-parse-check / toolkit-self parse guard and controls (pull_request) Successful in 5s
ac-closure-check / ac-closure check (pull_request) Successful in 7s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 56s
go-ci / page landing-tree failure (pull_request) Has been skipped
manifest-check / check (pull_request) Successful in 0s
tests / dated-examples (pull_request) Successful in 36s
workflow-parse-check / workflow parse and schema (pull_request) Successful in 32s
workflow-parse-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 55s
register-check / check (pull_request) Successful in 0s
fragment-check / changelog fragment-kind (pull_request) Successful in 48s
tests / bats (pull_request) Successful in 1m17s
toolkit-self-gates / toolkit-self gates (PR's own rt) (pull_request) Successful in 1m7s
2026-09-06 16:48:18 +02:00
Compare
lookout approved these changes 2026-09-06 17:22:58 +02:00
lookout left a comment

Fresh exact-head review: 8321fa3653 against base a670e61d9e. Approved officially; no content blocker.

The two new lookup_pr controls assert the refusal itself: transport failure is a named ErrAPI (not ErrNotFound) and malformed HTTP 200 is a named ErrUnexpectedResponse (not the empty no-PR result), including the relevant detail/field. Each arm independently reddens when its production error return is replaced with a nil error. The existing mismatch control remains. Exact-tree checks pass: go test ./... -count=1, forgejo package tests, vet/build per the PR evidence, diff-check, and all 23 required contexts are newest-success (27 contexts posted).

The PR body records f2e4affe as its verification/current base; the live base at this review is a670e61d9e. I treated that earlier value as historical because the landing/base-divergence statuses are green; the reviewed head and live base are stated here.

Fresh exact-head review: 8321fa36538a72fe212943c06cbb6362270c25aa against base a670e61d9ea996959a13fc2d0fe0249471aeb433. Approved officially; no content blocker. The two new lookup_pr controls assert the refusal itself: transport failure is a named ErrAPI (not ErrNotFound) and malformed HTTP 200 is a named ErrUnexpectedResponse (not the empty no-PR result), including the relevant detail/field. Each arm independently reddens when its production error return is replaced with a nil error. The existing mismatch control remains. Exact-tree checks pass: go test ./... -count=1, forgejo package tests, vet/build per the PR evidence, diff-check, and all 23 required contexts are newest-success (27 contexts posted). The PR body records f2e4affe as its verification/current base; the live base at this review is a670e61d9ea996959a13fc2d0fe0249471aeb433. I treated that earlier value as historical because the landing/base-divergence statuses are green; the reviewed head and live base are stated here.
bosun merged commit 4a6e8a0c26 into main 2026-09-06 17:24:49 +02:00
bosun deleted branch i/1301-lookup-pr-controls 2026-09-06 17:24:49 +02:00

Landing identity record

  • PR: #1352
  • landed commit (server merge_commit_sha): 4a6e8a0c26f57326767d49d8653c4f53898d4058
  • effective official approval(s):
    • @lookout, review #6746, stamped commit: 8321fa36538a72fe212943c06cbb6362270c25aa
  • replay comparison: replayed or otherwise transformed (stamped SHA differs from landed SHA)

This is a post-merge identity record. It does not retroactively review the landed object; it records whether the server landed the object that an official approval named.

<!-- release-toolkit:landing-review-record-v1 landed=4a6e8a0c26f57326767d49d8653c4f53898d4058 --> ## Landing identity record - PR: #1352 - landed commit (server merge_commit_sha): `4a6e8a0c26f57326767d49d8653c4f53898d4058` - effective official approval(s): - @lookout, review #6746, stamped commit: `8321fa36538a72fe212943c06cbb6362270c25aa` - replay comparison: replayed or otherwise transformed (stamped SHA differs from landed SHA) This is a post-merge identity record. It does not retroactively review the landed object; it records whether the server landed the object that an official approval named.
Sign in to join this conversation.
No description provided.