Skip to content

fix: pin Yarn version from packageManager field in remaining build scripts#10175

Merged
asheshv merged 2 commits into
pgadmin-org:masterfrom
asheshv:fix/yarn-version-pin-remaining-scripts
Jul 23, 2026
Merged

fix: pin Yarn version from packageManager field in remaining build scripts#10175
asheshv merged 2 commits into
pgadmin-org:masterfrom
asheshv:fix/yarn-version-pin-remaining-scripts

Conversation

@asheshv

@asheshv asheshv commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fix: pin Yarn version from packageManager field in build scripts #10156 fixed CI build failures caused by Yarn 4.x fetching a newer patch with different builtin compat hashes, which broke --immutable lockfile validation, but only patched pkg/linux/build-functions.sh and the GitHub Actions workflows.
  • Make.bat, pkg/mac/build-functions.sh, pkg/pip/build.sh, and Dockerfile still hardcoded yarn set version 4, which is what caused the Windows Jenkins snapshot build to fail (job pgadmin4-windows-x64-snapshot Fix PEP-8 issues in various modules (RM #3121) #1669, The lockfile would have been modified by this install, which is explicitly forbidden.).
  • This applies the same fix pattern: derive the Yarn version from each workspace's package.json packageManager field instead of hardcoding a major version.

Test plan

  • Windows Jenkins snapshot build succeeds
  • macOS build succeeds (both runtime and web node_modules install steps)
  • Docker image build succeeds
  • pip package build succeeds

Summary by CodeRabbit

  • Bug Fixes
    • Build and packaging processes now use the Yarn version specified in the project’s package.json packageManager field instead of a fixed Yarn version.
    • Added explicit, early build failures when the Yarn version cannot be determined.
    • Improved consistency across Docker, Windows, macOS, and Python package build steps by aligning Yarn setup logic.

…ripts

pgadmin-org#10156 fixed CI build failures caused by Yarn 4.x fetching a newer patch
with different builtin compat hashes, breaking --immutable lockfile
validation, but only patched pkg/linux/build-functions.sh and the GHA
workflows. Make.bat, pkg/mac/build-functions.sh, pkg/pip/build.sh, and
Dockerfile still hardcoded 'yarn set version 4', which is what broke the
Windows Jenkins snapshot build (job 1669).
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8abe337c-799f-4ee5-8e73-bea93bb541e8

📥 Commits

Reviewing files that changed from the base of the PR and between 5f7e1bf and cf0d9bb.

📒 Files selected for processing (1)
  • Make.bat
🚧 Files skipped from review as they are similar to previous changes (1)
  • Make.bat

Walkthrough

Build configuration now derives Yarn versions from package.json across Docker, Windows, macOS, and pip packaging workflows. The scripts validate that a version is available, set Yarn to Berry, and apply the parsed version instead of hardcoding Yarn 4.

Changes

Yarn version configuration

Layer / File(s) Summary
Container Yarn configuration
Dockerfile
The app-builder stage extracts the Yarn version from package.json before configuring Yarn.
Platform packaging Yarn configuration
Make.bat, pkg/mac/build-functions.sh, pkg/pip/build.sh
Windows, macOS, and pip builds derive and validate YARN_VERSION, then configure Yarn with the declared version instead of Yarn 4.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: deriving Yarn version from packageManager in the remaining build scripts.
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.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@Make.bat`:
- Around line 224-230: Clear YARN_VERSION immediately before the web-version
extraction in Make.bat lines 224-230 and again before the runtime-version
extraction in Make.bat lines 284-290. Preserve the existing empty-value
validation so each build phase fails instead of reusing a stale version from the
previous phase.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 64bc5f41-198f-4d63-82dd-71df03d1d9db

📥 Commits

Reviewing files that changed from the base of the PR and between b15c745 and 5f7e1bf.

📒 Files selected for processing (4)
  • Dockerfile
  • Make.bat
  • pkg/mac/build-functions.sh
  • pkg/pip/build.sh

Comment thread Make.bat
Batch variables persist for the life of the script. Without resetting
YARN_VERSION before the second FOR /f, a failed node lookup in the
runtime phase would silently fall through to the stale value set by
the earlier web phase instead of tripping the empty-value check.
@asheshv
asheshv merged commit 1993109 into pgadmin-org:master Jul 23, 2026
34 checks passed
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.

1 participant