Skip to content

ci: run repo scripts on Bun - #4025

Merged
marcusrbrown merged 2 commits into
mainfrom
chore/bun-script-runtime
Oct 20, 2026
Merged

marcusrbrown merged 2 commits into
mainfrom
chore/bun-script-runtime

Conversation

@marcusrbrown

Copy link
Copy Markdown
Collaborator

Repo TypeScript scripts now run on Bun instead of Node. This continues the pnpm → Bun migration in docs/plans/2026-10-19-002-refactor-bun-migration-plan.md. Vitest and Stryker move in later PRs.

Changes

  • Workflows: 77 node scripts/… calls across 20 workflows now run bun scripts/….
    • publish-wiki.yaml gets its own SHA-pinned oven-sh/setup-bun with no-cache: true.
    • Every other converted job already gets Bun from the shared setup action.
  • Package scripts: build and the non-Renovate check:* scripts now run on Bun.
  • Agent prompts: commands now run on Bun.
  • Operator remediation text: now names Bun.
  • Keeping Node behavior under Bun:
    • bunfig.toml sets env = false, so .env is not loaded automatically.
    • bunfig.toml sets [install] auto = "disable", so a missing import fails instead of being installed from the registry.
    • The three steps that run from a directory other than the repo root (the publish-wiki lockfile gates and merge-data's private-wiki check) pass --no-install --no-env-file, because Bun reads bunfig.toml from the working directory only.
    • Scripts whose success path writes to stdout now set process.exitCode instead of calling process.exit(0). Bun truncates piped output at 64 KiB when the process exits before the pipe drains.
  • Tests: the workflow step test helper stubs bun. The data-branch probe tests assert that neither bun nor node runs after a failed probe.
  • Guidance: names Bun as the script runtime and lists the Node exceptions.

Still on Node

  • The "Test Scripts Load" job. It checks Node strip-only loading, and its context name is unchanged.
  • The private-leak scan, both the check-private-leak.yaml job and the merge-data.yaml --promotion run.
  • check:renovate-config. re2's prebuilt binary targets Node ABI 137, and Bun 1.4.3 needs ABI 147, so RE2 cannot load under Bun.
  • The Vitest step of coverage, plus Vitest and Stryker in general.
  • npm publish, the publish job's tool install, and the Quartz build.

Verification

All of the following exit 0 on a clean node_modules:

  • bun install --frozen-lockfile
  • check-types
  • lint
  • test: 5648 passed, 43 skipped, 3 todo, matching main
  • check:wiki-write-core-dist
  • check:renovate-config
  • check:mutation-guards
  • actionlint
  • both integration suites

Further checks:

  • All 45 scripts the workflows call give matching exit codes under Bun and Node, and none exits silently.
  • rollout-tracker-snapshot.ts delivers its full 309,378-byte payload through a slow pipe. Before this change it delivered 65,536 bytes.
  • With yaml missing, the publish-wiki lockfile gate exits 2.
  • A repo-root .env value is not visible to bun scripts/….

Not run before merge

Most converted workflows run only on a schedule, on dispatch, or behind a path filter, so PR CI doesn't exercise them on Bun. These need a run after merge:

  • capture-learnings, capture-patterns, cross-repo-dispatch, dispatch-renovate, draft-solutions, fro-bot, gateway-rollout-tracker, improvement-metrics, merge-data, poll-invitations, publish-wiki, reconcile-repos, release-wiki-write-core (decide), rename-tracked-repo, reset-survey-status, status-truth, survey-repo, update-metadata, wiki-lint

@marcusrbrown
marcusrbrown requested a review from fro-bot as a code owner October 20, 2026 10:30
Workflow steps, package scripts and agent prompt commands that ran
`node scripts/*.ts` now run `bun scripts/*.ts`. publish-wiki.yaml gets a
standalone setup-bun for its lockfile gate calls; Quartz stays on npm.

Still on Node: the private-leak scan (check-private-leak.yaml and the
merge-data promotion step), the "Test Scripts Load" job, the coverage
script, and check:renovate-config, because re2's native binding is built
for Node's ABI and does not load under Bun.

The workflow-step test helper stubs `bun`, and tests that pin command
strings or operator remediation text follow the new runtime.
- bunfig.toml: disable `.env` autoload and registry auto-install, which
  Node never does. Workflow steps that run from another directory
  (publish-wiki lockfile gates, merge-data privacy gate) pass
  `--no-install --no-env-file`, because bunfig.toml is only read from
  the cwd.
- Scripts that wrote stdout and then called process.exit(0) set
  process.exitCode instead, so Bun does not truncate piped output at
  64 KiB.
- The probe-step tests assert that neither the bun nor the node stub ran.
- Guidance names the Vitest step of `coverage` as the Node part and
  points the scripts runtime claim at the exception list.
@fro-bot fro-bot added the agent: working Agent is currently working on this label Oct 20, 2026
@marcusrbrown
marcusrbrown force-pushed the chore/bun-script-runtime branch from 11a04e8 to e662e2a Compare October 20, 2026 10:32

@fro-bot fro-bot left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: PASS

No confirmed correctness or security regressions. Bun setup, named Node exceptions, pinned actions, and trusted publishing boundaries are preserved, consistent with the trusted-publisher pattern.

Verified 1,084 tests across 17 files (21 skipped), YAML shape and action pins across 20 workflows, and matching Bun/Node output and exit codes in focused probes. Bun delivered the complete 99,684-byte snapshot through a delayed reader.

Blocking issues

None

Non-blocking concerns

None

Missing tests

Some existing CLI subprocess tests still exercise Node. Retaining representative Bun success/error and slow-pipe cases would make the manual parity checks repeatable; this is follow-up coverage, not a merge blocker.

Risk assessment (MED) + rationale

The runtime switch spans privileged automation. Live scheduled workflows and isolated Quartz/release-tool execution were not exercised during this review. Follow the staged post-merge validation documented in the PR.


Run Summary
Field Value
Event pull_request
Repository fro-bot/.github
Run ID 39408483670
Cache hit
Session ses_ea721f226ffeSVS0UJukOQ4s2T

@fro-bot fro-bot added agent: working Agent is currently working on this and removed agent: working Agent is currently working on this labels Oct 20, 2026

@fro-bot fro-bot left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: PASS

Approval renewed. The rebased merge tree is identical to the previously approved tree (c7145973a7af9a85dfb9769773365362f81873e2), against the same base commit.

The previous 1,084 passing tests and Bun/Node runtime probes remain applicable; they were not rerun for this unchanged tree.

Blocking issues

None

Non-blocking concerns

None

Missing tests

No new gaps. The previously noted Bun-specific subprocess regression coverage remains follow-up work.

Risk assessment (MED) + rationale

The migration spans privileged automation. Live scheduled workflows and isolated Quartz/release-tool execution still need the staged post-merge validation documented in the PR.


Run Summary
Field Value
Event pull_request
Repository fro-bot/.github
Run ID 39408676679
Cache hit
Session ses_ea721f226ffeSVS0UJukOQ4s2T

@fro-bot fro-bot removed the agent: working Agent is currently working on this label Oct 20, 2026
@marcusrbrown
marcusrbrown merged commit 621588b into main Oct 20, 2026
21 checks passed
@marcusrbrown
marcusrbrown deleted the chore/bun-script-runtime branch October 20, 2026 10:50
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