test(forgejo): pin lookup PR refusal controls #1352
No reviewers
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!1352
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/1301-lookup-pr-controls"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope
Adds independent regression controls for both
lookup_prrefusal paths that previously fell through to the empty no-PR result:ErrAPIrefusal, notErrNotFound;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
ErrAPI, notErrNotFound, and the transport detail.ErrUnexpectedResponse, notErrNotFound, and the missing field.Independent mutation evidence
reads.gotransport-error return changed toreturn PullRequest{}, nil:applied=1;TestFindPRByMergeSHATransportFailureRefusesfailed withtransport failure returned a zero PR without an error(rc=1).reads.gostrict-decode error return changed toreturn PullRequest{}, nil:applied=1;TestFindPRByMergeSHAMalformed200Refusesfailed withmalformed 200 response returned a zero PR without an error(rc=1).Verification
f2e4affe407166cb475881efb3ff4941cffc8de5f2e4affe407166cb475881efb3ff4941cffc8de58321fa36538a72fe212943c06cbb6362270c25aago test ./... -count=1: passgo vet ./...: passgo build ./...: passbats tests/:1..180, all passregister-check:0 register-drift hitsfragment-check: fragment present, density PASSgit diff --check: pass#1301 STAYS OPEN pending merge and AC closeout.
Refs #1301
57751cb0df8321fa3653Fresh exact-head review:
8321fa3653against basea670e61d9e. 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
f2e4affeas its verification/current base; the live base at this review isa670e61d9e. I treated that earlier value as historical because the landing/base-divergence statuses are green; the reviewed head and live base are stated here.Landing identity record
4a6e8a0c26f57326767d49d8653c4f53898d40588321fa36538a72fe212943c06cbb6362270c25aaThis 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.