Skip to content

ci(docs): install the website deps with bun, not npm ci - #2156

Merged
robcohen merged 3 commits into
mainfrom
fix/docs-validate-bun
Aug 26, 2026
Merged

robcohen merged 3 commits into
mainfrom
fix/docs-validate-bun

Conversation

@robcohen

Copy link
Copy Markdown
Member

validate-docs is red on every PR that touches docs/**:

npm error code EUSAGE
npm error The `npm ci` command can only install with an existing package-lock.json

Cause

The job sparse-checks-out package.json and package-lock.json from rustledger.github.io, then runs npm ci against them. That repo moved to bun and deleted its lockfile in rustledger.github.io#30 (9047afee2, 2026-08-24), so the sparse checkout now requests a path that no longer exists and npm ci has nothing to install from.

Nothing in this repo changed. docs-validate.yml only triggers on docs/**, and no PR had touched docs since that deletion, so it stayed green-by-absence until the next docs change picked it up. Its last real runs, on 2026-08-24, predate the lockfile removal.

Fix

Fetch bun.lock and install with bun install --frozen-lockfile, matching how rustledger.github.io's own deploy.yml builds the same site. --frozen-lockfile preserves the "lockfile is the source of truth" property that npm ci was there for, rather than dropping to a resolving install. VitePress runs under bunx.

Also drops .nvmrc from the rustledger sparse checkout. It existed only to feed setup-node's node-version-file, and there is no setup-node step any more.

oven-sh/setup-bun is pinned by SHA (0c5077e5 = v2.2.0), matching the pinning convention of the other actions in this file.

Scope

Not a required check (build and Python-gated cargo tests are the only two), so this was never blocking merges. It was simply going to be red on every docs PR from here on, which is the state that teaches people to ignore a red X.

Found while reviewing #2155, whose docs commit is the change that surfaced it.

🤖 Generated with Claude Code

https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr

`validate-docs` fails on every PR that touches `docs/**`:

    npm error The `npm ci` command can only install with an existing
    package-lock.json or npm-shrinkwrap.json

The job sparse-checks-out `package.json` and `package-lock.json` from
rustledger.github.io and runs `npm ci` against them. That repo moved to bun
and deleted its lockfile in rustledger.github.io#30, so the sparse checkout
now pulls a path that does not exist and `npm ci` has nothing to install
from.

Nothing here changed. The workflow only runs on `docs/**`, and no PR had
touched docs since that deletion, so the breakage sat unnoticed until the
next docs change picked it up.

Fetches `bun.lock` instead, and installs with `bun install
--frozen-lockfile`, matching how rustledger.github.io's own deploy workflow
builds the same site. `--frozen-lockfile` keeps the "the lockfile is the
source of truth" property `npm ci` was there for. VitePress runs under
`bunx`.

Drops `.nvmrc` from the rustledger sparse checkout: it existed only to feed
`setup-node`'s `node-version-file`, and there is no `setup-node` step now.

Not a required check, so this was not blocking merges -- it was just going to
be red on every docs PR from here on.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
@robcohen
robcohen requested a review from a team as a code owner August 26, 2026 02:18
Copilot AI lite review requested due to automatic review settings August 26, 2026 02:18
The previous commit fixes a broken docs build, and could not run the docs
build to prove it: the job only triggers on `docs/**`, so a PR that touches
only the workflow gets 41 checks and not this one. A CI fix that its own CI
cannot exercise merges on reasoning alone.

Adding the workflow file to both paths lists makes this PR run the job it
changes, and means the next edit here is exercised rather than assumed.

Same shape as the gap that caused the breakage in the first place. That one
went unnoticed because the trigger was narrow enough that months of commits
never touched it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the validate-docs GitHub Actions workflow so it can install and build the VitePress website after rustledger.github.io migrated from npm (package-lock.json + npm ci) to Bun (bun.lock + bun install).

Changes:

  • Updates the website sparse checkout to fetch bun.lock instead of package-lock.json.
  • Replaces Node/npm setup and install with oven-sh/setup-bun and bun install --frozen-lockfile.
  • Builds VitePress via bunx vitepress build docs and removes the no-longer-needed .nvmrc sparse checkout.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/docs-validate.yml Resolved
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100% (raw 93%, 170 masked)
Full AST Match 100%
Total Files 811
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
    The headline is the EFFECTIVE rate, after pairs where beanquery
    itself is wrong are masked. raw is the same run with nothing
    masked. A widening gap means the registry grew, not that rledger
    changed.
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

`bun-version: latest` leaves the docs build tracking whatever upstream
shipped most recently, so a bun release can turn an unrelated PR red with no
change on either side. That is the failure this workflow is being repaired
from in the first place, one layer up.

It is also precisely what happened to pta-standards recently: an unpinned
`ruff` reformatted 41 files the day it changed style, and the PR that
inherited the red build had touched one markdown file.

Pinned to 1.4.0, the current release. Nothing bumps it automatically --
dependabot maintains the action SHA, not this input -- so the comment says to
raise it deliberately.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
@robcohen
robcohen merged commit 9b69921 into main Aug 26, 2026
51 checks passed
@robcohen
robcohen deleted the fix/docs-validate-bun branch August 26, 2026 02:44
robcohen added a commit that referenced this pull request Aug 26, 2026
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