Skip to content

Publish npm package to @kubevirt-ui-ext#7

Merged
rszwajko merged 1 commit into
kubevirt-ui:mainfrom
rszwajko:publishToKubevirtUiExt
Dec 4, 2025
Merged

Publish npm package to @kubevirt-ui-ext#7
rszwajko merged 1 commit into
kubevirt-ui:mainfrom
rszwajko:publishToKubevirtUiExt

Conversation

@rszwajko
Copy link
Copy Markdown
Member

@rszwajko rszwajko commented Dec 4, 2025

Summary by CodeRabbit

Release Notes

  • Chores
    • Released version 1.0.1
    • Updated package distribution configuration

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Radoslaw Szwajkowski <rszwajko@redhat.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 4, 2025

Walkthrough

The npm publish workflow has been updated to replace the package scope from @kubevirt-ui to @kubevirt-ui-ext using sed during the build process. The authentication now uses a different GitHub secret, NPM_TOKEN_FOR_KUBEVIRT_UI_EXT. Package version is bumped from 1.0.0 to 1.0.1.

Changes

Cohort / File(s) Summary
npm Publishing Workflow and Package Configuration
.github/workflows/npm-publish.yml, package.json
Workflow modified to apply sed transformation replacing @kubevirt-ui with @kubevirt-ui-ext in package.json during npm build step; npm publish now authenticates with NPM_TOKEN_FOR_KUBEVIRT_UI_EXT secret. Package version incremented to 1.0.1.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Verify the sed replacement pattern correctly targets all occurrences of @kubevirt-ui
  • Confirm that NPM_TOKEN_FOR_KUBEVIRT_UI_EXT secret is properly configured in GitHub repository settings
  • Check that version 1.0.1 aligns with project versioning policy

Possibly related PRs

  • vnc-keymaps#6: Adds buildForNpm job with NPM_TOKEN; this PR adjusts that workflow to use sed for package scope replacement and a different authentication secret.
  • vnc-keymaps#2: Modifies npm-publish workflow and package.json publish settings for package authentication and distribution.
  • vnc-keymaps#4: Updates package.json version field; this PR also includes a version bump to 1.0.1.

Suggested reviewers

  • sjd78
  • metalice
  • upalatucci

Poem

🐰 A scoped package hops from @kubevirt-ui to @kubevirt-ui-ext so bright,
With sed's gentle touch and secrets held tight,
Version bumps to 1.0.1 in workflow's flow,
npm publishes strong, off to NPM we go! 🚀✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main purpose of the PR: publishing the npm package to the @kubevirt-ui-ext registry instead of @kubevirt-ui.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link
Copy Markdown

@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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6baadd6 and e9c0abb.

📒 Files selected for processing (2)
  • .github/workflows/npm-publish.yml (2 hunks)
  • package.json (1 hunks)
🔇 Additional comments (2)
package.json (1)

3-3: Version bump is appropriate for scope change.

The patch version bump (1.0.0 → 1.0.1) is suitable since the package functionality remains unchanged; only the publication scope/organization is changing.

.github/workflows/npm-publish.yml (1)

42-42: Verify that the NPM_TOKEN_FOR_KUBEVIRT_UI_EXT secret is configured.

The workflow now uses a new GitHub Actions secret (NPM_TOKEN_FOR_KUBEVIRT_UI_EXT) for npm authentication. If this secret is not configured in the repository settings, the publish step will fail silently or with an unclear error.

Please confirm that NPM_TOKEN_FOR_KUBEVIRT_UI_EXT has been added to your repository's Actions secrets under Settings > Secrets and variables > Actions.

Comment on lines +30 to +31
#change the organization for npm
- run: sed -i -E 's/@kubevirt-ui/@kubevirt-ui-ext/' package.json
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Dec 4, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Sed regex is overly broad and will corrupt the repository URL.

The regex s/@kubevirt-ui/@kubevirt-ui-ext/ will replace all occurrences of @kubevirt-ui in package.json, including the repository URL at line 27. This will incorrectly rewrite the git URL from github.com/kubevirt-ui/... to github.com/kubevirt-ui-ext/..., breaking package metadata traceability.

Use a more specific regex that targets only the "name" field:

- - run: sed -i -E 's/@kubevirt-ui/@kubevirt-ui-ext/' package.json
+ - run: sed -i -E 's/"name": "@kubevirt-ui\/"/"name": "@kubevirt-ui-ext\/"/' package.json

Alternatively, use a safer JSON-aware approach:

- - run: sed -i -E 's/@kubevirt-ui/@kubevirt-ui-ext/' package.json
+ - run: |
+     node -e "const pkg = require('./package.json'); pkg.name = pkg.name.replace('@kubevirt-ui/', '@kubevirt-ui-ext/'); require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n');"
📝 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
#change the organization for npm
- run: sed -i -E 's/@kubevirt-ui/@kubevirt-ui-ext/' package.json
#change the organization for npm
- run: sed -i -E 's/"name": "@kubevirt-ui\/"/"name": "@kubevirt-ui-ext\/"/' package.json
Suggested change
#change the organization for npm
- run: sed -i -E 's/@kubevirt-ui/@kubevirt-ui-ext/' package.json
#change the organization for npm
- run: |
node -e "const pkg = require('./package.json'); pkg.name = pkg.name.replace('@kubevirt-ui/', '@kubevirt-ui-ext/'); require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n');"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a jq command that could easily patch the file?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@sjd78, yes! jq is a much safer choice for modifying JSON files. Here's a command that will precisely target only the name field:

jq '.name |= sub("@kubevirt-ui/";"@kubevirt-ui-ext/")' package.json > tmp.json && mv tmp.json package.json

In the workflow step, it would look like:

#change the organization for npm
- run: jq '.name |= sub("@kubevirt-ui/";"@kubevirt-ui-ext/")' package.json > tmp.json && mv tmp.json package.json

This approach:

  • ✅ Only modifies the name field
  • ✅ Preserves JSON formatting
  • ✅ Won't accidentally replace @kubevirt-ui in the repository URL
  • jq is pre-installed on GitHub Actions ubuntu-latest runners

@rszwajko rszwajko merged commit 1cf8bc8 into kubevirt-ui:main Dec 4, 2025
3 checks passed
rszwajko added a commit to kubevirt-ui/kubevirt-api that referenced this pull request Dec 12, 2025
Follow the approach used in vnc-keymap projec.

Support node version >= 20.
Add workflow to build the package on each PR.

Reference-Url: kubevirt-ui/vnc-keymaps#7
Signed-off-by: Radoslaw Szwajkowski <rszwajko@redhat.com>
rszwajko added a commit to kubevirt-ui/kubevirt-api that referenced this pull request Dec 12, 2025
Follow the approach used in vnc-keymap project.

Support node version >= 20.
Add workflow to build the package on each PR.

Reference-Url: kubevirt-ui/vnc-keymaps#7
Signed-off-by: Radoslaw Szwajkowski <rszwajko@redhat.com>
rszwajko added a commit to kubevirt-ui/kubevirt-api that referenced this pull request Dec 15, 2025
Follow the approach used in vnc-keymap project.

Support node version >= 20.
Add workflow to build the package on each PR.

Reference-Url: kubevirt-ui/vnc-keymaps#7
Signed-off-by: Radoslaw Szwajkowski <rszwajko@redhat.com>
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.

3 participants