ci(pr-gate): sync slash-menu and runner fixes from EOS #21 - #7
Merged
Merged
Conversation
Two upstream fixes that block PRs for reasons unrelated to PR quality: - Slash-separated template choice menus are now parsed, so an answer the repo's own template documents is no longer rejected as a placeholder. - The gate no longer inherits the org's general self-hosted CI label, which was cancelling this three-second check with 'not acquired by Runner of type self-hosted even after multiple attempts'. Verified by differential replay: pre-fix and post-fix validators run against all 189 open PRs across the 19 adopting repos produced exactly one verdict change (the bug being fixed) and zero regressions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Touches hot-path: no
Phase: fix
Risk vector: forward
Summary
Syncs
pr metadata policyfrom upstreamEvoMap/engineering-operating-system(PR #21), which fixes two defects that block PRs for reasons unrelated to PR quality. Both have to land here before the check can be made required.1. Slash-separated template menus are now recognised as menus. The gate derives its contract from this repo's own PR template, including which answers a
Label: a | b | cline offers. The old parser only understood the pipe form, so a template writing the same menu with slashes offered nothing and a placeholder-looking word the template explicitly listed was rejected.EvoMap/evoxwritesBuilds on: <#PR / #issue / docs/… path / none>and documentsnonefor genuinely fresh work — the gate rejected that exact answer. Both separators now parse; the separator must be a spaced slash so a path likedocs/… pathis not shredded into bogus choices, and an et-cetera entry (...,…,etc) is not treated as a selectable answer.2. The gate no longer inherits the org's general CI runner label.
runs-onreadvars.CI_LABEL_LINUX_X64, which resolves to[self-hosted, Linux, X64]on this org. That queued a three-second check behind heavy builds on a shared autoscaled pool, and jobs came back cancelled withnot acquired by Runner of type self-hosted even after multiple attempts. For a required check, a job that never reaches a conclusion blocks the PR exactly as hard as a failing one, and re-running does not converge reliably. The gate now defaults toubuntu-latest; opting into self-hosted capacity is a dedicatedPR_GATE_RUNNERvariable, so no repo inherits a runner dependency merely by belonging to an org with a fleet.Scope and cuts
PR authors in this repo now get a metadata verdict that reflects their PR body: the answer this repo's own template prescribes is accepted, and the check reaches a conclusion instead of dying unacquired.
Nothing cut. This is the complete upstream sync of both fixes.
Not in scope: adding
pr metadata policyto this repo's branch protection. That is a separate, owner-visible step and is deliberately gated on this landing first.Module boundary
CI configuration only, and only the files the
pr-gatemodule owns:.github/workflows/pr-metadata-policy.ymlscripts/validate_pr_metadata.pyNo product code, no tests, no build config, no PR template change. The contract this gate enforces is unchanged — it is still derived from this repo's own
.github/PULL_REQUEST_TEMPLATE.mdon the default branch. No existing PR body needs editing because of this change.Alternative considered
Wait for the next routine EOS sync instead of a targeted PR. Rejected: the gate is being promoted to a required check, and shipping that promotion on top of the known-bad validator is what would strand PRs whose
Builds on:is the template-documentednone.Pinning the job to a narrower self-hosted label instead of moving to GitHub-hosted was also considered upstream and rejected — it still depends on the pool that demonstrably fails to acquire work. Using
continue-on-errorto paper over the starvation was rejected as strictly worse: it converts a starved gate into a silently-passing one.Validation
EvoMap/engineering-operating-system#21:python3 -m unittest discover -s tests— 103 tests, 1 skipped, pass;python3 scripts/validate_scaffold.py—scaffold ok.EvoMap/evox#3809FAIL → PASS, the bug) and zero PASS → FAIL regressions — so this sync cannot newly fail any currently-passing PR in this repo.pr-gate/validate_pr_metadata.pyandpr-gate/pr-metadata-policy.yml), which upstream'svalidate_scaffold.pyenforces.pr metadata policycheck exercises the synced workflow against this repo's real template.Rollback / recovery
Revert this PR to return to the previous workflow and validator. Before reverting, remove
pr metadata policyfrom this repo's branch-protection required checks if it has been added — reverting restores both theBuilds on: nonerejection and the self-hosted starvation, either of which permanently blocks PRs once the check is required.Builds on: none
Note
Medium Risk
Changes how required PR metadata is validated and where the gate runs; mis-parsing menus or runner misconfiguration could block or silently weaken enforcement, though upstream differential testing reported one targeted fix and no PASS→FAIL regressions.
Overview
Syncs the pr metadata policy gate from upstream EOS so two blocking defects are fixed before the check can be made required.
The workflow
runs-onno longer uses the org-wideCI_LABEL_LINUX_X64self-hosted label. It defaults toubuntu-latest, with optional override viaPR_GATE_RUNNER, so a short stdlib-Python job is less likely to stall or cancel with runner acquisition failures when the check must always reach a conclusion.validate_pr_metadata.pyextends_offered_choicesso declaration menus written asa / b / c(not only pipe-separated lists) count as offered answers—e.g.Builds on: … / none—while stripping angle brackets, requiring a spaced slash separator, and ignoring continuation tokens like...viaCONTINUATION_REso they are not valid selectable answers.Reviewed by Cursor Bugbot for commit ee0d731. Bugbot is set up for automated code reviews on this repo. Configure here.