Skip to content
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

chore: Deduplicate remaining dependencies; add deduplicate script #7131

Merged
merged 5 commits into from
Oct 17, 2023

Conversation

legobeat
Copy link
Contributor

@legobeat legobeat commented Sep 4, 2023

#7123 but split up dedupes and rebased on:

Description

A deduplicate script has been added to package.json, which allows deduplicating dependencies in the lockfile. This feature is built-in as part of Yarn v3, but on Yarn v1 it's provided by the yarn-deduplicate package.

It has been run, so the lockfile has been purged of unnecessary copies of dependencies. This means many dependencies have been updated, but it should result in no breakages as long as all affected packages are SemVer-compliant or handled by one of our resolutions.

A CI check has been added to ensure dependencies are always deduplicated. If duplicates are detected, the error from CI will explain how to remove them.

Issue

No related issue

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@legobeat legobeat mentioned this pull request Sep 4, 2023
3 tasks
@legobeat legobeat force-pushed the deps-dedupe-rebased branch from 219dcee to 31c2d0a Compare September 4, 2023 19:49
@socket-security
Copy link

socket-security bot commented Sep 4, 2023

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
yarn-deduplicate 6.0.2 None +2 313 kB scinos
socket.io-client 4.5.3...4.6.1 None +2/-1 1.94 MB darrachequesne
@types/react-native 0.64.11...0.64.13 None +0/-0 386 kB types
prettier 2.8.1...2.8.8 None +0/-0 11.2 MB prettier-bot
dotenv 16.0.3...16.3.1 environment +0/-0 71.6 kB motdotla

🚮 Removed packages: @types/lodash@4.14.186, @types/qs@6.9.7, @walletconnect/jsonrpc-types@1.0.2, eciesjs@0.3.15

@socket-security
Copy link

socket-security bot commented Sep 4, 2023

👍 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: rlp@2.2.7, exponential-backoff@3.1.1, cosmiconfig@7.1.0, define-properties@1.2.1

Next steps

Take a deeper look at the dependency

Take 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 package

If 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 risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

@legobeat
Copy link
Contributor Author

legobeat commented Sep 4, 2023

dedupes-diff.txt
Diff vs #7123

@legobeat legobeat force-pushed the deps-dedupe-rebased branch from 31c2d0a to 837db7e Compare September 4, 2023 20:08
@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (3f2af04) 34.62% compared to head (4079dc6) 34.62%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7131   +/-   ##
=======================================
  Coverage   34.62%   34.62%           
=======================================
  Files        1019     1019           
  Lines       27192    27192           
  Branches     2217     2217           
=======================================
  Hits         9414     9414           
  Misses      17287    17287           
  Partials      491      491           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@legobeat legobeat force-pushed the deps-dedupe-rebased branch 2 times, most recently from cd8677e to 26bd973 Compare September 4, 2023 21:35
@legobeat legobeat force-pushed the deps-dedupe-rebased branch 2 times, most recently from f0b7f2d to 4596671 Compare October 2, 2023 08:49
@legobeat legobeat added dependencies Pull requests that update a dependency file team-security labels Oct 3, 2023
@legobeat legobeat force-pushed the deps-dedupe-rebased branch from 4596671 to 1f3df4e Compare October 12, 2023 10:06
@legobeat legobeat marked this pull request as ready for review October 12, 2023 10:06
@legobeat legobeat requested a review from a team as a code owner October 12, 2023 10:06
@legobeat legobeat requested review from leotm and sethkfman October 12, 2023 10:08
@legobeat
Copy link
Contributor Author

@SocketSecurity ignore rlp@2.2.7
@SocketSecurity ignore exponential-backoff@3.1.1
@SocketSecurity ignore cosmiconfig@7.1.0

new author ok

@legobeat
Copy link
Contributor Author

@SocketSecurity ignore define-properties@1.2.1

@legobeat legobeat changed the title chore: Deduplicate remaining dependencies chore: Deduplicate remaining dependencies; add deduplicate script Oct 12, 2023
@legobeat legobeat force-pushed the deps-dedupe-rebased branch 2 times, most recently from 3452840 to 888fec0 Compare October 16, 2023 00:49
Gudahtt and others added 4 commits October 16, 2023 11:38
A `deduplicate` script has been added to `package.json`, which allows
deduplicating dependencies in the lockfile. This feature is built-in as
part of Yarn v3, but on Yarn v1 it's provided by the `yarn-deduplicate`
package.

It has been run, so the lockfile has been purged of unnecessary copies
of dependencies. This means many dependencies have been updated, but it
should result in no breakages as long as all affected packages are
SemVer-compliant or handled by one of our resolutions.

Additionally, a CI check has been added to ensure dependencies are
always deduplicated. If duplicates are detected, the error from CI will
explain how to remove them.
@legobeat legobeat force-pushed the deps-dedupe-rebased branch from 888fec0 to 4079dc6 Compare October 16, 2023 11:38
Copy link
Member

@leotm leotm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹🤖

@legobeat legobeat merged commit 9af15b4 into MetaMask:main Oct 17, 2023
24 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file team-security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants