Repository navigation
Conversation
|
I have read the CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the CLA. |
3fcc777 to
66105c7
Compare
|
This pull-request has been marked as stale due to 6 months of inactivity. As part of our effort to address every issue properly, please feel free to remove the stale label or keep this issue active by leaving a comment. Otherwise, it will be closed in 7 days |
|
This pull-request was closed due to 7 days of inactivity after being marked as stale. Feel free to reopen it if it remains relevant. |
masterbranch.go vet ./....go fmt ./....Problem
jf pnpm installunconditionally ranpnpm ls -r --depth Infinity --jsonwhen collecting build-info. This ignored the user's workspace intent in two scenarios:cd apps/web-app && jf pnpm installproduced a multi-module build-info containing every workspace package, not justweb-app.--ignore-workspaceflag —pnpm install --ignore-workspacewas honored by pnpm during install, but the subsequentpnpm ls -rre-enumerated the entire monorepo, leaking sibling/root deps into the build-info.Downstream SBOM / Xray consumers therefore saw phantom dependencies that didn't actually belong to the built package.
Fix
The build-info
pnpm lscall now matches the user's intent:isPnpmWorkspaceSubPackage— usespnpm root -wplus symlink-resolved path compare. When the working directory is a workspace sub-package,-ris dropped and only the current package's deps are collected.extractLsForwardFlags— forwards--ignore-workspacefrom the install args topnpm ls, so build-info respects the flag.buildPnpmLsArgs— also drops-rwhen--ignore-workspaceis forwarded (pnpm would otherwise emit concatenated JSON arrays that aren't parseable byencoding/json).Workspace-root invocation without
--ignore-workspacekeeps the existing-rmulti-module behavior — no regression for current CI flows.Summary
Adds two end-to-end tests covering the fix in
jfrog-cli-artifactorythat scopes pnpm build-info to the invoked package:TestPnpmInstallSubPackageScopesBuildInfo— runsjf pnpm installfrompackages/nested1/and asserts the resulting build-info contains exactlynested1:1.0.0with only its ownloadashdependency. Noxmlfrom siblingnested2, nojsonfrom the workspace root.TestPnpmInstallIgnoreWorkspaceScopesBuildInfo— runsjf pnpm install --ignore-workspacefrom the workspace root and asserts onlypnpm-workspace-root:1.0.0with itsjsondevDep is present (no sibling leakage).Fixture change
The
pnpmworkspacetestdata is tweaked so each package has a distinct dependency, making leakage a positive assertion (presence of a foreign dep fails the test):xml+json(dev)json(dev)packages/nested1loadashloadashpackages/nested2loadashxmlImpact on existing tests
None.
TestPnpmPublishWorkspaceandTestPnpmInstallAndPublishWorkspaceassert on structural properties (module count, tarball names, has-deps) — all still hold after the fixture change.depends on: