fix(FR-2906): invoke docs-toolkit CLI by node path so build_docs survives pnpm v11 bin-link gap#7441
fix(FR-2906): invoke docs-toolkit CLI by node path so build_docs survives pnpm v11 bin-link gap#7441yomybaby wants to merge 1 commit into
Conversation
…ives pnpm v11 bin-link gap
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
This PR fixes the docs PDF build failure caused by pnpm v11 not creating the docs-toolkit bin link before dist/cli.js exists. It makes docs package scripts invoke the built CLI directly via node, avoiding reliance on workspace bin linking.
Changes:
- Replaced
docs-toolkit ...script calls with directnode ../backend.ai-docs-toolkit/dist/cli.js ...invocations. - Added toolkit build steps before
agentsscripts for consistency. - Removed the obsolete CI workaround step that attempted to rebuild and relink the CLI.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/backend.ai-webui-docs/package.json |
Updates docs scripts to invoke the toolkit CLI by direct built file path. |
packages/backend.ai-docs-toolkit-example/package.json |
Applies the same direct CLI invocation pattern to example package scripts. |
.github/workflows/package.yml |
Removes the redundant docs-toolkit build/reinstall workaround from the release docs job. |
|
✅ Verified on real CI via
|

Resolves #7440(FR-2906)
Problem
The
build_docsjob in.github/workflows/package.ymlhas been failing during release builds, e.g. v26.4.8-rc.4: https://github.com/lablup/backend.ai-webui/actions/runs/25917622880/job/76178117083No PDFs are produced, so
Stage PDFs for uploadandUpload PDF release assetsare skipped and the job exits 1.Root cause
backend.ai-docs-toolkitships its CLI as a packagebinpointing at./dist/cli.js, which only exists aftertscruns. On a fresh checkout under pnpm v11 (since #7307 / #7345):pnpm install --frozen-lockfilecannot create thenode_modules/.bin/docs-toolkitsymlink because the target file does not yet exist. pnpm v11 logs a[WARN] Failed to create bin … ENOENTand skips it (older pnpm versions silently created a dangling symlink, which is what the previous "build then re-install" workaround relied on).pnpm --filter backend.ai-docs-toolkit run buildwhich producesdist/cli.js.pnpm install --frozen-lockfilehoping the bin symlink will be retried — but pnpm v11 sees node_modules asAlready up to dateand does not retry bin linking. Evenpnpm install --forceis a no-op once the lockfile andnode_modulesagree.The bin symlink stays missing for the rest of the job, and
docs-toolkit pdf --lang all(and every otherpdf:*,preview*,build:web*,serve:web*,agents*script inbackend.ai-webui-docs/backend.ai-docs-toolkit-example) fails withspawn ENOENT.Fix
Invoke the toolkit by direct file path instead of relying on the bin symlink. Each of these scripts already runs
pnpm run build:toolkitfirst, sopackages/backend.ai-docs-toolkit/dist/cli.jsis guaranteed to exist by the time we call it:This works regardless of whether pnpm managed to wire the bin link, so the same scripts behave identically on local dev and in CI under any pnpm version.
agents/agents:forcepreviously assumed the toolkit was already built; they now alsopnpm run build:toolkitfirst, matching every other entry.The CI step
Build docs-toolkit and link CLI(added as a workaround) is now obsolete —pnpm run build:toolkitinside each script handles the build, and there is no symlink to wire — so it is removed.Files
packages/backend.ai-webui-docs/package.json— replace everydocs-toolkit …invocation withnode ../backend.ai-docs-toolkit/dist/cli.js …. Add the missingpnpm run build:toolkit &&prefix toagents/agents:force.packages/backend.ai-docs-toolkit-example/package.json— same replacement..github/workflows/package.yml— drop the now-redundantBuild docs-toolkit and link CLIstep.Verification
Reproduced the exact CI scenario locally — fresh checkout, no
dist/, on pnpm v11.1.1:Before this PR:
sh: 1: docs-toolkit: not found, exit 1.After this PR:
The
[WARN] Failed to create bin …message from pnpm install still appears but is now cosmetic — nothing depends on the bin symlink anymore.Test plan
build_docsjob goes green on this PR (PDF artifacts uploaded).workflow_dispatchor release tag) attaches*.pdfassets.