Problem
Stage 2 of the Upgrade Plan wants a merge queue on the organisation ruleset. It's the one
deliverable in that stage genuinely unstarted -- confirmed by reading the org ruleset directly
(main: PR review + compliance check required, id 23431100): its rules list has no
merge_queue entry.
pr-review.yml's own header comment already documents why it can't just be turned on:
merge_group is deliberately NOT here. Neither reusable workflow can serve a merge group
today: pr-compliance.mjs reads event.pull_request and exits 1 when it is absent, and
pr_agent_review.yml maps INPUT_PR_NUMBER from github.event.pull_request.number, which is
empty in a merge group.
What actually needs deciding, not just coding
pr-compliance.mjs's checks split into two kinds, and a merge_group event can only cheaply
supply what one of them needs:
- Content checks (secrets, el-package-versions, solution-membership, test-folder,
restricted-paths, react-table, prerelease-pin) read the checked-out tree and the
baseSha...headSha diff. A merge_group's head_ref -
refs/heads/gh-readonly-queue/<base>/pr-<n>-<sha> - gives a real checkout to diff against,
so these can genuinely re-run, and arguably should: the queue's whole point is testing the
change as merged onto the current main, which can have moved since the PR was last checked.
- PR-metadata checks (pr-title, branch-name) need the pull request's own
title/body/
head.ref/user, none of which a merge_group payload carries. These were already correct
when pull_request last ran; re-fetching the PR via the API to re-check them is possible but
wasteful, and skipping them silently is fine only if that's a stated decision, not an
accident of what was easiest to parse.
pr_agent_review.yml is simpler: pr_number just needs the regex /\/pr-(\d+)-[0-9a-f]+$/
against github.event.merge_group.head_ref, feeding the same /repos/.../pulls/{n} lookup the
script already does.
Acceptance criteria
Not in scope here
Deciding whether strict_required_status_checks_policy or queue batch size need retuning once
real queue wait times are measured -- that's a weekly-review question once the queue exists, not
a prerequisite to building it.
Problem
Stage 2 of the Upgrade Plan wants a merge queue on the organisation ruleset. It's the one
deliverable in that stage genuinely unstarted -- confirmed by reading the org ruleset directly
(
main: PR review + compliance check required, id 23431100): itsruleslist has nomerge_queueentry.pr-review.yml's own header comment already documents why it can't just be turned on:What actually needs deciding, not just coding
pr-compliance.mjs's checks split into two kinds, and a merge_group event can only cheaplysupply what one of them needs:
restricted-paths, react-table, prerelease-pin) read the checked-out tree and the
baseSha...headShadiff. A merge_group'shead_ref-refs/heads/gh-readonly-queue/<base>/pr-<n>-<sha>- gives a real checkout to diff against,so these can genuinely re-run, and arguably should: the queue's whole point is testing the
change as merged onto the current main, which can have moved since the PR was last checked.
title/body/head.ref/user, none of which a merge_group payload carries. These were already correctwhen pull_request last ran; re-fetching the PR via the API to re-check them is possible but
wasteful, and skipping them silently is fine only if that's a stated decision, not an
accident of what was easiest to parse.
pr_agent_review.ymlis simpler:pr_numberjust needs the regex/\/pr-(\d+)-[0-9a-f]+$/against
github.event.merge_group.head_ref, feeding the same/repos/.../pulls/{n}lookup thescript already does.
Acceptance criteria
pr-agent-review.mjsresolvesprNumberfrommerge_group.head_refwhenpull_request.numberis absent; verified against a synthetic merge_group payload.pr-compliance.mjsdoes with themetadata-only checks under a merge_group event: re-fetch and re-check, or explicitly skip
with a stated reason -- not silently pass because the field is undefined.
pr-compliance.mjs's content checks run against a merge_group's actual diff.on: merge_groupadded to both reusable workflows'workflow_callcallers in every oneof the sixteen repositories' own
pr-review.yml-equivalent file.merge_queueadded to the organisation ruleset (New-OrgBranchRuleset.ps1is thegenerator of record; the ruleset must not be hand-edited outside it).
rebuilt by the queue and fails before reaching main -- the plan's own Stage 2 exit check.
Not in scope here
Deciding whether
strict_required_status_checks_policyor queue batch size need retuning oncereal queue wait times are measured -- that's a weekly-review question once the queue exists, not
a prerequisite to building it.