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.

main branch only (tracking release-4.22 as of merge)

  • Replace custom yarn dedupe stuff with the yarn berry-provided version

4.22 to 4.12

  • 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
  • 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

4.21 to 4.12

4.20 to 4.12

4.19 only

  • Bumped tectonic-console-builder from v28 to v29

How to set up your computer to use berry

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
Copy link
Contributor

openshift-ci-robot commented Feb 13, 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 only the "4.22.0" version, but multiple target versions were set.

Details

In response to this:

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 "day 0" bugs and malware
  • Update README, .gitignore, .gitattributes
  • Demo plugin uses portal instead of file now
  • Removed update-patternfly.sh because PatternFly no longer consistently has all libraries to the same version

Test cases

  • All scripts in package.json still work fine
  • All scripts in repo root (build.sh, etc.) work fine on an initial repo state, switching branches, etc.
  • No .git folder in frontend is created ever

Backports

TBD

Summary by CodeRabbit

Release Notes

  • New Features

  • Added Corepack-based dependency management for Yarn v4 support, improving reproducibility and tooling management.

  • Enabled parallel build execution for faster build times.

  • Chores

  • Upgraded project dependency management from Yarn v1 to Yarn v4 (Berry).

  • Updated Docker build configuration to use Corepack instead of direct Yarn installation.

  • Documentation

  • Updated development setup instructions for Node.js 22+ with Corepack-enabled Yarn v4.

  • Revised build, installation, and dependency upgrade workflows.

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.

Copy link
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.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@frontend/package.json`:
- Line 60: The "generate" npm script currently runs "yarn generate-graphql &
yarn build-plugin-sdk" which launches both tasks in the background and returns
immediately, causing a race with the webpack build; change the "generate" script
to run the tasks sequentially so generation finishes before build (for example
replace the command with "yarn generate-graphql && yarn build-plugin-sdk") so
that the "generate" script (and downstream "build" that depends on it) always
sees completed generated types/SDK artifacts.

In `@frontend/packages/console-dynamic-plugin-sdk/package.json`:
- Around line 10-14: The scripts currently background multiple processes (using
&), causing the parent script to exit before children finish; update the
"compile" script to run the three tsc commands in background and then block
until they finish (e.g., append a wait after "yarn compile-core & yarn
compile-internal & yarn compile-webpack") and update the "generate" script to
run "yarn generate-schema && yarn generate-doc & yarn generate-pkg-assets" but
ensure the backgrounded generate-doc is followed by a wait so "generate" only
returns after generate-doc completes; refer to the "compile", "compile-core",
"compile-internal", "compile-webpack", "generate", "generate-doc", and
"generate-pkg-assets" script entries when making the changes.
🧹 Nitpick comments (1)
README.md (1)

421-423: Add language specifier to the fenced code block.

Static analysis flagged this code block as missing a language identifier. Adding sh or bash improves syntax highlighting and linter compliance.

📝 Proposed fix
-```
+```sh
 yarn dedupe --strategy highest
</details>

</blockquote></details>

</blockquote></details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

"prettier-all": "prettier --write '**/*.{js,jsx,ts,tsx,json}'",
"ts-node": "ts-node -O '{\"module\":\"commonjs\"}'",
"generate": "yarn generate-graphql && yarn build-plugin-sdk",
"generate": "yarn generate-graphql & yarn build-plugin-sdk",
Copy link
Contributor

@coderabbitai coderabbitai bot Feb 13, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Parallel generate script lacks wait - may cause race with webpack build.

Same issue as the SDK package: yarn generate-graphql & yarn build-plugin-sdk forks both jobs and returns immediately. Since build (line 19) chains yarn generate && ... webpack, webpack may start before codegen/SDK generation completes, leading to missing generated types or stale SDK artifacts.

🐛 Proposed fix
-    "generate": "yarn generate-graphql & yarn build-plugin-sdk",
+    "generate": "yarn generate-graphql & yarn build-plugin-sdk & wait",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"generate": "yarn generate-graphql & yarn build-plugin-sdk",
"generate": "yarn generate-graphql & yarn build-plugin-sdk & wait",
🤖 Prompt for AI Agents
In `@frontend/package.json` at line 60, The "generate" npm script currently runs
"yarn generate-graphql & yarn build-plugin-sdk" which launches both tasks in the
background and returns immediately, causing a race with the webpack build;
change the "generate" script to run the tasks sequentially so generation
finishes before build (for example replace the command with "yarn
generate-graphql && yarn build-plugin-sdk") so that the "generate" script (and
downstream "build" that depends on it) always sees completed generated types/SDK
artifacts.

Copy link
Member Author

Choose a reason for hiding this comment

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

No race because yarn will wait for the reporting of the commands in the && where this is called. But adding wait here also makes the output more consistent:

no wait:

    "task1": "timeout 5s node -e \"console.log('Running task 1');\"",
    "task2": "timeout 5s node -e \"console.log('Running task 2');\"",
    "task3": "timeout 5s node -e \"console.log('Running task 3');\"",
    "task4": "timeout 5s node -e \"console.log('Running task 4');\"",
    "taska": "yarn task1 & yarn task2 ^",
    "taskb": "yarn task3 & yarn task4 ^",
    "task": "yarn taska && yarn taskb",
$ yarn task
[1] Running task 1
Running task 2
Job [1], 'yarn task1' has ended
[1] Running task 3
Running task 4
Job [1], 'yarn task3' has ended

wait:

    "task1": "timeout 5s node -e \"console.log('Running task 1');\"",
    "task2": "timeout 5s node -e \"console.log('Running task 2');\"",
    "task3": "timeout 5s node -e \"console.log('Running task 3');\"",
    "task4": "timeout 5s node -e \"console.log('Running task 4');\"",
    "taska": "yarn task1 & yarn task2 ^ & wait",
    "taskb": "yarn task3 & yarn task4 ^ & wait",
$ yarn task
[1] Running task 1
[2] Running task 2
Job [1], 'yarn task1' has ended
Job [2], 'yarn task2 ^' has ended
[2] Running task 4
[1] Running task 3
Job [2], 'yarn task4 ^' has ended
Job [1], 'yarn task3' has ended

Copy link
Contributor

Choose a reason for hiding this comment

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

@logonoff, thank you for the detailed clarification and examples! You're absolutely right — since the build script uses && (line 19), Yarn will indeed wait for yarn generate to complete before proceeding to webpack. My concern about a race condition was based on an incomplete understanding of the calling context.

I appreciate the thorough explanation with the output examples showing how wait improves consistency by ensuring all background jobs report completion before the script exits. If you decide to add wait for that benefit, it would be a nice touch for clearer logging, but I understand now that it's not required for correctness.

Thanks for setting this straight! 🙏

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 14, 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 only the "4.22.0" version, but multiple target versions were set.

Details

In response to this:

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 "day 0" bugs and malware
  • Update README, .gitignore, .gitattributes
  • 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

Test cases

  • All scripts in package.json still work fine
  • All scripts in repo root (build.sh, etc.) work fine on an initial repo state, switching branches, etc.
  • No .git folder in frontend is created ever

Backports

TBD

Summary by CodeRabbit

Release Notes

  • New Features

  • Added Corepack-based dependency management for Yarn v4 support, improving reproducibility and tooling management.

  • Enabled parallel build execution for faster build times.

  • Chores

  • Upgraded project dependency management from Yarn v1 to Yarn v4 (Berry).

  • Updated Docker build configuration to use Corepack instead of direct Yarn installation.

  • Documentation

  • Updated development setup instructions for Node.js 22+ with Corepack-enabled Yarn v4.

  • Revised build, installation, and dependency upgrade workflows.

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

logonoff commented Feb 16, 2026

added wait as suggested by AI

/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:

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

"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
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-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