Skip to content

Run localization catalog checks on Bun (26% less time) - #25999

Merged
nwparker merged 1 commit into
mainfrom
nwparker/bun-localization-catalogs
Oct 7, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/bun-localization-catalogs

Conversation

@nwparker

@nwparker nwparker commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​34
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6

ELI5

The localization catalog check now runs on Bun and finishes sooner. It checks the same source files, English catalog, runtime catalog, and existing translations.

What Changed

Run the combined verify:localization-catalogs command on the already pinned Bun runtime. Install that version in the PR static-analysis job. Add real Node/Bun CLI comparisons for valid catalogs and failures in each of the two checks.

Why

This is a small runtime change to an existing checker. It preserves its shared source scan and validation logic, without maintaining a second implementation or caching stale results.

Measured on macOS arm64, Apple M4 Max, Node 24.20.0, Bun 1.4.2, source d8c871a1f0a31a5ae276e2d6f1fd5641c631f717:

Same combined check Before: Node After: Bun Improvement
Median complete process wall time 4.1365s 3.0564s 26.11% less time; 1.35× speed
Minimum–maximum 4.0778–4.3278s 2.9917–3.0879s

One warmup per runtime, seven measured runs each, alternating order in each round, sequential execution. Timings include startup, scanning, validation, output, and process exit. All sixteen invocations returned 0 with byte-identical stdout and stderr (SHA-256 bde26d7b7afd7a32ebb2aa789ec001d6f8a6778a7bb34c9d69cda528cd4759f5, stdout + NUL + stderr). Each verified 15,655 source references, 15,390 English entries, 1,881 runtime entries, and the same five translation catalogs.

Measured samples in seconds:

  • Node: 4.179028, 4.327763, 4.113807, 4.136519, 4.100812, 4.077791, 4.173049.
  • Bun: 3.062949, 3.087900, 3.056414, 3.047227, 3.061861, 2.991704, 2.996659.

Reproduce with node config/scripts/verify-localization-catalogs.mjs and bun config/scripts/verify-localization-catalogs.mjs on the same checkout. These measure the checker process, excluding pnpm's unchanged command-dispatch overhead. This is not a whole-lint or CI wall-time claim: CI also pays for Bun installation. It does not establish the separate 2× full-test-suite goal.

Linked Issue

Maintainer-requested follow-up to the Bun migration. Targets main after #25998 merged; this PR adds only the four catalog/CI files. The benchmark remains the explicitly frozen earlier source above.

Visual Proof

N/A — developer verification tooling; no rendered UI or interaction change.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

macOS arm64: all four catalog/runtime-catalog/workflow test files pass under both Bun/Vitest and Node/Vitest (59 cases per runner). The added subprocess cases run the actual Node and Bun CLIs against valid catalogs, a missing source reference, and a missing runtime entry; both runtimes return the same verdicts and complete diagnostics. Repeated real-checkout measurements above also passed. The changed-code quality gate and formatting pass. Full typecheck passed with the prerequisite review fixes. CI covers Linux; no Windows or SSH runtime changes.

Review

Reviewed command entry-point execution, failure exit codes, fresh source scans, and conditional CI runtime installation. The standalone and catalog-writing commands keep their existing implementation and runtime.

Agent skill upstream boundary

  • Not applicable; no upstream skill source copied.

Notes

No application runtime, remote protocol, or catalog-content changes. Bun was already a pinned development tool for unit tests.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Visual proof is N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform and SSH/remote impact considered
  • Relevant local checks pass; CI covers the remaining repository checks

@nwparker
nwparker requested a review from brennanb2025 as a code owner October 6, 2026 22:53
@nwparker
nwparker force-pushed the nwparker/bun-test-review-followup branch from 8c085dc to f3a7d06 Compare October 6, 2026 23:52
@nwparker
nwparker force-pushed the nwparker/bun-localization-catalogs branch from 035e7ac to 53e7443 Compare October 6, 2026 23:53
@nwparker
nwparker changed the base branch from nwparker/bun-test-review-followup to main October 7, 2026 00:36
@nwparker
nwparker force-pushed the nwparker/bun-localization-catalogs branch from 53e7443 to 87a7367 Compare October 7, 2026 00:36
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1be1fbc8-0740-4486-906e-0faf8e458a59
📥 Commits

Reviewing files that changed from the base of the PR and between 9c6702b and 87a7367.

📒 Files selected for processing (4)
  • .github/workflows/pr.yml
  • config/scripts/pr-preflight-gates.test.mjs
  • config/scripts/verify-localization-catalogs.test.mjs
  • package.json

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


📝 Walkthrough

Walkthrough

The preflight workflow sets up Bun when static analysis is selected. The localization verifier package script now runs with Bun. CLI tests run valid-catalog and failure scenarios with both Node and Bun, then check exit codes, timeout status, output equality, and expected text.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 87a73

The supported PR and documented local lint paths provide the required Bun runtime, and no material merge-blocking issue is established.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: running localization catalog checks on Bun. The reported speed improvement is supported by the description’s benchmark details.
Description check ✅ Passed The description covers the required sections, explains the change and rationale, reports testing and benchmark scope, and marks visual proof as not applicable with a reason. It identifies this as a ma…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit 37ff387 into main Oct 7, 2026
37 checks passed
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.

1 participant