trace-decision: test the check of the merge commit head with a merge queue
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github, javascript, node.js
- Domain
- backend-api-design, testing
Research direction
Read tools/trace-decision/collect-lib.mjs, especially mergedHead and readGitHub, and first verify the prerequisite fix for #71 is available. Follow the proposal to compare each queued pull request’s merge_commit_sha and second parent with its head.sha, then run the collector command on a line from each pull request. Done means documenting whether the existing check works for solo and grouped queue merges; if it does not, update the check and add a collector test.
Written by the indexing model from the issue text.
Description
Problem to solve
The fix for #71 adds a check to the collector of trace-decision (mergedHead and readGitHub in tools/trace-decision/collect-lib.mjs). The collector confirms a pull request that merged as a merge commit only if the second parent of the merge commit is the head of the pull request (head.sha of GET /repos/{owner}/{repo}/pulls/{number}). The check stops a wrong confirmation when a stack of pull requests merges as one merge commit.
The check is tested only with pull requests that merged directly with the merge commit method. In this repo, the second parent of the merge commit of each of the last 21 merged pull requests (#2 to #74) is the head of the pull request.
A merge queue makes its merge commits in a different way. It groups the changes of a pull request with the latest version of the base branch and with the pull requests before it in the queue, on a temporary branch. After the required checks pass, GitHub merges the temporary branch into the base branch (Managing a merge queue). The docs do not say which parents these merge commits have, or which commit merge_commit_sha gives for each pull request of a group.
If the second parent is not the head of the pull request, the collector reports each pull request that merged through the queue as not confirmed. It does not confirm a wrong pull request. But an agent then gets no confirmed pull request for the lines of these pull requests. This repo does not use a merge queue. A repo that uses this template can turn one on.
Proposal
Test the check with a merge queue:
- In a test repo, turn on a merge queue for
mainwith the merge commit method. - Add one pull request to the queue alone. Then add two pull requests that merge in one group, for example with a minimum group size of 2.
- For each pull request, compare
merge_commit_shawith the commits thatmaingot. Compare the second parent of that commit withhead.shaof the pull request. - Run
node tools/trace-decision/collect.mjs --max-references 0 <file> <start> <end>on a line of each pull request.
Result:
- If the second parent is the head of the pull request in each case, remove the "Not tested" part of the comment on
mergedHead. - If it is not, find which data of a merge through the queue identifies the pull request. Change the check, and add a test of the collector for this case.
Version
No response
More information
The check depends on the fix for #71, which is not in main yet.
- Dominant language
- Shell
- Stars
- 1
- Forks
- 0
- Avg merge
- 6h 59m
- Merged PRs (30d)
- 26
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from c-w-z/commit-decision-record
-
type/documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
c-w-z/commit-decision-record#90 · 1 comment ·
Maintainers usually reply within 1 day
-
type/documentation
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
c-w-z/commit-decision-record#85 ·
Maintainers usually reply within 1 day
-
type/documentation
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
c-w-z/commit-decision-record#84 ·
Maintainers usually reply within 1 day
-
type/feature
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
c-w-z/commit-decision-record#35 · 1 comment ·
Maintainers usually reply within 1 day
-
good first issue type/documentation
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
c-w-z/commit-decision-record#33 ·
Maintainers usually reply within 1 day
All issues in c-w-z/commit-decision-record
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
omacom/omarchy#21286 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ChurchCRM/docs.churchcrm.io#328 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
melodic-software/claude-code-plugins#20573 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
bmaltais/StartDrive#17 ·