Skip to content

ci: Codemod Verify honours the allow-manual-edit label as an owner exception - #11387

Merged
cixzhang merged 2 commits into
mainfrom
fix/codemod-verify-allow-label
Nov 12, 2026
Merged

cixzhang merged 2 commits into
mainfrom
fix/codemod-verify-allow-label

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

  • The label: allow-manual-edit now exists on the repository. Applying a label takes triage rights, so a maintainer applies it; an author from a fork cannot.
  • The check (.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).
  • When it applies: a label starts no run in this repository (AST-030 FR17), so the label takes effect on the next push or a draft-and-ready toggle; the failure message says so. Removing it makes the next run fail again. The workflow's triggers are unchanged.
  • No new job or step. Fork and draft handling is unchanged.

Tests

.github/scripts/codemod-verify.test.mjs:

  • The check: with the label it passes and lists every mismatch; without it, it fails; with no mismatches, it passes.
  • The workflow, evaluated as written: the check sees whether the label is present; a label starts no run (the triggers stay the four pull-request types); forks and drafts are unchanged.

ci-pr-gate.test.mjs (the FR17 label rule) passes. On main's script, the check cases fail.

CI impact

CI impact: the changed job is verify-codemods on ubuntu-24.04-arm, in pull requests that change packages/cli/assets/codemods/**.

  • Jobs: +0 jobs, +0 workflows, +0 steps.
  • Job-minutes per update: unchanged; a label starts no run.
  • Runner pool: unchanged.
  • Time to green: unchanged; with the label, a pull request whose only red was this check turns green after one run.
  • Timeouts: no change.

No record changes: AST-030 FR17 already says a label starts no run, and this keeps to it.

…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.
@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 12, 2026 2:35pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 1fcdbff

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.

CI impact: 0 job-min per update · pool 0% · time to green −4.3 min · standard runners · 1 other workflow changed (not measured) · 2 CI action or script files changed (not measured)
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

@astracat-bot

astracat-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 12, 2026, 3:59 PM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

  • labeled and unlabeled in .github/workflows/codemod-verify.yml:20 make 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-160 and :219 fail 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 skipped verify-codemods result 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: the report() cases are clear; the label-event cases go with the fix.

Automated review (maintainer link)

Comment thread .github/workflows/codemod-verify.yml Resolved
Comment thread .github/workflows/codemod-verify.yml Resolved
Comment thread .github/workflows/codemod-verify.yml Resolved
Comment thread .github/scripts/codemod-verify.mjs Resolved
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.

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 report nor 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.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 12, 2026 15:35
@cixzhang
cixzhang merged commit 24abd1d into main Nov 12, 2026
119 checks passed
@github-actions
github-actions Bot deleted the fix/codemod-verify-allow-label branch November 13, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — 1fcdbff6 Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant