-
Notifications
You must be signed in to change notification settings - Fork 5k
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
build: track circular dependency in the codebase #29811
Conversation
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. |
Builds ready [171032a]
Page Load Metrics (1662 ± 50 ms)
Bundle size diffs
|
.github/workflows/test-lint.yml
Outdated
- name: Check circular dependencies | ||
run: yarn circular-deps:check |
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.
This isn't a great place to put this step, because test-lint
was already the slowest job in this part of the pipeline. I would put this step in a separate job that runs on a separate machine.
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.
@HowardBraham I think it should be added to yarn lint
and yarn lint:fix
, since this really is just a lint step. Developers already run yarn lint:fix
(and often yarn lint
) before pushing to CI, so while it might slow the lint job in CI a small amount, it won't cause total CI failures due to developers forgetting to run a yarn lint:fix
plus an additional circular-lint:fix
step.
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.
I think we can do both: If we make the circular dependency fix part of yarn lint:fix
for developers, but run the check as a separate CI job to avoid slowing down test-lint. This gives us convenient local fixes and efficient CI checks.
Thoughts?
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.
I've made these changes:
circular-deps:check
now runs as a separate CI jobcircular-deps:update
now is part ofyarn lint:fix
, which does not run on CI
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.
@dbrans I think you forgot to make this actually run... main.yml
needs to call it
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.
Done.
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is shell access?This module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code. Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced. Take 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
|
Builds ready [9d4d779]
Page Load Metrics (1776 ± 132 ms)
Bundle size diffs
|
@metamaskbot update-policies |
Let's add |
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.
I think I prefer having the check as part of the lint
CI step, but not enough to block merging. Approved! Nice work!
@metamaskbot update-policies |
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
94e3d78
Builds ready [7dde616]
Page Load Metrics (1620 ± 60 ms)
Bundle size diffs
|
Builds ready [bc1c8a2]
Page Load Metrics (1702 ± 80 ms)
Bundle size diffs
|
Description
This PR introduces circular dependency detection, tracking, and CODEOWNERS.
Here are the key changes:
Added a new circular dependency detection system:
development/circular-deps.ts
that usesmadge
to detect circular dependencies.madgerc
for TypeScript-specific settingsdevelopment/circular-deps.json
containing current circular dependenciesAdded new yarn scripts in
package.json
:yarn circular-deps:check
- Verifies circular dependencies match baselineyarn circular-deps:update
- Updates baseline with current circular dependenciesAdded CI integration:
.github/workflows/test-circular-deps.yml
to run circular dependency checkAssigning appropriate CODEOWNERS to
circular-deps.jsonc
The PR essentially sets up a process to track new circular dependencies while acknowledging existing ones in the codebase.
Related issues
Manual testing steps
yarn circular-deps:check
=> should report that codebase is out of sync withcircular-deps.jsonc
yarn circular-deps:update
=> should updatecircular-deps.jsonc
to match the codebase. Inspect the diff.yarn circular-deps:check
=> should pass.Screenshots/Recordings
Pre-merge author checklist
Pre-merge reviewer checklist