-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Exclude devDependencies
from attribution.txt
#8862
Conversation
0487b0a
to
602010f
Compare
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring: Next stepsTake a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with |
602010f
to
c40b13e
Compare
@SocketSecurity ignore npm/@lavamoat/aa@3.1.5 These are our packages |
@SocketSecurity ignore npm/@npmcli/move-file@2.0.1 This deprecated package is used by an abandoned package, difficult to replace |
@SocketSecurity ignore npm/dezalgo@1.0.4 These "new author" alerts are from releases ~2 years old, where the new author appears to be the current maintainer |
@SocketSecurity ignore npm/@lavamoat/preinstall-always-fail@2.0.0 This is our package |
@SocketSecurity ignore npm/cmd-shim@6.0.2 These new authors appear to be an npm bot and a maintainer |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8862 +/- ##
=======================================
Coverage 43.27% 43.27%
=======================================
Files 1271 1271
Lines 30916 30916
Branches 3092 3092
=======================================
Hits 13378 13378
Misses 16765 16765
Partials 773 773 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I run the script on my computer I see different results for attributions.txt
. It seems that fsevents
gets added, @parcel/watcher-linux-x64-glibc
gets removed, and @parcel/watcher-linux-x64-musl
is replaced with @parcel/watcher-darwin-arm64
. This makes sense to be as these changes are most likely due to a different platform (macOS). If this script is only intended to be run in CI, then that seems fine.
Regardless, I did not see any dev dependencies.
7593686
to
8454d5a
Compare
Exactly, this script will only be run on CI typically, so I think having platform differences in output is OK in this case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The generated file `attribution.txt` was intended to exclude all `devDependencies`, but a few snuck their way in anyway. The `build:attribution` script we use to generate that file has been updated to ensure that `devDependencies` are excluded. The old script was deleting `devDependencies` from `package.json` in an attempt to exclude them, but this wasn't working properly because the package we use to find all licences was looking on-disk for them, not walking through the dependency graph starting at our manifest. The script now explicitly deletes `node_modules` and re-installs with only production dependencies, so they are the only ones present on-disk for the license checker to find. The script now leaves the project in a state where only production dependencies are installed, so a reminder to run `yarn setup` was added to the end of the script Fixes MetaMask/MetaMask-planning#2182
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
8454d5a
to
66ce82c
Compare
|
CI errors appear to be unrelated to this PR and are non-blocking |
Description
The generated file
attribution.txt
was intended to exclude alldevDependencies
, but a few snuck their way in anyway. Thebuild:attribution
script we use to generate that file has been updated to ensure thatdevDependencies
are excluded.The old script was deleting
devDependencies
frompackage.json
in an attempt to exclude them, but this wasn't working properly because the package we use to find all licenses was looking on-disk for them, not walking through the dependency graph starting at our manifest.The script now explicitly deletes
node_modules
and re-installs with only production dependencies, so they are the only ones present on-disk for the license checker to find.The script now leaves the project in a state where only production dependencies are installed, so a reminder to run
yarn setup
was added to the end of the scriptRelated issues
Fixes https://github.com/MetaMask/MetaMask-planning/issues/2182
Manual testing steps
yarn build:attribution
acorn-jsx
is not included (this is an example dependency of adevDependency
that was included previously)yarn setup
after testingScreenshots/Recordings
N/A
Pre-merge author checklist
Pre-merge reviewer checklist