Skip to content

ci: full checks on main pushes, changed-file lint on PRs, Slack alert when main breaks - #37282

Merged
nwparker merged 2 commits into
mainfrom
nwparker/main-push-checks
Nov 2, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/main-push-checks

Conversation

@nwparker

@nwparker nwparker commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​404 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​402
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​436 $\color{#cf222e}{\Huge{\mathbf{−}}}$​19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​417

Summary

This is a trial setup in three parts:

  1. Full checks on every push to main. PR Checks now also runs on push: main:
    • Every job runs: the path router gets an empty diff, which already fails closed to all jobs.
    • The input-scoped steps (localization extraction, VM rollback replay, orcad terminal smoke) run in full.
    • Each commit gets its own concurrency group (main-checks-<sha>, no cancel-in-progress), so main runs never cancel each other. PRs keep pr-checks-<number> with cancel-in-progress.
  2. PRs lint only what a change can affect. The per-file passes check only the changed paths: root oxlint, JS-plugin oxlint, anti-slop, ast-grep (lint gate and flaky-test ratchet), and oxfmt. Whole-program checks still run in full on every PR.
  3. Slack alert when main breaks. A new Main health alert workflow follows completed main runs. It posts only on green→red, and once on red→green.

What runs where

PR Push to main
Job routing (code_paths) by changed paths, as before every job
Root oxlint, JS-plugin oxlint, anti-slop, ast-grep, oxfmt changed paths (fail-open to full) full
Type-aware lint, native import/a11y plugins, typecheck, import boundaries, ratchets, dead classes, localization, generated-file checks full full
Changed-lines gates (changed-code quality, React Doctor) PR diff the pushed commit's diff (HEAD^1)
Localization extraction, VM rollback replay, orcad smoke skipped when their inputs are unchanged always
Runtime-launcher protocol ratchet PR diff plus its label override skipped: labels exist only on the PR, which already passed it
Advisory E2E lanes (e2e, real IME, real WSL) by route skipped (they have nightly schedules)
PR checks passed aggregate yes yes; it is the main health signal

Scoping details

  • Reused logic: the diff base comes from config/scripts/git-pull-request-diff-base.mjs. On a push with no payload base it now returns the first parent, which is the main tip the commit landed on. The changed-file list uses the same git diff --name-only --no-renames -z form as the localization and orcad scope steps.
  • Planner: config/scripts/lint-change-scope.mjs decides full or changed.
    • In changed mode it writes one NUL-delimited list per pass. Each list holds only paths that still exist, under that pass's scanned roots.
    • In full mode it writes nothing, and the passes run exactly as before.
  • Fail-open to full when:
    • the diff can't be resolved;
    • any of these change: .oxlintrc.json at any level, config/oxlint-*.json, config/oxlint-plugins/**, config/sgconfig.yml, config/ast-grep/**, the flaky-test baseline, the ast-grep gate scripts, .oxfmtrc.json, .gitignore, .prettierignore, any package.json, pnpm-lock.yaml, pnpm-workspace.yaml, .npmrc, pr.yml, or the planner itself;
    • more than 1500 paths change, which also caps argument length.
  • Edge cases:
    • Deleted paths drop out of every list.
    • An empty list skips its pass. For ast-grep, an empty list still runs the flaky-test ratchet, so a deleted test file with baseline entries still has to be pruned.
    • --no-error-on-unmatched-pattern covers selections where every path is ignored. Oxlint and oxfmt both apply their ignore patterns and nested configs to paths passed explicitly; I checked this locally.
    • docs/site enables oxlint's import plugin, so any change there lints all of docs/site.
  • React Doctor was already limited to changed lines, so it is unchanged.

Slack alert

  • config/scripts/main-health-alert.mjs runs on workflow_run completion of PR Checks on main, for push runs only. It ignores cancelled and skipped runs.
  • Who reports: only the newest settled main run reports. A slower, older run can't reopen a state that a newer run already reported. A re-run compares itself with its own earlier attempt, so a flaky red that passes on retry still sends the recovery message.
  • Message: it names the commit, the PR (number and title), up to 10 failed job names and a link to the run.
    • It mentions the PR's merger and author.
    • People in the optional repository variable SLACK_USER_IDS_BY_GITHUB_LOGIN (JSON, GitHub login → Slack member ID) get a real <@U…> mention. Everyone else gets the GitHub profile link that the release Slack pings use today.
  • Mechanism: it reuses the release workflow's SLACK_WEBHOOK_URL secret and its message shape (text plus an mrkdwn section block).
  • Testing: with no webhook, or with DRY_RUN=1, it prints the payload instead of posting. The unit tests cover the transitions, the mentions, the message, and a dry run against a stubbed GitHub API. Nothing was posted to Slack.

Testing

  • 42 workflow and script test files pass (836 tests), including the new lint-change-scope, main-health-alert and pr-main-push tests.
  • I simulated the scoped steps locally on a sample diff that included a docs/site page and a deleted file. Each pass checked only its own paths and exited 0.
  • oxfmt, oxlint, the anti-slop pass, pnpm check:code-quality:changed origin/main, pnpm check:flaky-test-pattern-ratchet, pnpm tc:node and actionlint pass.

Timing

This PR edits pr.yml, which is itself a fail-open input, so its own run lints everything. A scoped measurement is in the comments below.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8a5cbf28-f0c1-4c2e-a811-5217328c1632
Commits

Reviewing files that changed from the base of the PR and between 4a60ee7 and 83cf791.

Files selected for processing: 12
  • .github/scripts/check-required-pr-context.mjs
  • .github/workflows/main-health-alert.yml
  • .github/workflows/pr.yml
  • config/scripts/ast-grep-gates.mjs
  • config/scripts/git-pull-request-diff-base.mjs
  • config/scripts/git-pull-request-diff-base.test.mjs
  • config/scripts/lint-change-scope.mjs
  • config/scripts/lint-change-scope.test.mjs
  • config/scripts/main-health-alert.mjs
  • config/scripts/main-health-alert.test.mjs
  • config/scripts/pr-main-push.test.mjs
  • config/scripts/pr-ready-check-reuse.test.mjs

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3e055b44-f8bf-46b1-a11b-528e2c107c7b
Commits

Reviewing files that changed from the base of the PR and between f64b236 and 4a60ee7.

Files selected for processing: 2
  • config/scripts/main-health-alert.mjs
  • config/scripts/main-health-alert.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Walkthrough

The PR Checks workflow now runs on main pushes and uses push-specific concurrency, check routing, and verification conditions. Pull-request linting can use changed-file scopes, with full-scope fallbacks for specified conditions. A new workflow and script detect health transitions in completed main-branch runs and report them through Slack.

Merge Risk: Low · previous review 4a60e

The alert workflow is mergeable with owner awareness that rerunning a failed check can occasionally send a duplicate Slack alert. Malformed mention settings no longer prevent alerts from posting.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the three main changes: full checks on main pushes, changed-file linting on pull requests, and Slack alerts for main failures.
Description check Passed The description is detailed and covers the change scope, behavior before and after, implementation details, rationale, testing, and timing. It does not use every template heading, such as Linked Issue…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and covers the change scope, behavior before and after, implementation details, rationale, testing, and timing. It does not use every template heading, such as Linked Issue, Risk, Visual Proof or N/A, and Checklist, but the main required information is present.

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 12 functions across 10 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai 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.

Actionable comments posted: 2


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6119423b-d84a-40a5-91ee-e9674c1dfe35
Commits

Reviewing files that changed from the base of the PR and between fa962ac and f64b236.

Files selected for processing: 12
  • .github/scripts/check-required-pr-context.mjs
  • .github/workflows/main-health-alert.yml
  • .github/workflows/pr.yml
  • config/scripts/ast-grep-gates.mjs
  • config/scripts/git-pull-request-diff-base.mjs
  • config/scripts/git-pull-request-diff-base.test.mjs
  • config/scripts/lint-change-scope.mjs
  • config/scripts/lint-change-scope.test.mjs
  • config/scripts/main-health-alert.mjs
  • config/scripts/main-health-alert.test.mjs
  • config/scripts/pr-main-push.test.mjs
  • config/scripts/pr-ready-check-reuse.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Comment thread config/scripts/main-health-alert.mjs Resolved
Comment thread config/scripts/main-health-alert.mjs Resolved
@nwparker

nwparker commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Scoped-lint timing (probe PR #37283, one changed src/shared file, now closed)

This PR edits pr.yml, so its own run lints everything (3:48, including the orcad smoke). To measure scoping, I stacked a one-file change on this branch: run 41377706288.

Baseline 41362424273 Scoped probe
Root oxlint / JS plugins / anti-slop / ast-grep / oxfmt 22s / 32s / 13s / 36s / 4.5s 0–1s each (1 file)
Lint phase until type-aware finishes 84s 43s
Job 3:21 (no orcad smoke) 3:15 including the 52s orcad smoke this file triggers; ~2:40 estimated without it

The probe's typecheck failed on WorktreeCardDetailsHover.fixture.tsx. That error was on main itself: #37262 broke it and #37276 fixed it. It came from this branch's older main base, not from the probe. It's exactly the kind of red main the new alert reports.

@nwparker
nwparker force-pushed the nwparker/main-push-checks branch from f64b236 to 4a60ee7 Compare November 2, 2026 02:50
… when main breaks

PR Checks now also runs on every push to main, with each commit in its own
concurrency group so main runs never cancel one another. On a push the path
router gets an empty diff, which already fails closed to every job, and the
input-scoped steps (localization extraction, VM rollback replay, orcad smoke)
run in full. Advisory E2E lanes stay PR-only.

On PRs the per-file passes (root oxlint, JS-plugin oxlint, anti-slop, ast-grep
and oxfmt) check only the changed paths. Everything is checked when the diff
cannot be resolved, a lint toolchain input changes (oxlint/oxfmt/ast-grep
configs and plugins, package.json, the lockfile, .gitignore, pr.yml), or more
than 1500 paths change. Whole-program checks stay unscoped.

A new workflow follows completed main runs and posts to the release Slack
webhook only when main turns red, and once when it turns green again.
@nwparker
nwparker force-pushed the nwparker/main-push-checks branch from 4a60ee7 to 83cf791 Compare November 2, 2026 04:20
@nwparker
nwparker merged commit a7ae68f into main Nov 2, 2026
51 checks passed
nwparker added a commit that referenced this pull request Nov 2, 2026
…ck alert when main breaks (#37282)"

Main went red right away on the full main-push runs. Reverting to the previous PR-only checks.

This reverts commit a7ae68f.
nwparker added a commit that referenced this pull request Nov 2, 2026
…ck alert when main breaks (#37282)"

Main went red right away on the full main-push runs. Reverting to the previous PR-only checks.

This reverts commit a7ae68f.
nwparker added a commit that referenced this pull request Nov 2, 2026
…ck alert when main breaks (#37282)" (#37341)

Main went red right away on the full main-push runs. Reverting to the previous PR-only checks.

This reverts commit a7ae68f.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants