Skip to content

chore: Update yarn.lock to remove inflight from application dependency tree#24737

Merged
danjm merged 4 commits intodevelopfrom
fix-yarn-audit-inflight
May 23, 2024
Merged

chore: Update yarn.lock to remove inflight from application dependency tree#24737
danjm merged 4 commits intodevelopfrom
fix-yarn-audit-inflight

Conversation

@danjm
Copy link
Copy Markdown
Contributor

@danjm danjm commented May 23, 2024

Description

We have a yarn audit failure on develop due to the package inflight which is used by the package glob. While glob is a dependency of many of our dev dependencies, it is only causing an audit failure because it is a dependency of a package ultimately imported by trezor:

danjm@pop-os:~/metamask/metamask-extension$ yarn why -R inflight
└─ metamask-crx@workspace:.
   ├─ @metamask/eth-trezor-keyring@npm:3.1.0 (via npm:^3.1.0)
   │  └─ @trezor/connect-web@npm:9.2.2 [42492] (via npm:^9.1.11 [42492])
   │     ├─ @trezor/connect@npm:9.2.2 [d8f53] (via npm:9.2.2 [d8f53])
   │     │  ├─ @trezor/connect-analytics@npm:1.0.14 [bb3a7] (via npm:1.0.14 [bb3a7])
   │     │  │  └─ @trezor/analytics@npm:1.0.16 [bc8f6] (via npm:1.0.16 [bc8f6])
   │     │  │     └─ @trezor/env-utils@npm:1.0.15 [342f9] (via npm:1.0.15 [342f9])
   │     │  │        └─ expo-constants@npm:15.4.5 [20ef0] (via npm:15.4.5 [20ef0])
   │     │  │           └─ @expo/config@npm:8.5.6 (via npm:~8.5.0)
   │     │  │              ├─ @expo/config-plugins@npm:7.9.2 (via npm:~7.9.0)
   │     │  │              │  └─ glob@npm:7.1.6 (via npm:7.1.6)
   │     │  │              │     └─ inflight@npm:1.0.6 (via npm:^1.0.4)
   │     │  │              ├─ glob@npm:7.1.6 (via npm:7.1.6)
   │     │  │              └─ sucrase@npm:3.34.0 (via npm:3.34.0)
   │     │  │                 └─ glob@npm:7.1.6 (via npm:7.1.6)

However, expo-constants is not actually used in our application code. It's inclusion in our dependency tree is due to some problem in how the trezor packages are built (which we also should probably investigate, but that can be done separately).

To solve the audit failure, this PR edits yarn.lock to resolve the instances of glob under @expo/config to a version that does not use inflight.

Update: as per the below suggestion, instead of directly editing the yarn.lock file, this PR now adds resolutions to resolve the instances of glob under @expo/config to a version that does not use inflight

Open in GitHub Codespaces

Manual testing steps

yarn audit should pass

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@danjm danjm requested a review from a team as a code owner May 23, 2024 08:59
@github-actions
Copy link
Copy Markdown
Contributor

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.

@danjm danjm changed the title Update yarn.lock to remove inflight from application dependency tree chore: Update yarn.lock to remove inflight from application dependency tree May 23, 2024
@danjm danjm added the team-extension-platform Extension Platform team label May 23, 2024
@legobeat
Copy link
Copy Markdown
Contributor

legobeat commented May 23, 2024

@danjm The canonical way to address this would be through resolutions in package.json to avoid inadvertent revert of these down the line.

Also, picking v10 introduces less new unused deps.

Adding the following lines followed by a yarn dedupe should do it:

    "sucrase@npm:3.34.0": "^3.35.0",
    "@expo/config/glob": "^10.3.10",
    "@expo/config-plugins/glob": "^10.3.10",

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [2dd5b34]
Page Load Metrics (980 ± 543 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint71149952311
domContentLoaded9361363
load5930119801131543
domInteractive9361363
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label May 23, 2024
@danjm
Copy link
Copy Markdown
Contributor Author

danjm commented May 23, 2024

Thanks @legobeat, I can update to match your suggestions

DDDDDanica
DDDDDanica previously approved these changes May 23, 2024
@socket-security
Copy link
Copy Markdown

socket-security bot commented May 23, 2024

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

Package New capabilities Transitives Size Publisher
npm/sucrase@3.35.0 Transitive: filesystem, shell +1 1.23 MB alangpierce

View full report↗︎

@danjm danjm merged commit fb1c65b into develop May 23, 2024
@danjm danjm deleted the fix-yarn-audit-inflight branch May 23, 2024 11:09
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [504fcfb]
Page Load Metrics (919 ± 558 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint711731033215
domContentLoaded96017126
load5828969191162558
domInteractive96017126
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot metamaskbot added release-11.16.6 Issue or pull request that will be included in release 11.16.6 and removed release-11.18.0 labels Jun 4, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Missing release label release-11.16.6 on PR. Adding release label release-11.16.6 on PR and removing other release labels(release-11.18.0), as PR was cherry-picked in branch 11.16.6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template release-11.16.6 Issue or pull request that will be included in release 11.16.6 team-extension-platform Extension Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants