[PR #1581] [MERGED] ci: run the Catalog validation lint, typecheck and tests concurrently #1575

Closed
opened 2026-10-23 04:03:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1581
Author: @Promansis
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @Promansis

Base: staging ← Head: chore(ci)/1579-pr-checks-parallel


📝 Commits (7)

  • 73c6760 ci: run the Catalog validation lint, typecheck and tests concurrently (#1579)
  • 435affc Merge branch 'staging' into chore(ci)/1579-pr-checks-parallel
  • da39a38 ci: settle each typecheck package alone and bound the parallel runner (#1579)
  • e4af531 Merge remote-tracking branch 'upstream/staging' into chore(ci)/1579-pr-checks-parallel
  • ff8fca5 ci: kill a timed-out command's whole process group and keep a failed package's gathered report (#1579)
  • 89859ec ci: settle a timed-out command on its shell's exit (#1579)
  • b2c141d ci: let the runner's ceiling settle a timed-out command itself (#1579)

📊 Changes

4 files changed (+237 additions, -130 deletions)

View changed files

📝 .github/workflows/pull-request-checks.yml (+74 -106)
📝 package.json (+2 -2)
➕ scripts/run-parallel.mjs (+116 -0)
📝 scripts/typecheck-packages.mjs (+45 -22)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1579

Why this change

  • The required Catalog validation check takes about 3.3 min (median 199 s over the last 12 successful runs). The catalog validation itself is 5 s of that.
  • The job runs 48 steps one after another on a 4-vCPU runner. Its three big steps are each single-threaded and serial: npm run check (Prettier, then ESLint) 58 s, typecheck:packages (tsc once per package) 28 s, and about 38 test steps totalling about 49 s plus about 20 s of per-step overhead.
  • Once CodeQL stops checking out artifacts/ (#1578), this job becomes the slowest required check and sets the time to mergeable for every pull request.

What changed

 Catalog validation
   Checkout, Set up Node.js, npm ci                         (unchanged)
-  npm run check          = prettier --check && eslint       58 s
+  npm run check          = prettier --check ‖ eslint --concurrency auto
-  npm run typecheck:packages   7 × tsc, one after another   28 s
+  npm run typecheck:packages   7 × tsc at once
-  38 test and validation steps, one after another          ~49 s + ~20 s overhead
+  1 step: scripts/run-parallel.mjs runs the same 57 commands, one per core
   Check whitespace                                         (unchanged)
  • scripts/run-parallel.mjs (new, 75 lines): runs the commands it is given as arguments, or one per line on stdin with # comments, with up to one process per core. Each command's output is buffered and printed when it finishes, as a collapsed ::group:: on GitHub Actions; a failed command is printed expanded with an ::error:: annotation. Every command runs even after a failure, so one job shows every failure, and the exit status is 1 if any command failed and 2 for an empty command list.
  • package.json: check runs format:check and lint through the runner at the same time (both must still pass); lint gets --concurrency auto.
  • scripts/typecheck-packages.mjs: the packages are checked concurrently with execFile instead of execFileSync. Each package's report is printed together, in argument order, once every run has finished. The "Could not run tsc" failure when tsc cannot start is kept (error.code is the exit code with execFile; a string such as ENOENT or no code still fails the run).
  • .github/workflows/pull-request-checks.yml: the steps from "Test the package typecheck fails without tsc" to "Test owner approval evaluator" become one step that feeds the same commands to the runner through a heredoc, keeping their comments. Checkout, npm ci, npm run check, the typecheck and the whitespace check stay separate steps.

Trade-off: a failing test is found in one step's log instead of a named red step. The runner keeps each command's output in its own group, names the failed command in the error annotation, and still runs every other command.

Package and security impact

  • Affected package IDs: none (CI and repository scripts only; no package source, manifest or artifact changes)
  • Engine compatibility impact: none
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Run locally on the pushed commit, pinned to 4 cores with taskset -c 0-3 to match a runner:

Step Before (serial, local) After (4 cores, local) CI before
npm run check 50 s (Prettier 26 s + ESLint 24 s) 32.3 s (Prettier 32.3 s, ESLint 20.3 s) 58 s
npm run typecheck:packages 31 s 18.0 s 28 s
Test step (57 commands) about 50 s 21.9 s, 57 of 57 passed about 49 s + about 20 s step overhead
  • The test step was run exactly as the workflow does, by extracting the heredoc from the YAML and piping it to the runner. The slowest commands were packages/pixelforge/test-brief.mjs 20.4 s, scripts/validate-catalog.mjs 7.1 s and the Noodle timeline context budget regression 7.0 s. All 57 passed.
  • node scripts/tests/typecheck-packages-missing-tsc.regression.mjs passes against the changed script: a tree without node_modules/.bin/tsc fails with Could not run tsc (ENOENT).
  • Runner edge cases: no commands or only comments exits 2 with the usage; --jobs x exits 2; true + exit 3 + echo hi; false runs all three, prints each one's output and exits 1; with GITHUB_ACTIONS=true a passing command is wrapped in ::group::/::endgroup:: and a failing one gets ::error:: and stays expanded; a missing binary reports exit 127.
  • actionlint 1.7.7 on the workflow passes.
  • git diff --check is clean.
  • npm run check (the new form) passes; Prettier formatted the two changed scripts.

Measured on this PR's two runs (73c6760ac, draft and ready-for-review events), against the medians of the last 12 successful staging runs:

Step Before (median) Now (two runs)
Check formatting and lint 58 s 45 s, 49 s
Check package source names 28 s 22 s, 23 s
Tests and validation (38 steps → 1 step) about 49 s + about 20 s step overhead 29 s, 31 s
Catalog validation job 199 s 142 s, 149 s

Smaller than the local estimate: the runner's Prettier run is the floor of the lint step at about 45 s, and the seven typechecks share four slower cores. Both runs passed all 57 commands.

Manual verification notes

  • On this PR's Catalog validation run, manually verify the step durations against the table above and that the job finishes in about 2 minutes.
  • Manually verify the test step's log shows one collapsed group per command with its duration, and the summary line 57 of 57 commands passed.
  • Manually verify a deliberate failure (for example a temporary exit 1 line in the heredoc on a scratch branch) shows as an ::error:: annotation naming the command, with the other commands still run.

Merge Danger

Door: two-way. A revert restores the serial steps; no data, package or artifact changes.

Blast radius: the required Catalog validation check and the contributor-facing npm run check. A test that is sensitive to running alongside others would show up as a failure in the combined step; locally all 57 passed at 4 and at 12 jobs. The 38 step names disappear from the Checks UI in favour of log groups. feature(saucelings)/saucelings adds a test step and a package.json line in the replaced region and will need a small conflict resolution whichever lands second.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

CONTRIBUTING.md describes npm run check as verifying Prettier and ESLint; it still does, so no docs change.

UI evidence (if applicable)

Not applicable (CI only).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/1581 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `chore(ci)/1579-pr-checks-parallel` --- ### 📝 Commits (7) - [`73c6760`](https://github.com/Pasta-Devs/Marinara-Agents/commit/73c6760accc842625ddb9cc2786b98cac2ad43db) ci: run the Catalog validation lint, typecheck and tests concurrently (#1579) - [`435affc`](https://github.com/Pasta-Devs/Marinara-Agents/commit/435affcddc588456f8a4d810a3cefd2446c7a3cc) Merge branch 'staging' into chore(ci)/1579-pr-checks-parallel - [`da39a38`](https://github.com/Pasta-Devs/Marinara-Agents/commit/da39a38a50a6717acbe5fd6ab84a1b4810ddb2e3) ci: settle each typecheck package alone and bound the parallel runner (#1579) - [`e4af531`](https://github.com/Pasta-Devs/Marinara-Agents/commit/e4af531bcd7b951f163769005f74d9ae9fbf8eac) Merge remote-tracking branch 'upstream/staging' into chore(ci)/1579-pr-checks-parallel - [`ff8fca5`](https://github.com/Pasta-Devs/Marinara-Agents/commit/ff8fca5ee12aeb8398a225655bae7c0a0e8077d0) ci: kill a timed-out command's whole process group and keep a failed package's gathered report (#1579) - [`89859ec`](https://github.com/Pasta-Devs/Marinara-Agents/commit/89859ecf580bfcbc50cb3db45dec8cf14e8e26c5) ci: settle a timed-out command on its shell's exit (#1579) - [`b2c141d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b2c141d0809b0fc6be41f48d05d2ef7d18a92983) ci: let the runner's ceiling settle a timed-out command itself (#1579) ### 📊 Changes **4 files changed** (+237 additions, -130 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/pull-request-checks.yml` (+74 -106) 📝 `package.json` (+2 -2) ➕ `scripts/run-parallel.mjs` (+116 -0) 📝 `scripts/typecheck-packages.mjs` (+45 -22) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #1579 ## Why this change - The required `Catalog validation` check takes about 3.3 min (median 199 s over the last 12 successful runs). The catalog validation itself is 5 s of that. - The job runs 48 steps one after another on a 4-vCPU runner. Its three big steps are each single-threaded and serial: `npm run check` (Prettier, then ESLint) 58 s, `typecheck:packages` (tsc once per package) 28 s, and about 38 test steps totalling about 49 s plus about 20 s of per-step overhead. - Once CodeQL stops checking out `artifacts/` (#1578), this job becomes the slowest required check and sets the time to mergeable for every pull request. ## What changed ```diff Catalog validation Checkout, Set up Node.js, npm ci (unchanged) - npm run check = prettier --check && eslint 58 s + npm run check = prettier --check ‖ eslint --concurrency auto - npm run typecheck:packages 7 × tsc, one after another 28 s + npm run typecheck:packages 7 × tsc at once - 38 test and validation steps, one after another ~49 s + ~20 s overhead + 1 step: scripts/run-parallel.mjs runs the same 57 commands, one per core Check whitespace (unchanged) ``` - `scripts/run-parallel.mjs` (new, 75 lines): runs the commands it is given as arguments, or one per line on stdin with `#` comments, with up to one process per core. Each command's output is buffered and printed when it finishes, as a collapsed `::group::` on GitHub Actions; a failed command is printed expanded with an `::error::` annotation. Every command runs even after a failure, so one job shows every failure, and the exit status is 1 if any command failed and 2 for an empty command list. - `package.json`: `check` runs `format:check` and `lint` through the runner at the same time (both must still pass); `lint` gets `--concurrency auto`. - `scripts/typecheck-packages.mjs`: the packages are checked concurrently with `execFile` instead of `execFileSync`. Each package's report is printed together, in argument order, once every run has finished. The "Could not run tsc" failure when tsc cannot start is kept (`error.code` is the exit code with `execFile`; a string such as `ENOENT` or no code still fails the run). - `.github/workflows/pull-request-checks.yml`: the steps from "Test the package typecheck fails without tsc" to "Test owner approval evaluator" become one step that feeds the same commands to the runner through a heredoc, keeping their comments. Checkout, `npm ci`, `npm run check`, the typecheck and the whitespace check stay separate steps. Trade-off: a failing test is found in one step's log instead of a named red step. The runner keeps each command's output in its own group, names the failed command in the error annotation, and still runs every other command. ## Package and security impact - Affected package IDs: none (CI and repository scripts only; no package source, manifest or artifact changes) - Engine compatibility impact: none - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none ## Validation - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` Run locally on the pushed commit, pinned to 4 cores with `taskset -c 0-3` to match a runner: | Step | Before (serial, local) | After (4 cores, local) | CI before | | --- | --- | --- | --- | | `npm run check` | 50 s (Prettier 26 s + ESLint 24 s) | 32.3 s (Prettier 32.3 s, ESLint 20.3 s) | 58 s | | `npm run typecheck:packages` | 31 s | 18.0 s | 28 s | | Test step (57 commands) | about 50 s | 21.9 s, 57 of 57 passed | about 49 s + about 20 s step overhead | - The test step was run exactly as the workflow does, by extracting the heredoc from the YAML and piping it to the runner. The slowest commands were `packages/pixelforge/test-brief.mjs` 20.4 s, `scripts/validate-catalog.mjs` 7.1 s and the Noodle timeline context budget regression 7.0 s. All 57 passed. - `node scripts/tests/typecheck-packages-missing-tsc.regression.mjs` passes against the changed script: a tree without `node_modules/.bin/tsc` fails with `Could not run tsc (ENOENT)`. - Runner edge cases: no commands or only comments exits 2 with the usage; `--jobs x` exits 2; `true` + `exit 3` + `echo hi; false` runs all three, prints each one's output and exits 1; with `GITHUB_ACTIONS=true` a passing command is wrapped in `::group::`/`::endgroup::` and a failing one gets `::error::` and stays expanded; a missing binary reports `exit 127`. - `actionlint 1.7.7` on the workflow passes. - `git diff --check` is clean. - `npm run check` (the new form) passes; Prettier formatted the two changed scripts. Measured on this PR's two runs (73c6760ac, draft and ready-for-review events), against the medians of the last 12 successful `staging` runs: | Step | Before (median) | Now (two runs) | | --- | --- | --- | | Check formatting and lint | 58 s | 45 s, 49 s | | Check package source names | 28 s | 22 s, 23 s | | Tests and validation (38 steps → 1 step) | about 49 s + about 20 s step overhead | 29 s, 31 s | | Catalog validation job | 199 s | 142 s, 149 s | Smaller than the local estimate: the runner's Prettier run is the floor of the lint step at about 45 s, and the seven typechecks share four slower cores. Both runs passed all 57 commands. ### Manual verification notes - On this PR's `Catalog validation` run, manually verify the step durations against the table above and that the job finishes in about 2 minutes. - Manually verify the test step's log shows one collapsed group per command with its duration, and the summary line `57 of 57 commands passed`. - Manually verify a deliberate failure (for example a temporary `exit 1` line in the heredoc on a scratch branch) shows as an `::error::` annotation naming the command, with the other commands still run. ## Merge Danger **Door:** two-way. A revert restores the serial steps; no data, package or artifact changes. **Blast radius:** the required `Catalog validation` check and the contributor-facing `npm run check`. A test that is sensitive to running alongside others would show up as a failure in the combined step; locally all 57 passed at 4 and at 12 jobs. The 38 step names disappear from the Checks UI in favour of log groups. `feature(saucelings)/saucelings` adds a test step and a `package.json` line in the replaced region and will need a small conflict resolution whichever lands second. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation `CONTRIBUTING.md` describes `npm run check` as verifying Prettier and ESLint; it still does, so no docs change. ## UI evidence (if applicable) Not applicable (CI only). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:03:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1575
No description provided.