Repository navigation
test(manifest): run cdxgen help checks offline - #1807
Conversation
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit b152fa4. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b152fa4. Configure here.
| }, | ||
| }) | ||
| } finally { | ||
| await rm(cwd, { recursive: true, force: true }) |
There was a problem hiding this comment.
Temp cleanup can wipe node_modules
High Severity
spawnCdxgenHelp junctions the repository node_modules into a temp directory and then rms that directory recursively in finally. On Windows a junction is a reparse point; fs.rm({ recursive: true }) has treated EPERM as “not empty” and descended into the target, which would delete the real install rather than only the temp junction. Cleanup errors are also uncaught, so a locked handle after npx can fail an otherwise passing test.
Reviewed by Cursor Bugbot for commit b152fa4. Configure here.
| SOCKET_CLI_CONFIG: '{}', | ||
| npm_config_offline: 'true', | ||
| npm_config_cache: path.join(cwd, '.npm-cache'), | ||
| }, |
There was a problem hiding this comment.
Offline npx may skip local cdxgen
Medium Severity
The temp project’s package.json is only {"private":true}, while npx is invoked as @cyclonedx/cdxgen@<pinned version> with npm_config_offline=true and npm_config_cache pointed at a fresh empty directory. If npm exec does not treat the symlinked install as satisfying that spec (common when the package is not a declared dependency, or when a versioned spec still loads a packument), the fetch fails immediately with ENOTCACHED instead of printing help, so the new code === 0 / CycloneDX Generator assertions fail.
Reviewed by Cursor Bugbot for commit b152fa4. Configure here.


The cdxgen help tests can spend their timeout starting a package-manager download just to check argument forwarding. Run the CLI in a temporary npm project with the repository’s installed cdxgen and an empty, offline npm cache. Both command names must now print cdxgen’s help and exit successfully.
Node 22 timeout on SocketDev/socket-cli#1800