Fix npm audit CI failure - #5007
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to resolve the portal/v2 npm audit CI failure by moving react-router out of a vulnerable version range and updating npm install behavior to allow the dependency graph to resolve.
Changes:
- Bump
portal/v2dependencyreact-routerfrom^7.16.0to^8.3.0. - Add
legacy-peer-deps=truetoportal/v2/.npmrcand updateportal/v2/package-lock.jsonaccordingly.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| portal/v2/package.json | Updates react-router dependency to ^8.3.0. |
| portal/v2/package-lock.json | Refreshes lockfile to reflect the react-router upgrade and resulting dependency graph. |
| portal/v2/.npmrc | Adds legacy-peer-deps=true to bypass peer dependency constraints during install. |
Files not reviewed (1)
- portal/v2/package-lock.json: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 21 changed files in this pull request and generated 3 comments.
Files not reviewed (2)
- api/package-lock.json: Generated file
- pkg/portal/assets/v2/build/static/js/520.4cbef48b.chunk.js: Generated file
e888094 to
ffd4350
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 21 changed files in this pull request and generated 2 comments.
Files not reviewed (2)
- api/package-lock.json: Generated file
- pkg/portal/assets/v2/build/static/js/520.4cbef48b.chunk.js: Generated file
Comments suppressed due to low confidence (1)
api/package-lock.json:1092
@scarf/scarfwas added as a dev dependency and is markedhasInstallScript: true. This meansnpm cifor theapi/package will execute an additional install script (potentially with network side effects), which may be undesirable in hardened/offline build environments.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 22 changed files in this pull request and generated 1 comment.
Files not reviewed (2)
- api/package-lock.json: Generated file
- pkg/portal/assets/v2/build/static/js/520.4cbef48b.chunk.js: Generated file
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 22 changed files in this pull request and generated no new comments.
Files not reviewed (2)
- api/package-lock.json: Generated file
- pkg/portal/assets/v2/build/static/js/520.4cbef48b.chunk.js: Generated file
Comments suppressed due to low confidence (2)
api/package-lock.json:1091
@scarf/scarfis newly introduced as a dev dependency here and is marked withhasInstallScript: true. Because CI runsnpm ciinapi/(e.g.,hack/api/swagger-from-typespec.sh), this means arbitrary install scripts will execute during CI and may attempt outbound network/telemetry. If your CI egress is tightened (or if you want deterministic builds), consider explicitly disabling Scarf analytics during installs (e.g., via env likeSCARF_DISABLE=1) or pinning/replacing the dependency chain to avoid adding install-script telemetry into the build.
.github/workflows/npm-audit.yml:32- PR description says Node is bumped 20 → 22 in CI workflows, but this PR only updates Node versions in this workflow.
ci-api-swagger-diff.ymlstill pinsnode-version: 20.12.0(line 31). If Node 22 is now required for repo CI consistency, please update the remaining workflows too; otherwise, consider narrowing the PR description to the workflows/images that actually changed.
- name: setup Node.JS
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22.22.0
cadenmarchese
left a comment
There was a problem hiding this comment.
looks OK to me - good to merge on green e2e!
ventifus
left a comment
There was a problem hiding this comment.
Looks like stoplight/spectral-core 1.23.1 pulls in a scarf analytics module as a dependency. Let's set export DO_NOT_TRACK=1 in our ci script per https://www.npmjs.com/package/@scarf/scarf
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 22 changed files in this pull request and generated no new comments.
Files not reviewed (2)
- api/package-lock.json: Generated file
- pkg/portal/assets/v2/build/static/js/520.4cbef48b.chunk.js: Generated file
|
/azp run ci |
|
Azure Pipelines: No pipelines were found matching this branch/path. |
Which issue this PR addresses:
type resolution)
Test plan for issue:
npm cisucceeds in portal/v2/ without legacy-peer-depsnpm audit --audit-level high --omit=devreports 0 vulnerabilities for both portal/v2 and api