Repository navigation
ci: Codemod Verify honours the allow-manual-edit label as an owner exception - #11387
Conversation
…ception Codemod Verify told authors to add an allow-manual-edit label for changes beyond a codemod's scope, but the label did not exist and nothing read it. Now a maintainer applies it (applying labels takes triage rights): the check still lists every mismatch, then passes with "allowed by allow-manual-edit (owner exception)". Adding or removing that label re-runs the check; any other label event skips the job and gets its own concurrency group, so it never cancels a check in progress.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report🔎 Preview ·
|
| Before | After | Change | |
|---|---|---|---|
| Job-minutes per PR update | 118.9 | 118.9 | 0 |
| Runner pool, runner-minutes a day | 54,138 | 54,138 | 0 (0%) |
| Average concurrent jobs | 37.6 | 37.6 | 0 |
| Time to green (median → this run) | 25.2 min | 20.9 min | −4.3 min |
| Runs a day | 455 | 455 | 0 |
Other workflows: codemod-verify.yml changed: runs on pull_request; standard runners; its minutes are not measured here
Not measured (the jobs that use these keep their recent minutes above): .github/scripts/codemod-verify.mjs, .github/scripts/codemod-verify.test.mjs.
Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.
Generated by PR Enrichment workflow | View full report
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Changes requested: the owner exception in report() matches its description, but the new label triggers break the repository's CI rule for labels, and the required test check will fail on them.
labeledandunlabeledin.github/workflows/codemod-verify.yml:20make a label event start a run, which AST-030 FR17 rules out ("Applying or removing a label starts no run by itself"), and.github/scripts/ci-pr-gate.test.mjs:155-160and:219fail on this workflow once CI runs.- Adding or removing any other label on a pull request that changes codemods starts a run whose job skips, and that
skippedverify-codemodsresult becomes the latest check at the head, hiding an earlier failure until the next push. - The description says no record names this check or the label, but FR17 governs when a label starts a run, and its verification test names
codemod-verify.yml.
Suggested fix: drop the two trigger types, the label clause in the job condition and the concurrency suffix, keep ALLOW_MANUAL_EDIT and report(), and make remedy 3 say the label takes effect on the next push or a draft-and-ready toggle (a job re-run replays the old event). If label-triggered runs are wanted, amend FR17 with owner approval and update ci-pr-gate.test.mjs in the same pull request. Non-blocking: anyone with triage access can apply the label, including authors of branches in this repository, so the "owner exception" log line does not show that an owner applied it.
Claims and files checked
- Claims:
- The label now exists on the repository: verified.
- Applying it needs triage access, and a fork author cannot: verified; "so a maintainer applies it" overstates who can.
- With the label, the check lists every mismatch and passes: verified (
codemod-verify.mjs:368-382, test lines 69-84). - Without it, mismatches fail as before: verified (
codemod-verify.mjs:384, test lines 86-96). - The label state comes from the pull request event: verified (
codemod-verify.yml:50-52). - Adding or removing the label re-runs the check: true as written, but it contradicts AST-030 FR17.
- Other labels skip the job and never cancel a running check: verified (
codemod-verify.yml:30,:35); the skipped run still replaces the latest result. - No new job or step, and fork and draft handling are unchanged: verified.
- On main's script and workflow, six of the seven new cases fail: not run; consistent with reading.
- The CI impact line (runner, jobs, minutes, pool, time to green): verified by reading.
- No record names this check or the label: false (AST-030 FR17 and its test).
- Files:
.github/workflows/codemod-verify.yml: the first two blocking findings..github/scripts/codemod-verify.mjs: clear; remedy 3's text changes with the fix..github/scripts/codemod-verify.test.mjs: thereport()cases are clear; the label-event cases go with the fix.
A label starts no run in this repository (spec:AST-030 FR17), so the label triggers, their job clause and concurrency group go. The label takes effect on the next push or a draft-and-ready toggle, and the failure message says so.
There was a problem hiding this comment.
Approved. Codemod Verify now honours allow-manual-edit: with the label, the check lists every mismatched file and passes; without it, mismatches fail as before. The triggers still follow the repository's rule that a label starts no run, and remedy 3 says the label counts from the next push or a draft-and-ready toggle.
Non-blocking: GitHub lets anyone with triage access apply a label, including authors of branches in this repository, so "owner exception" in the log and the step comment says more than the permission guarantees; consider "applied by someone with triage access", or checking the labeller against the engineering owners list.
Claims and files checked
- Claims:
- The old failure text offered the label but the check never read it: verified on the base script.
- The label now exists on the repository: verified.
- Applying it needs triage access, and a fork author cannot: verified; "a maintainer applies it" means anyone with triage access.
- With the label, the check lists every mismatch and passes with the owner-exception line: verified (
codemod-verify.mjs:368-383, test lines 65-80). - Without it, mismatches fail as before: verified (
codemod-verify.mjs:384,:395-396, test lines 82-92). - The label state comes from the pull request event: verified (
codemod-verify.yml:50). - A label starts no run, so it takes effect on the next push or a draft-and-ready toggle, and the failure text says so: verified (
codemod-verify.yml:18,codemod-verify.mjs:378). - Removing the label makes the next run fail again: verified (
codemod-verify.yml:50, test line 123). - The triggers, jobs and steps are unchanged, and fork and draft handling are unchanged: verified (
codemod-verify.yml:18,:31). - The new tests cover the three check cases and the workflow's label, trigger, fork and draft conditions: verified; they pass in CI.
- The repository's pull-request gate test passes: verified in CI.
- The check cases fail on the base script: verified by reading (it exports neither
reportnor the label constant). - The CI impact line (job, runner, minutes, pool, time to green, timeouts): verified.
- No record changes, because the repository's CI rule already says a label starts no run: verified.
- Files:
.github/workflows/codemod-verify.yml: clear..github/scripts/codemod-verify.mjs: clear; the non-blocking wording note above..github/scripts/codemod-verify.test.mjs: clear.
Who this helps
An author whose pull request changes callsites beyond what a codemod can do, with a maintainer's approval. Codemod Verify's failure message told them to "add allow-manual-edit label", but the label did not exist and the check never read it, so the hatch was dead and an approved exception could not pass.
What changes
allow-manual-editnow exists on the repository. Applying a label takes triage rights, so a maintainer applies it; an author from a fork cannot..github/scripts/codemod-verify.mjs): with the label, it still runs and prints every mismatched file, then passes with "Mismatches allowed by allow-manual-edit (owner exception)". Without it, mismatches fail as before. The label state comes from the pull request event (ALLOW_MANUAL_EDIT).Tests
.github/scripts/codemod-verify.test.mjs:ci-pr-gate.test.mjs(the FR17 label rule) passes. Onmain's script, the check cases fail.CI impact
CI impact: the changed job is
verify-codemodsonubuntu-24.04-arm, in pull requests that changepackages/cli/assets/codemods/**.No record changes: AST-030 FR17 already says a label starts no run, and this keeps to it.