Skip to content

fix: extract Node.js/Yarn checks into shared script#9638

Open
Giggitycountless wants to merge 2 commits intowarpdotdev:masterfrom
Giggitycountless:fix/nodejs-yarn-checks-v2
Open

fix: extract Node.js/Yarn checks into shared script#9638
Giggitycountless wants to merge 2 commits intowarpdotdev:masterfrom
Giggitycountless:fix/nodejs-yarn-checks-v2

Conversation

@Giggitycountless
Copy link
Copy Markdown

@Giggitycountless Giggitycountless commented Apr 30, 2026

The Node.js and Yarn 4+ prerequisite checks were duplicated across bootstrap scripts. This PR extracts them into a shared script that's sourced from each location.

Changes:

  • Create script/check_node_yarn_deps.sh with the validation logic
  • Source it from script/linux/bootstrap and script/macos/bootstrap (NOT from install_build_deps since CI calls that before Node is installed)
  • Add prerequisite docs to WARP.md

This is a cleaner version of #9571 that addresses the review feedback:

  • Eliminates duplicated code
  • Uses consistent version comparison logic
  • Single source of truth for the checks
  • Only checks in bootstrap scripts (developer-facing), not in CI-facing scripts

Fixes #9571

The Node.js and Yarn 4+ prerequisite checks were duplicated across
3 bootstrap scripts (linux/bootstrap, linux/install_build_deps,
macos/bootstrap). Extract them into script/check_node_yarn_deps.sh
and source it from each location.

Also adds the prerequisite docs to WARP.md.
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 30, 2026

@Giggitycountless

I ran into an unexpected error while working on this.

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I reviewed this pull request and requested human review from: @warpdotdev/oss-maintainers.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR extracts Node.js/Yarn prerequisite validation into a shared script and sources it from Linux/macOS bootstrap paths.

Concerns

  • script/linux/install_build_deps is invoked by the CI prepare-environment action before that action installs Node and enables Corepack, so the new prerequisite check would fail Linux CI jobs before their existing setup-node step runs.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread script/linux/install_build_deps Outdated
fi

# Check Node.js and Yarn 4+ prerequisites.
source "$PWD/script/check_node_yarn_deps.sh"
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.

⚠️ [IMPORTANT] This script runs in the CI prepare-environment action before Node/Corepack are installed, so sourcing this check here will fail Linux CI before its existing setup-node step. Move the CI Node/Corepack setup earlier or defer this check until after those tools are installed.

@captainsafia captainsafia added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Apr 30, 2026 — with Warp Dev Github Integration
CI calls install_build_deps before Node.js is installed, so the
prerequisite check would fail. Keep the check only in the bootstrap
scripts which are run by developers after their environment is set up.
@Giggitycountless
Copy link
Copy Markdown
Author

/oz-review

1 similar comment
@Giggitycountless
Copy link
Copy Markdown
Author

/oz-review

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds a shared Node.js/Yarn prerequisite script and wires it into the Linux and macOS bootstrap flows, with WARP.md documentation.

Concerns

  • The inlined diff does not wire the shared check into script/linux/install_build_deps, even though that script is a standalone Linux dependency setup path and the PR description says it should source the check. Direct callers still bypass the new validation.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread script/linux/bootstrap
sudo apt update -y

# Check Node.js and Yarn 4+ prerequisites.
source "$PWD/script/check_node_yarn_deps.sh"
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.

⚠️ [IMPORTANT] script/linux/install_build_deps is a standalone Linux setup path, but this diff only sources the shared check from bootstrap; source it from the build-deps script too so direct installs don't bypass the prerequisite validation.

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR extracts the Node.js and Yarn prerequisite checks into a shared bootstrap script, sources it from the Linux and macOS bootstrap flows, and documents the prerequisites in WARP.md.

Concerns

  • No blocking correctness or security concerns found in the changed lines.
  • The changed paths only match the catch-all stakeholder team in the provided STAKEHOLDERS rules, so no single eligible GitHub login could be selected for recommended_reviewers.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants