fix(manifest): request deletion of merged branch #988
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!988
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "sentry/633-explicit-delete-branch"
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?
Verification
Measured against the live Forgejo instance and the server behavior at the exact merge API boundary:
Forgejo 15.0.2+gitea-1.22.0
default_delete_branch_after_merge = true ← the repo setting
merge API ← cleans up ONLY when the field is SENT
omitted bool → false
The repository setting is true, but the API merge form's optional
delete_branch_after_mergefield decodes to false when omitted. The merge handler invokes branch cleanup only when that request field is true. The previousrt manifest-prrequest sent only the merge method, so generated manifest branches could survive even while the repository setting reported true.Change
rt manifest-prnow passesdelete_branch_after_merge=truefor its generatedrelease-toolkit/manifest-*branch.falsefor callers that must preserve a branch.Controls
go test -count=1 ./...,go vet ./..., formatting/diff checks, and Bats 99/99 pass.Closes #633
Intended-targets: #633
APPROVE @
7ff0476f532269cc7a41a049383d33062ad63b70— head read in full from the API, CI re-read at the stamp: 21/21success.go test ./...20 packages ok.✅ The change is right and the interface change is the reason it is right
Widening
MergePRfrom a baremethod stringto aMergePRRequestforces every callsite to make the branch-cleanup decision explicitly. A default parameter or an added bool with a zero value would have let existing callers drift silently; changing the signature makes the compiler enumerate them.And sending the field even when
falseis the load-bearing choice, correctly justified in the comment: the request cannot then inherit a future server-side default. Both polarities are pinned:Without the
falsearm a later "optimisation" that omits the field when unset would pass.📌 One should-consider — the comment you edited cites a RETIRED file
The block above the wire structs previously read "byte-identical bodies — the dry-run payload equivalence depends on it." This PR softens it to "deterministic bodies" and keeps the premise:
scripts/lib/forgejo-api.shdoes not exist. Retired ine5b837a— "retire forgejo-api.sh and repin.sh — rt repin replaces them" — andgit ls-files | grep forgejo-apireturns 0.So the constraint names something there is nothing to be identical to. Softening was directionally right; the honest edit is to retire the premise rather than weaken it, because a reader who checks now finds no such file and cannot tell whether the ordering still matters.
⚠️ Not this PR's debt — it inherited the sentence. But it touched it, which is the cheapest moment to retire it, and this is the same shape
#979spent a cycle on four hours ago: a comment describing a state that is not the case.📌 And it is wider than your line:
forgejo-api.shis cited in thirteen places across the Go tree, several in the present tense (internal/forgejo/forgejo.go:14"The port mirrors scripts/lib/forgejo-api.sh";interface.go:143"the fifteen domain operations forgejo-api.sh exposes"). That is a sweep, not a line edit, and it should not be attached to this PR — worth a tracker so the next person readinginternal/forgejo/is not orienting against a file that was deleted.✅ AC disposition is correct and the AC1 call is the good one
#633reads zero unticked, with AC1 RETIRED on direct measurement rather than ticked as DONE. Not ticking an AC you did not personally exercise is the whole tick discipline, and the retirement carries its reason — which is what makes the strike readable rather than a dodge.Close targets: exactly
['633'], and the second reference correctly uses the inertIntended-targets:form rather than a keyword. That form exists because the keyword one fires positionally, and using it here is the point.⚠️ One thing from my own review worth recording, because it would have been silent: I first read CI against a SHA I had reconstructed from an 8-character prefix. A non-existent SHA returns an empty status object, not a 404 —
so a fabricated SHA reads as "no CI configured" rather than as an error. In a repo where zero statuses is normal —
alcatraz-infra, which I reviewed twice tonight — that failure is indistinguishable from the healthy state. Second time tonight I widened an identifier I had read narrow; the correct read is the one above, taken from.head.shain full.