Skip to content

ci: upgrade yarn for Node 24 TypeDoc build#3728

Closed
thepastaclaw wants to merge 1 commit into
dashpay:v3.1-devfrom
thepastaclaw:fix-pages-typedoc-node
Closed

ci: upgrade yarn for Node 24 TypeDoc build#3728
thepastaclaw wants to merge 1 commit into
dashpay:v3.1-devfrom
thepastaclaw:fix-pages-typedoc-node

Conversation

@thepastaclaw
Copy link
Copy Markdown
Collaborator

@thepastaclaw thepastaclaw commented May 22, 2026

ci: upgrade yarn for Node 24 TypeDoc build

Issue being fixed or feature implemented

The GitHub Pages book deployment is failing in the Build JS/TS API docs job
when yarn typedoc runs under Node.js 24.15.0 with Yarn PnP enabled.

Failing job:
https://github.com/dashpay/platform/actions/runs/26277810277/job/77346306870

The crash is:

Error: EBADF: bad file descriptor, fstat
    at tryStatSync (node:fs:391:25)
    at readFileSync (node:fs:447:17)
    at getSourceSync (node:internal/modules/esm/load:37:14)
    at createCJSModuleWrap (node:internal/modules/esm/translators:210:32)

What was done?

Upgraded the repo-managed Yarn Berry release from 4.12.0 to 4.14.1 and kept
the Pages book workflow on Node.js 24.

Updated files:

  • package.json packageManager
  • .yarnrc.yml yarnPath
  • .yarn/releases/yarn-4.14.1.cjs
  • generated Yarn metadata: .pnp.cjs, .pnp.loader.mjs, yarn.lock
  • .github/workflows/book.yml path filters for Yarn/PnP files, so Yarn-only
    changes also trigger the Pages deploy workflow

This keeps the fix in the dependency manager layer instead of pinning the
workflow back to Node.js 22.

Validation

  • Parsed .github/workflows/book.yml as YAML successfully.

  • Smoke-tested the upgraded Yarn setup with:

    npx -y node@24.15.0 .yarn/releases/yarn-4.14.1.cjs workspaces list --json
  • Node 24.15.0 A/B result:

    A. Base branch state, Yarn 4.12.0, reproduced the failure from a clean
    origin/v3.1-dev snapshot:

    YARN_ENABLE_SCRIPTS=false npx -y node@24.15.0 \
      .yarn/releases/yarn-4.12.0.cjs install --inline-builds
    npx -y node@24.15.0 .yarn/releases/yarn-4.12.0.cjs typedoc \
      --options docs/typedoc.json --out /tmp/js-out-base412-node2415-ab

    Result: install completed, then TypeDoc failed with EBADF: bad file descriptor, fstat under Node.js 24.15.0.

    B. Updated branch state, Yarn 4.14.1, passed with the workflow-equivalent
    commands:

    YARN_ENABLE_SCRIPTS=false npx -y node@24.15.0 \
      .yarn/releases/yarn-4.14.1.cjs install --inline-builds
    npx -y node@24.15.0 .yarn/releases/yarn-4.14.1.cjs typedoc \
      --options docs/typedoc.json --out /tmp/js-out-yarn4141-node2415-final

    Result: TypeDoc generated HTML successfully with 0 errors and 3 pre-existing
    warnings.

  • Ran pre-PR code review gate; fixed the path-filter finding by adding Yarn/PnP
    files to .github/workflows/book.yml triggers.

Breaking Changes

None.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the
    corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

Release Notes

  • Chores

    • Upgraded Yarn from 4.12.0 to 4.14.1
    • Updated CI/CD workflow to trigger deployments when package manager files change
  • Bug Fixes

    • Improved package resolution and module loading reliability
    • Fixed filesystem timestamp handling for better compatibility

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ce8fa170-d586-456b-9416-b81c1dcf390a

📥 Commits

Reviewing files that changed from the base of the PR and between d4a3b46 and 3dd26f4.

⛔ Files ignored due to path filters (3)
  • .yarn/releases/yarn-4.12.0.cjs is excluded by !**/.yarn/**
  • .yarn/releases/yarn-4.14.1.cjs is excluded by !**/.yarn/**
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • .github/workflows/book.yml
  • .pnp.cjs
  • .pnp.loader.mjs
  • .yarnrc.yml
  • package.json

📝 Walkthrough

Walkthrough

Adds JS/Yarn files to the book/docs workflow push trigger, bumps project Yarn to 4.14.1, updates PnP package locations, adjusts timestamp nanosecond handling in .pnp.cjs, refactors watch-mode path reporting, and adds a Node-version-gated loader behavior for zip file descriptors.

Changes

Yarn & PnP updates

Layer / File(s) Summary
Workflow push path trigger expansion
.github/workflows/book.yml
The workflow on.push.paths list now includes package.json, yarn.lock, .yarnrc.yml, .pnp.cjs, .pnp.loader.mjs, and .yarn/releases/**.
Yarn version and package metadata
.yarnrc.yml, package.json
yarnPath and packageManager updated to Yarn 4.14.1 (.yarn/releases/yarn-4.14.1.cjs, yarn@4.14.1).
PnP packageLocation updates
.pnp.cjs (multiple entries)
Switches several packageLocation entries from unplugged/.../node_modules/ to cache/...zip/node_modules/ for @dashevo/protobufjs, core-js, protobufjs, and unrs-resolver.
bigintStats timestamp handling
.pnp.cjs
Floors numeric timestamps before BigInt conversion and adds fractional-derived nanoseconds to atimeNs/mtimeNs/ctimeNs/birthtimeNs.
Watch-mode path resolution/reporting
.pnp.cjs
reportRequiredFilesToWatchMode now accepts paths and resolves each via VirtualFS.resolveVirtual before portable conversion; call sites now pass [qualifiedPath] or candidates directly.
Loader zip-fd detection and CJS source read
.pnp.loader.mjs
Adds HAS_BROKEN_FSTAT_FOR_ZIP_FDS and updates load$1 to optionally read and return source for commonjs modules when running on affected Node versions and .zip/ paths.

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • QuantumExplorer
  • shumkov

Poem

I nibble through yarn threads, quick and spry,
Upgraded releases under moonlit sky,
PnP paths shift, timestamps gain their tune,
Watchers listen, loader hums a new rune—
A rabbit cheers: build, run, and deploy soon! 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title states 'upgrade yarn for Node 24' but the actual change pins Node.js to version 22, not upgrades to version 24 as the title suggests. Update the title to accurately reflect the change, such as 'ci: pin book TypeDoc build to Node 22' to match the actual objective of downgrading to Node.js 22 to avoid Node 24 runtime issues.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions github-actions Bot added this to the v3.1.0 milestone May 22, 2026
@thepastaclaw
Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/book.yml (1)

149-149: 💤 Low value

Consider documenting the version pin.

Adding an inline comment explaining why v22 is pinned would help future maintainers understand this isn't an oversight.

📝 Suggested documentation
       - name: Setup Node.js
         uses: actions/setup-node@v4
         with:
+          # Pinned to v22 due to EBADF errors in TypeDoc with Yarn PnP under Node 24+
           node-version: "22"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/book.yml at line 149, Add an inline comment next to the
node-version: "22" pin explaining why Node 22 is required (e.g., compatibility
with runtime, specific package or CI tools, or security/maintenance policy).
Update the workflow snippet containing node-version: "22" so the comment states
the reason and any link to issue/PR or upgrade plan, making future maintainers
aware this pin is intentional and how to change it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/book.yml:
- Line 149: Add an inline comment next to the node-version: "22" pin explaining
why Node 22 is required (e.g., compatibility with runtime, specific package or
CI tools, or security/maintenance policy). Update the workflow snippet
containing node-version: "22" so the comment states the reason and any link to
issue/PR or upgrade plan, making future maintainers aware this pin is
intentional and how to change it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c338253b-745c-471e-a083-f9e7fb031269

📥 Commits

Reviewing files that changed from the base of the PR and between 12fd1a3 and d4a3b46.

📒 Files selected for processing (1)
  • .github/workflows/book.yml

@thepastaclaw thepastaclaw force-pushed the fix-pages-typedoc-node branch from d4a3b46 to 260174c Compare May 22, 2026 18:38
@thepastaclaw thepastaclaw changed the title ci: pin book TypeDoc build to Node 22 ci: upgrade yarn for Node 24 TypeDoc build May 22, 2026
@thepastaclaw thepastaclaw force-pushed the fix-pages-typedoc-node branch from 1844399 to 2e58665 Compare May 22, 2026 18:58
@thepastaclaw thepastaclaw force-pushed the fix-pages-typedoc-node branch from 2e58665 to 3dd26f4 Compare May 22, 2026 19:02
Copy link
Copy Markdown
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

this looks reasonable to me; I think it fixes deploying the book

@PastaPastaPasta PastaPastaPasta marked this pull request as ready for review May 29, 2026 15:54
@thepastaclaw
Copy link
Copy Markdown
Collaborator Author

Closing as obsolete. The original failure was the Pages book workflow's Node 24.15.0 + Yarn 4.12.0/PnP TypeDoc EBADF issue; current v3.1-dev book deployments are succeeding again with Node 24.16.0 and the existing Yarn 4.12.0 setup, so we don't need to merge the repo-wide Yarn upgrade just for this. If we still want the book workflow path-filter improvement, that should be a separate small CI-only PR.

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