Skip to content

fix(cli): stage dynamic plugins via npm pack#112

Open
gashcrumb wants to merge 1 commit into
redhat-developer:mainfrom
gashcrumb:RHDHBUGS-1968
Open

fix(cli): stage dynamic plugins via npm pack#112
gashcrumb wants to merge 1 commit into
redhat-developer:mainfrom
gashcrumb:RHDHBUGS-1968

Conversation

@gashcrumb
Copy link
Copy Markdown
Member

@gashcrumb gashcrumb commented May 8, 2026

Replace recursive copy of each dist-dynamic directory when running plugin package with the same contents npm would publish: npm pack into a scratch directory, extract the tarball with tar --strip-components=1, and keep the flattened layout expected by the OCI / --export-to flow.

This matches publish semantics from dist-dynamic package.json (files, bundleDependencies, etc.), omits node_modules/.bin entries that referenced absolute paths on the builder machine and triggered "link outside of the archive" warnings during dynamic plugin install from OCI images (RHDHBUGS-1968).

Run npm/tar through spawn bash with shell: false and stdio redirected to an anonymous log fd so chatter does not clutter the CLI; Task.forCommand is not used (no env for pack placeholders) nor run() (shell: true can still surface npm output). On staging failure the log contents are printed, then discarded.

This change also adjusts the e2e test assertions which where asserting
on the old recursive copy behavior to now compare using an independent
npm pack step

Fixes RHDHBUGS-1968

Assisted-By: Cursor Desktop

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

@gashcrumb gashcrumb force-pushed the RHDHBUGS-1968 branch 4 times, most recently from 0fb09d7 to 1aa5a7e Compare May 8, 2026 15:18
Replace recursive copy of each dist-dynamic directory when running
plugin package with the same contents npm would publish: npm pack into a
scratch directory, extract the tarball with tar --strip-components=1, and
keep the flattened layout expected by the OCI / --export-to flow.

This matches publish semantics from dist-dynamic package.json (files,
bundleDependencies, etc.), omits node_modules/.bin entries that referenced
absolute paths on the builder machine and triggered "link outside of the
archive" warnings during dynamic plugin install from OCI images
(RHDHBUGS-1968).

Run npm/tar through spawn bash with shell: false and stdio redirected to an
anonymous log fd so chatter does not clutter the CLI; Task.forCommand is not
used (no env for pack placeholders) nor run() (shell: true can still surface
npm output). On staging failure the log contents are printed, then discarded.

This change also adjusts the e2e test assertions which where asserting
on the old recursive copy behavior to now compare using an independent
`npm pack` step

Assisted-By: Cursor Desktop

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

@gashcrumb gashcrumb requested review from davidfestal and kadel May 8, 2026 15:56
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