Skip to content

ref(lint): Discover repo checks from scripts/ and read files async - #3973

Merged
BYK merged 2 commits into
mainfrom
chore/check-discovery
Nov 21, 2026
Merged

BYK merged 2 commits into
mainfrom
chore/check-discovery

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #3952. That PR still kept a hand-written CHECKS list in the runner, so each new check had to be added in two places. It also read files synchronously, so a check could not overlap its file I/O.

Check discovery. scripts/check.mjs no longer keeps a CHECKS list. Every scripts/check-<name>.mjs is a check named <name>. With no name, the runner runs every check except the ones whose module exports lint = false, each with a comment that says where it runs instead:

  • ast-grep-ignores: ast-grep:lint runs it after the scan.
  • dashboard-bundle-size, package-types, release-config: CI runs them in their own jobs.

Each worker now runs its check's scripts/check-<name>.test.mjs before the check, so the tests run in parallel too. A failing test shows under that check's FAIL line.

The package.json *:check entries pass the file name. The pnpm script names stay the same, so nothing that calls them changes: migration-metadata:check runs drizzle-migrations, dashboard-style:check runs dashboard-styles, and release:check runs release-config. Only a direct node scripts/check.mjs <name> call has to use the file name now.

Async reads. readRepoFiles reads with fs.promises.readFile, at most 64 files at a time, and keeps the order. File length now reads through it too. mapBounded moved to scripts/lib/map-bounded.mjs, so the runner and the reader share it.

via @BYK.

--

View Session [Sentry]

@sentry-junior
sentry-junior Bot requested a review from BYK November 21, 2026 21:56
@vercel

vercel Bot commented Nov 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 21, 2026 9:56pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

7 screenshot changes — 7 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Run Details · Desktop
Automation Run Details · Desktop
Changed
Automation Skill Editor · Desktop
Automation Skill Editor · Desktop
Changed
Automations Runs Filters · Desktop
Automations Runs Filters · Desktop
Changed
Conversation Attachment Zoom · Desktop
Conversation Attachment Zoom · Desktop
Changed
Conversation Attachment Zoom · Mobile
Conversation Attachment Zoom · Mobile
Changed
Inbox Palette Pages · Desktop
Inbox Palette Pages · Desktop
Changed
Show 1 more changed screenshot
System Cache Health 24h · Desktop
System Cache Health 24h · Desktop
Changed

Comment thread scripts/lib/map-bounded.mjs Resolved
@BYK
BYK merged commit 1430503 into main Nov 21, 2026
57 checks passed
@BYK
BYK deleted the chore/check-discovery branch November 21, 2026 22:15
BYK added a commit that referenced this pull request Nov 21, 2026
Follow-up to #3973. The check runner and `readRepoFiles`
capped concurrency with a hand-written `mapBounded` helper. The
workspace packages already use `p-limit` for this, so the root scripts
now use it too and the helper goes away.

- Add `p-limit` ^7.3.3 as a root devDependency. The root `scripts/`
resolve packages from the root, so a workspace package's dependency does
not reach them.
- `scripts/check.mjs` and `scripts/lib/repo-files.mjs` call
`pLimit(n).map(...)`, which keeps the input order like `mapBounded` did.
The caps stay the same: the CPU count for check workers, and 64 file
reads at a time.
- Delete `scripts/lib/map-bounded.mjs`.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Acdada5c589dc375265165b968649b09b -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Acdada5c589dc375265165b968649b09b)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Acdada5c589dc375265165b968649b09b/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>

This branch was successfully deployed

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

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant