Skip to content

OCPBUGS-80940: Fix SDK publish workflow for Yarn Berry#16392

Open
logonoff wants to merge 1 commit intoopenshift:mainfrom
logonoff:OCPBUGS-80940-publish
Open

OCPBUGS-80940: Fix SDK publish workflow for Yarn Berry#16392
logonoff wants to merge 1 commit intoopenshift:mainfrom
logonoff:OCPBUGS-80940-publish

Conversation

@logonoff
Copy link
Copy Markdown
Member

@logonoff logonoff commented May 1, 2026

Analysis / Root cause:

Yarn Berry changed yarn publish to yarn npm publish, but the dist packages aren't part of the yarn workspace so npm publish is used directly.

Solution description:

Adds a set-version script to set the version across all three dist packages before publishing, since Yarn Berry dropped the --new-version flag.

Test cases:

  • Follow the new steps and publish with --dry-run.
  • Then try the old steps by removing "yarnPath" from .yarnrc.yml and "packageManager" from package.json
  • Compare the --dry-run results and make sure they're the same

Summary by CodeRabbit

  • Documentation

    • Updated publishing workflow to clarify the version assignment process before package distribution.
  • Chores

    • Enhanced distribution package versioning automation with a new pre-publish step.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 1, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@logonoff: This pull request references Jira Issue OCPBUGS-80940, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Analysis / Root cause:

Yarn Berry changed yarn publish to yarn npm publish, but the dist packages aren't part of the yarn workspace so npm publish is used directly.

Solution description:

Adds a set-version script to set the version across all three dist packages before publishing, since Yarn Berry dropped the --new-version flag.

Test cases:

Follow the new steps and publish with --dry-run. Then verify the results

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 jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label May 1, 2026
@openshift-ci openshift-ci Bot requested review from fsgreco and spadgett May 1, 2026 19:55
@openshift-ci openshift-ci Bot added component/sdk Related to console-plugin-sdk approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 1, 2026
@logonoff
Copy link
Copy Markdown
Member Author

logonoff commented May 1, 2026

/assign @vojtechszocs

@logonoff
Copy link
Copy Markdown
Member Author

logonoff commented May 1, 2026

/cherry-pick release-4.22

@openshift-cherrypick-robot
Copy link
Copy Markdown

@logonoff: once the present PR merges, I will cherry-pick it on top of release-4.22 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-4.22

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.

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@logonoff: This pull request references Jira Issue OCPBUGS-80940, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Analysis / Root cause:

Yarn Berry changed yarn publish to yarn npm publish, but the dist packages aren't part of the yarn workspace so npm publish is used directly.

Solution description:

Adds a set-version script to set the version across all three dist packages before publishing, since Yarn Berry dropped the --new-version flag.

Test cases:

Follow the new steps and publish with --dry-run. Then verify the results

Summary by CodeRabbit

  • Documentation

  • Updated publishing workflow to clarify the version assignment process before package distribution.

  • Chores

  • Enhanced distribution package versioning automation with a new pre-publish step.

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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

📝 Walkthrough

Walkthrough

This change refactors the publishing workflow for the console-dynamic-plugin-sdk packages. A new set-version script is introduced in package.json that applies version changes to distribution packages (core, internal, webpack) using npm version --no-git-tag-version. The publishing documentation and workflow are updated to execute this script as a pre-publish step before invoking npm publish directly against the dist folder. The manifest JSDoc is clarified to reflect that version assignment occurs before publishing rather than during the publish process.

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the specific bug (OCPBUGS-80940) and concisely describes the main change: fixing the SDK publish workflow for Yarn Berry compatibility.
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.
Stable And Deterministic Test Names ✅ Passed This pull request does not contain any Ginkgo test files or modifications to test names. The changes are limited to publishing workflow documentation (README.md), a build script addition (package.json), and JSDoc comment clarifications (package-definitions.ts). The custom check for stable and deterministic test names is not applicable to this pull request.
Test Structure And Quality ✅ Passed PR modifies build configuration files and TypeScript build scripts only; contains no Ginkgo tests or test files of any kind.
Microshift Test Compatibility ✅ Passed This PR modifies only SDK publishing configuration and documentation with no new Ginkgo e2e tests or test code introduced.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR does not introduce any new Ginkgo e2e tests. The three modified files are README.md with documentation updates, package.json with a new script, and package-definitions.ts with JSDoc updates. All changes relate to SDK build and publishing infrastructure for Yarn Berry compatibility, with no e2e test code added.
Topology-Aware Scheduling Compatibility ✅ Passed Pull request contains only build/packaging infrastructure changes to OpenShift Console SDK with no modifications to deployment manifests, operators, or Kubernetes scheduling configuration.
Ote Binary Stdout Contract ✅ Passed This PR modifies only frontend JavaScript/TypeScript and Node.js configuration files. The OTE Binary Stdout Contract applies exclusively to Go binaries and test infrastructure, making it not applicable to frontend package management changes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR modifies only TypeScript/JavaScript package files (README.md, package.json, scripts/package-definitions.ts). No new Ginkgo e2e tests are introduced.
Description check ✅ Passed The PR description covers root cause analysis, solution overview, and test cases but is missing required sections like screenshots, browser conformance, and reviewer assignments.

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

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

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

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)
frontend/packages/console-dynamic-plugin-sdk/README.md (1)

525-536: ⚡ Quick win

Make <pkg> explicit in the publish instructions (reduce user error).

The README now says npm publish ./dist/<pkg>, but it doesn’t spell out the valid <pkg> values (even though the code uses core, internal, webpack). Adding that small clarification will avoid accidental publishes from the wrong directory and reduce “trial-and-error” time.

📝 Proposed doc tweak
-Finally, publish relevant packages to [npm registry](https://www.npmjs.com/):
+Finally, publish relevant packages to [npm registry](https://www.npmjs.com/).
+`<pkg>` is one of: `core`, `internal`, `webpack` (publish from `./dist/<pkg>`).

 ```sh
-npm publish ./dist/<pkg>
+npm publish ./dist/core
+npm publish ./dist/internal
+npm publish ./dist/webpack
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @frontend/packages/console-dynamic-plugin-sdk/README.md around lines 525 -
536, The publish instructions in README.md are ambiguous; update the README
lines that currently show npm publish ./dist/<pkg> to list the explicit
packages used by the project: core, internal, and webpack so users run
npm publish ./dist/core, npm publish ./dist/internal, and npm publish ./dist/webpack instead of a generic <pkg>; modify the README section where
the publish command appears to replace the placeholder with these three explicit
entries to reduce accidental publishes.


</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @frontend/packages/console-dynamic-plugin-sdk/README.md:

  • Around line 525-536: The publish instructions in README.md are ambiguous;
    update the README lines that currently show npm publish ./dist/<pkg> to list
    the explicit packages used by the project: core, internal, and webpack so
    users run npm publish ./dist/core, npm publish ./dist/internal, and npm publish ./dist/webpack instead of a generic <pkg>; modify the README section
    where the publish command appears to replace the placeholder with these three
    explicit entries to reduce accidental publishes.

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: Repository YAML (base), Central YAML (inherited)

**Review profile**: CHILL

**Plan**: Enterprise

**Run ID**: `d6a1e830-1e97-4f34-a305-bebdc634db15`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 2f5206721497f358c7f90b9bc7ad00de01752b04 and 6f7f7c86787fead11ce538e735b764fb15c2a9dc.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `frontend/packages/console-dynamic-plugin-sdk/README.md`
* `frontend/packages/console-dynamic-plugin-sdk/package.json`
* `frontend/packages/console-dynamic-plugin-sdk/scripts/package-definitions.ts`

</details>

</details>

<details>
<summary>📜 Review details</summary>

<details>
<summary>🔇 Additional comments (1)</summary><blockquote>

<details>
<summary>frontend/packages/console-dynamic-plugin-sdk/scripts/package-definitions.ts (1)</summary><blockquote>

`16-17`: **LGTM — JSDoc accurately matches the new publish flow.**

The clarification that `manifest.version` must be set before publishing is consistent with the new `set-version` pre-publish step and should prevent future confusion.

</blockquote></details>

</blockquote></details>

</details>

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 1, 2026

@logonoff: all tests passed!

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.

Copy link
Copy Markdown
Contributor

@fsgreco fsgreco left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 4, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 4, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fsgreco, logonoff

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

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/sdk Related to console-plugin-sdk jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants