[PR #8033] [MERGED] chore(ci): shard Node regressions, cache compiled bytecode, skip the regression harness in CodeQL #8064

Closed
opened 2026-10-24 04:10:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: chore(ci)/regression-shards


📝 Commits (8)

  • 53a1aa9 chore(regressions): shard the Node regression job over three runners
  • e6fd61c chore(ci): cache compiled bytecode across regression processes
  • 78e9208 chore(codeql): skip the Node regression harness
  • d82c1a1 chore(ci): accept the shard verdict in the PR triage validator
  • 8c36340 chore(ci): pin the shard count and the verdict's dependencies in the triage validator
  • f0ee64e chore(ci): pin the verdict job's required check name in the triage validator
  • ddcb757 Merge branch 'staging' into chore(ci)/regression-shards
  • 38c2021 Merge branch 'staging' into chore(ci)/regression-shards

📊 Changes

6 files changed (+135 additions, -14 deletions)

View changed files

📝 .github/workflows/codeql.yml (+4 -0)
📝 .github/workflows/playwright.yml (+43 -4)
📝 CONTRIBUTING.md (+1 -1)
📝 scripts/regressions/regression-timeout-policy.regression.mjs (+24 -0)
📝 scripts/run-regressions.mjs (+29 -6)
📝 scripts/validate-pr-triage.mjs (+34 -3)

📄 Description

Important

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

Linked issue

Closes #8032

Why this change

Since #7971 complete-node-regressions takes 11–20 min (median ~16–17 over the 58 runs since merge) and, with CodeQL at 9–12 min on PRs, sets the PR wait. The job is CPU-bound on the 4-vCPU runner: pinned to 4 cores locally, 265 files take the same 177 s with --concurrency 4 and 8, so one runner cannot go faster. Each regression file also pays ~1.5 s of fixed start-up (tsx plus loading the shared and server sources), about 60% of the CPU time. On the CodeQL side, scripts/regressions is 956 files and 358k lines, about 30% of what the TypeScript extractor reads, and it is test harness code that never ships.

Three independent tooling changes, one per commit so any one can be reverted alone:

  1. Shard the Node regressions over 3 runners. scripts/run-regressions.mjs gains --shard <i>/<n>: it deals the slow-first order round-robin so each shard carries one of the slowest files (ruleset-combat-director, server-signal-shutdown, …), then runs its slice as before, including the serial retry of files that missed beside others. The CI job becomes a 3-way matrix plus a verdict job that keeps the complete-node-regressions name, following the pattern the browser lanes already use. Expected job time ~5–7 min instead of 11–20.
  2. NODE_COMPILE_CACHE for the shard step. Node 24 reuses compiled bytecode across the hundreds of child processes in one job. Measured 10–15% per file locally; a cache miss just compiles normally.
  3. CodeQL paths-ignore: scripts/regressions. Expected 2.5–3.5 min off the JavaScript analysis. The actions leg still covers .github/workflows. There are no open CodeQL alerts under that path, so nothing is closed by this.

Local pnpm regression is unchanged: sharding only happens when --shard is passed.

What changed

  • scripts/run-regressions.mjs: new --shard <i>/<n> option (1-based, disjoint, slow-first dealing), usage text updated; --list --shard shows a shard's files.
  • .github/workflows/playwright.yml: node-shards matrix (3) runs pnpm regression --shard i/3 with NODE_COMPILE_CACHE; complete-node-regressions is now the verdict job over the shards.
  • .github/workflows/codeql.yml: inline config with paths-ignore: scripts/regressions.
  • scripts/regressions/regression-timeout-policy.regression.mjs: shards are disjoint, cover every file, each takes one of the three slowest files; malformed --shard values are refused.
  • CONTRIBUTING.md: one sentence on --shard and the CI shards.
  • scripts/validate-pr-triage.mjs (run by open-issues.regression.ts): accepts the verdict job's needs: [revision, node-shards] and applies the same no-write-permission and github.sha checkout rules to node-shards. This is what failed shard 1 on the PR's first run. After review it also compares each job's exact needs line and checks the shard matrix against the /n in the job name and run command.
  • scripts/validate-pr-triage.mjs: accepts the verdict job's needs: [revision, node-shards] and applies the same no-write-permission rule to node-shards (the first PR run failed pnpm-validate and open-issues on exactly this assertion).

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Run by the author on this branch (worktree, Node 24.15, Linux):

First hosted run (78e920864): node-regressions 2/3 3 min 55 s, 3/3 5 min 26 s, 1/3 7 min with the one validator failure above and its serial retry; complete-node-regressions correctly reported failure. Second run (d82c1a1aa) results are in the checks below. Second run (d82c1a1aa): shards 6 min 57 s / 5 min 50 s / 5 min 42 s, all 325 or 324 files passed with no retry, verdict success; Analyze javascript-typescript 5 min 52 s. The Dottore review's two Low findings (relaxed needs matcher, shard count repeated without a check) are repaired in the validator in 8c3634058, with each drift probed locally to fail.

  • pnpm check: exit 0 (format, lint, e2e types, build).
  • node scripts/run-regressions.mjs --filter regression-timeout-policy: 1/1 passed, including the new shard assertions.
  • node scripts/run-regressions.mjs --filter game-ruleset --shard 2/3 --concurrency 4: 88/88 passed (a real sharded pool run with the serial-retry path intact).
  • --list --shard 1/3, 2/3, 3/3: 325 + 325 + 324 = 974 files, disjoint; per-shard timeout budgets 169 / 167 / 164 min; ruleset-combat-director lands in shard 1, server-signal-shutdown in shard 2. --shard 0/3 is refused with the usage text.
  • Both workflow files parse as YAML; git diff --check clean.
  • node scripts/validate-pr-triage.mjs: passes; node scripts/run-regressions.mjs --filter open-issues: 1/1 passed; pnpm format:check clean.
  • No local CodeRabbit CLI on this machine, so the GitHub review is the first automated review of this diff.

Manual verification notes

To confirm on this PR's own runs, not from local numbers:

  • Verify the three node-regressions i/3 jobs each pass and complete-node-regressions reports success; compare their durations with the ~13–17 min of the single job on recent PRs.
  • Verify a shard log shows the slow files split (ruleset-combat-director in shard 1, server-signal-shutdown in shard 2).
  • Verify the Analyze javascript-typescript job lists fewer extracted files than before (~3,564 on recent runs, ~980 of them under scripts/regressions) and its duration.
  • Verify no CodeQL alert closes as a side effect (none is open under scripts/regressions today).

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Only CONTRIBUTING.md changed (not under docs/), so no docs-i18n follow-up.

UI evidence (if applicable)

None, tooling 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-Engine/pull/8033 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `chore(ci)/regression-shards` --- ### 📝 Commits (8) - [`53a1aa9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/53a1aa9e5130f3e7d9225641037caaca0fa00228) chore(regressions): shard the Node regression job over three runners - [`e6fd61c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e6fd61cd36e956321ec74884431424ab8bdf3bec) chore(ci): cache compiled bytecode across regression processes - [`78e9208`](https://github.com/Pasta-Devs/Marinara-Engine/commit/78e920864f2a764424bf770a33d399f12c97ef13) chore(codeql): skip the Node regression harness - [`d82c1a1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d82c1a1aacc4d0c2befe6d0016badbf756254d45) chore(ci): accept the shard verdict in the PR triage validator - [`8c36340`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8c36340586c8307018ac795541ee6478ac8b7822) chore(ci): pin the shard count and the verdict's dependencies in the triage validator - [`f0ee64e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f0ee64ebef691e2017c94d4b4881c5ac12e2e028) chore(ci): pin the verdict job's required check name in the triage validator - [`ddcb757`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ddcb7570772737d88c974caf821fd400e459a0ed) Merge branch 'staging' into chore(ci)/regression-shards - [`38c2021`](https://github.com/Pasta-Devs/Marinara-Engine/commit/38c20210e0ce4042212d9c1c45600a34d8e6b919) Merge branch 'staging' into chore(ci)/regression-shards ### 📊 Changes **6 files changed** (+135 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/codeql.yml` (+4 -0) 📝 `.github/workflows/playwright.yml` (+43 -4) 📝 `CONTRIBUTING.md` (+1 -1) 📝 `scripts/regressions/regression-timeout-policy.regression.mjs` (+24 -0) 📝 `scripts/run-regressions.mjs` (+29 -6) 📝 `scripts/validate-pr-triage.mjs` (+34 -3) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #8032 ## Why this change Since #7971 `complete-node-regressions` takes 11–20 min (median ~16–17 over the 58 runs since merge) and, with CodeQL at 9–12 min on PRs, sets the PR wait. The job is CPU-bound on the 4-vCPU runner: pinned to 4 cores locally, 265 files take the same 177 s with `--concurrency 4` and `8`, so one runner cannot go faster. Each regression file also pays ~1.5 s of fixed start-up (tsx plus loading the `shared` and `server` sources), about 60% of the CPU time. On the CodeQL side, `scripts/regressions` is 956 files and 358k lines, about 30% of what the TypeScript extractor reads, and it is test harness code that never ships. Three independent tooling changes, one per commit so any one can be reverted alone: 1. **Shard the Node regressions over 3 runners.** `scripts/run-regressions.mjs` gains `--shard <i>/<n>`: it deals the slow-first order round-robin so each shard carries one of the slowest files (`ruleset-combat-director`, `server-signal-shutdown`, …), then runs its slice as before, including the serial retry of files that missed beside others. The CI job becomes a 3-way matrix plus a verdict job that keeps the `complete-node-regressions` name, following the pattern the browser lanes already use. Expected job time ~5–7 min instead of 11–20. 2. **`NODE_COMPILE_CACHE` for the shard step.** Node 24 reuses compiled bytecode across the hundreds of child processes in one job. Measured 10–15% per file locally; a cache miss just compiles normally. 3. **CodeQL `paths-ignore: scripts/regressions`.** Expected 2.5–3.5 min off the JavaScript analysis. The `actions` leg still covers `.github/workflows`. There are no open CodeQL alerts under that path, so nothing is closed by this. Local `pnpm regression` is unchanged: sharding only happens when `--shard` is passed. ## What changed - `scripts/run-regressions.mjs`: new `--shard <i>/<n>` option (1-based, disjoint, slow-first dealing), usage text updated; `--list --shard` shows a shard's files. - `.github/workflows/playwright.yml`: `node-shards` matrix (3) runs `pnpm regression --shard i/3` with `NODE_COMPILE_CACHE`; `complete-node-regressions` is now the verdict job over the shards. - `.github/workflows/codeql.yml`: inline `config` with `paths-ignore: scripts/regressions`. - `scripts/regressions/regression-timeout-policy.regression.mjs`: shards are disjoint, cover every file, each takes one of the three slowest files; malformed `--shard` values are refused. - `CONTRIBUTING.md`: one sentence on `--shard` and the CI shards. - `scripts/validate-pr-triage.mjs` (run by `open-issues.regression.ts`): accepts the verdict job's `needs: [revision, node-shards]` and applies the same no-write-permission and `github.sha` checkout rules to `node-shards`. This is what failed shard 1 on the PR's first run. After review it also compares each job's exact `needs` line and checks the shard matrix against the `/n` in the job name and run command. - `scripts/validate-pr-triage.mjs`: accepts the verdict job's `needs: [revision, node-shards]` and applies the same no-write-permission rule to `node-shards` (the first PR run failed `pnpm-validate` and `open-issues` on exactly this assertion). ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Run by the author on this branch (worktree, Node 24.15, Linux): First hosted run (78e920864): `node-regressions 2/3` 3 min 55 s, `3/3` 5 min 26 s, `1/3` 7 min with the one validator failure above and its serial retry; `complete-node-regressions` correctly reported failure. Second run (d82c1a1aa) results are in the checks below. Second run (d82c1a1aa): shards 6 min 57 s / 5 min 50 s / 5 min 42 s, all 325 or 324 files passed with no retry, verdict success; `Analyze javascript-typescript` 5 min 52 s. The Dottore review's two Low findings (relaxed `needs` matcher, shard count repeated without a check) are repaired in the validator in 8c3634058, with each drift probed locally to fail. - `pnpm check`: exit 0 (format, lint, e2e types, build). - `node scripts/run-regressions.mjs --filter regression-timeout-policy`: 1/1 passed, including the new shard assertions. - `node scripts/run-regressions.mjs --filter game-ruleset --shard 2/3 --concurrency 4`: 88/88 passed (a real sharded pool run with the serial-retry path intact). - `--list --shard 1/3`, `2/3`, `3/3`: 325 + 325 + 324 = 974 files, disjoint; per-shard timeout budgets 169 / 167 / 164 min; `ruleset-combat-director` lands in shard 1, `server-signal-shutdown` in shard 2. `--shard 0/3` is refused with the usage text. - Both workflow files parse as YAML; `git diff --check` clean. - `node scripts/validate-pr-triage.mjs`: passes; `node scripts/run-regressions.mjs --filter open-issues`: 1/1 passed; `pnpm format:check` clean. - No local CodeRabbit CLI on this machine, so the GitHub review is the first automated review of this diff. ### Manual verification notes To confirm on this PR's own runs, not from local numbers: - Verify the three `node-regressions i/3` jobs each pass and `complete-node-regressions` reports success; compare their durations with the ~13–17 min of the single job on recent PRs. - Verify a shard log shows the slow files split (`ruleset-combat-director` in shard 1, `server-signal-shutdown` in shard 2). - Verify the `Analyze javascript-typescript` job lists fewer extracted files than before (~3,564 on recent runs, ~980 of them under `scripts/regressions`) and its duration. - Verify no CodeQL alert closes as a side effect (none is open under `scripts/regressions` today). ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Only `CONTRIBUTING.md` changed (not under `docs/`), so no `docs-i18n` follow-up. ## UI evidence (if applicable) None, tooling 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-24 04:10:06 +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-Engine#8064
No description provided.