Skip to content

[release-4.22] CONSOLE-5011: migrate to yarn berry#15986

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
logonoff:yarn4
Feb 17, 2026
Merged

[release-4.22] CONSOLE-5011: migrate to yarn berry#15986
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
logonoff:yarn4

Conversation

@logonoff
Copy link
Member

@logonoff logonoff commented Feb 3, 2026

This PR (and its "backports" all the way to 4.12) aim to perform the mandatory migration from yarn classic to yarn berry (of the v4 variety).

Changes

See #15995 for some preparatory work that was done from 4.12 to 4.18.

Note: the list of changes are descriptive for all backport PRs. Some of these changes may not apply to every backport.

  • Update Dockerfiles to install corepack instead of yarn v1
  • In dynamic-demo-plugin, symlink .yarnrc.yml and the .yarn/releases folder to reduce config duplication
  • Update relevant package.json scripts to have syntax compatible with yarn berry
  • Update check-patternfly-modules script to use new yarn berry parsing package
  • Replace custom yarn dedupe stuff with the yarn berry-provided version
  • Yarn config:
    • Disable postinstall scripts except for cypress and our own
    • Enforce all dependencies must be at least 3 days old to reduce exposure to zero-days, bugs, and malware
  • Update README, .gitignore, .gitattributes
    • Minimum version of nodejs is now 22 due to Dockerfile changes and Yarn version
  • Demo plugin uses portal instead of file now
  • Removed update-patternfly.sh because PatternFly no longer consistently has all libraries to the same version
  • Updated .yarn/releases to point to yarn v4. Note that this is for installations (e.g., tectonic-console-builder:v29) which already have yarn classic installed globally. They will read this updated binary and automatically run yarn berry. We can remove this when our builder image switches fully over to corepack

How to set up your computer

Note that you may want to remove yarn classic when setting up your computer to use yarn berry. Here's how to update your system to use it:

  • Remove any current installations of yarn: e.g., dnf remove yarnpkg, npm uninstall -g yarn, brew uninstall yarn
  • install corepack: npm i -g corepack (node ships with an older version)
  • enable corepack: corepack enable (note that corepack also works with our repo pre-yarn berry adoption, it will run yarn classic as needed)
  • run yarn in console/frontend directory. accept any prompts when it asks to download yarn 4.12.0

Possible test cases

  • Every script in every package.json now works the same as before
  • Dockerfile.builder can build console, Dockerfile builds console frontend/backend, Dockerfile.plugins.demo builds demo plugin.
    • Note Dockerfile.product.nodejs does not but that is due to an outdated node version. Let's delete it in a follow up
  • No .git folder in frontend is created ever
  • All scripts in repo root (build.sh, etc.) work fine on an initial repo state, switching branches, etc.

Backports

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 3, 2026
@openshift-ci openshift-ci bot added component/core Related to console core functionality component/dev-console Related to dev-console component/sdk Related to console-plugin-sdk component/topology Related to topology labels Feb 3, 2026
@logonoff logonoff changed the title feat: migrate to yarn berry (WIP) chore: migrate to yarn berry (WIP) Feb 3, 2026
@openshift-ci openshift-ci bot added the kind/demo-plugin Related to dynamic-demo-plugin label Feb 3, 2026
@logonoff logonoff force-pushed the yarn4 branch 9 times, most recently from 5d42266 to 906d4b4 Compare February 4, 2026 01:34
@openshift-ci openshift-ci bot added component/helm Related to helm-plugin component/knative Related to knative-plugin labels Feb 4, 2026
@logonoff logonoff force-pushed the yarn4 branch 3 times, most recently from 9ffb88d to 2f6636b Compare February 4, 2026 15:05
@logonoff logonoff changed the title chore: migrate to yarn berry (WIP) [release-4.22] CONSOLE-5011: migrate to yarn berry Feb 4, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 4, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 4, 2026

@logonoff: This pull request references CONSOLE-5011 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

spike

/hold

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@logonoff logonoff force-pushed the yarn4 branch 2 times, most recently from 9f3f11c to 89b3ba2 Compare February 5, 2026 00:30
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

This pull request upgrades the project from Yarn v1 (Classic) to Yarn v4 (Berry) and introduces Corepack as the package manager version manager. Changes include: updating configuration files to use .yarnrc.yml instead of .yarnrc, adding Yarn v4 binary paths to git configuration, modifying Dockerfiles to bootstrap Corepack instead of Yarn, updating package.json files with packageManager fields and portal: protocol dependencies, converting npm scripts to use Yarn v4 commands (e.g., yarn up, yarn dedupe), adjusting Cypress test scripts with non-assignment parameter defaults, splitting build compilation into parallel tasks, and updating package lock file parsing to use @yarnpkg/parsers.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: migration from Yarn classic (v1) to Yarn Berry v4, with the release branch and Jira issue reference providing proper context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main
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 docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Feb 16, 2026
@openshift-ci-robot
Copy link
Contributor

@logonoff: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Feb 16, 2026
@logonoff
Copy link
Member Author

AI is wrong, can't use wait in CI

command not found: wait

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Feb 16, 2026
@openshift-ci-robot
Copy link
Contributor

@logonoff: This PR has been marked as verified by CI.

Details

In response to this:

AI is wrong, can't use wait in CI

command not found: wait

/verified by CI

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@logonoff
Copy link
Member Author

logonoff commented Feb 17, 2026

changes are critical to meet impending deadline

/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Feb 17, 2026
@logonoff
Copy link
Member Author

Let's get some additional verification

/verified cancel
/verified later @yapei

@openshift-ci-robot
Copy link
Contributor

@logonoff: The /verified command must be used with one of the following actions: by, later, remove, or bypass. See https://docs.ci.openshift.org/docs/architecture/jira/#premerge-verification for more information.

Details

In response to this:

Let's get some additional verification

/verified cancel
/verified later @yapei

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@logonoff
Copy link
Member Author

/verified remove

@openshift-ci-robot
Copy link
Contributor

@logonoff: This PR has been marked to be verified later by @yapei.

Details

In response to this:

Let's get some additional verification

/verified cancel
/verified later @yapei

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@logonoff
Copy link
Member Author

/verified later @yapei

@openshift-ci-robot openshift-ci-robot removed verified Signifies that the PR passed pre-merge verification criteria verified-later labels Feb 17, 2026
@openshift-ci-robot
Copy link
Contributor

@logonoff: The verified label has been removed.The verified-later label has been removed.

Details

In response to this:

/verified remove

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

@logonoff: This PR has been marked to be verified later by @yapei.

Details

In response to this:

/verified later @yapei

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Feb 17, 2026
"build": "yarn clean && NODE_ENV=production yarn ts-node node_modules/.bin/webpack",
"build-dev": "yarn clean && yarn ts-node node_modules/.bin/webpack",
"build-plugin-sdk": "yarn --cwd ../frontend build-plugin-sdk && yarn install-plugin-sdk",
"install-plugin-sdk": "rm -rf node_modules/@openshift-console && yarn install --check-files",
Copy link
Contributor

Choose a reason for hiding this comment

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

Does Yarn Berry yarn install fill the missing node_modules/@openshift-console/* packages while other node_modules/* packages are still in place?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes

console/dynamic-demo-plugin$ rm -rf node_modules/@openshift-console && yarn

➤ YN0000: · Yarn 4.12.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0s 603ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 2s 85ms
➤ YN0000: ┌ Link step
➤ YN0072: │ The application uses portals and that's why --preserve-symlinks Node option is required for launching it
➤ YN0000: └ Completed in 2s 159ms
➤ YN0000: · Done with warnings in 5s 69ms

console/dynamic-demo-plugin$ ls node_modules/@openshift-console/

dynamic-plugin-sdk  dynamic-plugin-sdk-webpack

@vojtechszocs
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 17, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 17, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: logonoff, rhamilto, vojtechszocs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 8121f21 into openshift:main Feb 17, 2026
8 checks passed
@logonoff logonoff deleted the yarn4 branch February 17, 2026 19:05
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 18, 2026

@logonoff: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/backend 635307d link unknown /test backend

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/dev-console Related to dev-console component/helm Related to helm-plugin component/knative Related to knative-plugin component/sdk Related to console-plugin-sdk component/topology Related to topology docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/demo-plugin Related to dynamic-demo-plugin lgtm Indicates that a PR is ready to be merged. plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria verified-later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants