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

feat: add metamaskbot codeowner announcement #30668

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

hmalik88
Copy link
Contributor

@hmalik88 hmalik88 commented Mar 2, 2025

Description

Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions:

  1. What is the reason for the change? We often get tagged for codeowner reviews, it can sometimes be difficult to know what you're reviewing without looking at the CODEOWNER file yourself. It would be nice to know what you need to review upon just visting the PR link.
  2. What is the improvement/solution? Added a new workflow to get the MetaMask bot to post a comment on the files that need a CODEOWNER review categorized by the respective team. The bot will post a comment and then update that comment as needed. It will also delete the comment if there is no longer a CODEOWNER review required.

Manual testing steps

  1. Open a PR against this branch
  2. Make some codeowner file changes
  3. Observe the MetaMask bot make a comment.

Screenshots/Recordings

After

Screenshot 2025-03-02 at 3 52 44 PM

Pre-merge author checklist

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.

Copy link
Contributor

github-actions bot commented Mar 2, 2025

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.

@metamaskbot metamaskbot added the team-snaps-platform Snaps Platform team label Mar 2, 2025
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Mar 2, 2025
@hmalik88
Copy link
Contributor Author

hmalik88 commented Mar 2, 2025

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

@hmalik88 hmalik88 marked this pull request as ready for review March 2, 2025 21:56
@hmalik88 hmalik88 requested review from a team as code owners March 2, 2025 21:56
@metamaskbot
Copy link
Collaborator

Builds ready [ee3811e]
Page Load Metrics (1564 ± 41 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint35217401507279134
domContentLoaded1383172515378440
load1423174415648541
domInteractive19113462613
backgroundConnect998322211
firstReactRender146726189
getState45517189
initialActions00000
loadScripts1012133311448038
setupStore725942
uiStartup16302004176510148
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@HowardBraham HowardBraham left a comment

Choose a reason for hiding this comment

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

I have not actually tested functionality, do you have a PR open against this that tests it?

package.json Outdated
@@ -120,6 +120,7 @@
"check-pr-has-required-labels": "ts-node ./.github/scripts/check-pr-has-required-labels.ts",
"close-release-bug-report-issue": "ts-node ./.github/scripts/close-release-bug-report-issue.ts",
"check-template-and-add-labels": "ts-node ./.github/scripts/check-template-and-add-labels.ts",
"identify-codeowners": "ts-node ./.github/scripts/identify-codeowners.ts",
Copy link
Contributor

Choose a reason for hiding this comment

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

Two different comments on this line:

  1. We are trying to migrate away from ts-node and to tsx. And then a little later we can probably go to Node 20+ native TypeScript support.
  2. I don't think commands that can run only on CI should be in package.json, I think it just adds to the clutter.

(These two comments also probably apply to some of the nearby lines)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What pattern would you suggest I follow?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say remove this line from package.json and make the yml execute yarn tsx ./.github/scripts/identify-codeowners.ts

I have not investigated, but if any of the nearby lines fall in the same boat, do the same thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done here: f5e6e1b. Mind if we take care of the other ones in a separate PR?

package.json Outdated
@@ -374,6 +375,7 @@
"lottie-web": "^5.12.2",
"luxon": "^3.2.1",
"nanoid": "^3.3.8",
"picomatch": "^4.0.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

How important is using picomatch, and how much more code is it to use a package we already use?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's needed, the library is also pretty lightweight. I don't think we're doing any glob pattern matching anywhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was trying to understand this... I guess it's because CODEOWNERS is written with globs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yessir

Comment on lines 11 to 15
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup environment
uses: metamask/github-tools/.github/actions/setup-environment@1d657e262aea7e3f216754febb624831527d2565
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to have not a direct merge conflict, but an indirect merge conflict with #29979, so let's watch out for which one merges first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do 🫡

@hmalik88
Copy link
Contributor Author

hmalik88 commented Mar 3, 2025

I have not actually tested functionality, do you have a PR open against this that tests it?

Yeah, I was testing against #30669

@HowardBraham
Copy link
Contributor

Yeah, I was testing against #30669

Okay I tried it out, pretty cool.
And this is minor but I think very easy: after we groupFilesByTeam, can we sort the teams themselves in alphabetical order?
My test produced this result, which I think isn't sorted on anything:

✨ Files requiring CODEOWNER review ✨

📄 @HowardBraham

  • development/circular-deps.jsonc

🔒 @MetaMask/extension-security-team

  • development/circular-deps.jsonc

📈 @MetaMask/ramp

  • ui/ducks/ramps/ramps.test.ts

🫰 @MetaMask/snaps-devs

  • ui/helpers/utils/permission.js

🖥️ @MetaMask/wallet-ux

  • ui/components/multichain/multichain-components.scss

📄 @dbrans

  • development/circular-deps.jsonc

@hmalik88
Copy link
Contributor Author

hmalik88 commented Mar 3, 2025

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

HowardBraham
HowardBraham previously approved these changes Mar 3, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [175396c]
Page Load Metrics (1844 ± 57 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16322158184111756
domContentLoaded16142102180911254
load16252161184411857
domInteractive289842199
backgroundConnect1287332211
firstReactRender1585402512
getState66017189
initialActions01000
loadScripts1192156813528943
setupStore8141121
uiStartup17782431210414670
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [65ccd4c]
Page Load Metrics (1865 ± 93 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint40622121790370178
domContentLoaded14742193183419091
load14862216186519393
domInteractive25100512311
backgroundConnect1091332110
firstReactRender1475342211
getState473212211
initialActions01000
loadScripts10761632137614972
setupStore85918168
uiStartup172224912113221106
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

HowardBraham
HowardBraham previously approved these changes Mar 4, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [894a904]
Page Load Metrics (1655 ± 95 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint27323391438497239
domContentLoaded14692270163719091
load14832334165519795
domInteractive14128403115
backgroundConnect94519126
firstReactRender1476382311
getState46113168
initialActions01000
loadScripts10611814122417082
setupStore74813126
uiStartup17062537188019795
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [9e6ed13]
Page Load Metrics (1685 ± 61 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15552105168112661
domContentLoaded15372076165212459
load15522108168512761
domInteractive268740178
backgroundConnect1086362110
firstReactRender1575342412
getState55812147
initialActions01000
loadScripts11101556122110651
setupStore75513136
uiStartup17342383191314168
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [e02a949]
Page Load Metrics (1865 ± 61 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16932223186412861
domContentLoaded16682191183312460
load16932219186512761
domInteractive15145502914
backgroundConnect1285392110
firstReactRender1580472512
getState55912115
initialActions00000
loadScripts1234159413779445
setupStore76115136
uiStartup19272501211614971
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [cdad138]
Page Load Metrics (1830 ± 95 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16212250183819895
domContentLoaded15722185180418890
load16222258183019895
domInteractive27191503919
backgroundConnect107326199
firstReactRender1476422613
getState56420199
initialActions00000
loadScripts11741699136816177
setupStore75313105
uiStartup181226042082221106
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@hmalik88 hmalik88 added team-extension-platform Extension Platform team and removed INVALID-PR-TEMPLATE PR's body doesn't match template team-snaps-platform Snaps Platform team labels Mar 7, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [3ebad9d]
Page Load Metrics (2180 ± 101 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint18262599216820397
domContentLoaded17612421208115976
load182526642180210101
domInteractive28154553416
backgroundConnect10458999445
firstReactRender18106472512
getState7200444120
initialActions01000
loadScripts13331908158814067
setupStore95818157
uiStartup202837352571398191
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-extension-platform Extension Platform team
Projects
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

3 participants