Prove the pull-request merge path before anything depends on it #78
Labels
No labels
area:docs
area:identity
area:ops
area:plugin
area:server
channel:community
channel:direct
channel:owned
channel:press
channel:social
e2ee-constrained
gate:at-ga
gate:pre-ga
marketing
parity
relay:absent
relay:planned
relay:requested
relay:supported
risk:additive
risk:contract
risk:none
usability
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Nectenda/nectenda#78
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Part of #77.
Why
Of the 15 pull requests this repository has ever had — all Renovate — not
one has been merged. Every single one was closed. The review path is
exercised; the merge path has never run here once.
The changelog design maps a PR to its commits, so it needs Forgejo to record
which commit a merge produced. Under fast-forward-only merging there is no
merge commit, and whether
merged_commit_idis populated in that case isunknown. Nothing else in #77 should be built until it is known.
What to do
Open a throwaway PR from a scratch branch, merge it fast-forward-only, then read
the row back:
Assert through something that can actually observe it:
merged_commit_idisnon-empty and names a commit that is an ancestor of
main.If it is not recorded
Two fallbacks, in order of preference:
Closes: #NN/PR: #NNgit trailer, which this repo already proves works —Co-Authored-By:andClaude-Session:appear on 92 of the last 100 commits,and
git log --format=%(trailers:key=...)parses only the real trailer block(a naive
^\w+:grep finds 14 false positives in prose);less linear history.
Proven, on Forgejo 16.0.5, without touching
main.Throwaway PR #111 from
probe-78-head(one empty commit4413b47) intoprobe-78-base(cut frommainat1d3234a), merged withPOST /pulls/111/merge {"Do":"fast-forward-only"}.Read back through three things that can observe it:
pull_request:has_merged=1,merged_commit_id=4413b47e…, andmerge_base=1d3234a1…, so a PR's commits are exactlymerge_base..merged_commit_id.GET /pulls?state=closed:merged: true,merge_commit_sha: 4413b47e…. This is the read pathchangelog.mjswill use.teacannot see these fields, but plain REST with the tea token can.4413b47is an ancestor oforigin/probe-78-base, andGET /pulls/111/commitslists it.Under fast-forward-only,
merged_commit_idis the head tip, not a merge commit. That is all the changelog needs: "merge commit is an ancestor of HEAD and not of--since" works unchanged. No trailer fallback is needed.Both probe branches are deleted.