metamask-extension
metamask-extension copied to clipboard
feat(2675): exclude ci build for non-pr
Description
To reduce cost for circle ci and allocate more resources to PR, we remove the circle build for non-pr branches.
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2675
Manual testing steps
- Go to this page...
Screenshots/Recordings
Before
After
Pre-merge author checklist
- [ ] I've followed MetaMask Contributor Docs and MetaMask Extension 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.
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.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 69.77%. Comparing base (
5ee57a6) to head (8abf362). Report is 29 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #25489 +/- ##
===========================================
- Coverage 69.77% 69.77% -0.00%
===========================================
Files 1376 1378 +2
Lines 48403 48578 +175
Branches 13348 13394 +46
===========================================
+ Hits 33773 33895 +122
- Misses 14630 14683 +53
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Builds ready [013018f]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (65 ± 8 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 62 | 141 | 92 | 17 | 8 |
| domContentLoaded | 9 | 56 | 24 | 10 | 5 | ||
| load | 41 | 113 | 65 | 16 | 8 | ||
| domInteractive | 9 | 56 | 23 | 10 | 5 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Builds ready [8abf362]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (161 ± 189 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 64 | 130 | 102 | 18 | 8 |
| domContentLoaded | 9 | 58 | 26 | 14 | 7 | ||
| load | 41 | 1873 | 161 | 393 | 189 | ||
| domInteractive | 9 | 58 | 26 | 14 | 7 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
The solution in this PR is a little cumbersome. I implemented it the other way, as discussed in this article: https://support.circleci.com/hc/en-us/articles/22357021358875-Build-on-Pull-Requests-and-all-commits
I turned on this switch in our CircleCI settings:
For our future records, the API call I ran was:
curl -X PUT \
--header "Circle-Token: <token>" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{"feature_flags":{"pr-only-branch-overrides": "develop, master, trigger-ci.*, Version-v[0-9]+.[0-9]+.[0-9]+"}}' \
'https://circleci.com/api/v1.1/project/github/MetaMask/metamask-extension/settings'
This is the result of my tests on different branch names, notice the Not Run:
@DDDDDanica @Gudahtt please do try some independent tests on this, but I think it's fully working now without this PR.
Hey @HowardBraham thanks for providing this solution. Unfortunately i cannot access the settings page you shared with. But this solution seems neat ! And then i checked the CURL you sent and it seems like this CURL was doing the opposite of what we are looking for? As now it is not running for branch trigger-ci.* or Version-C and running for other branches only. is something I'm missing here?
@DDDDDanica I believe the CURL call is saying:
Only run CircleCI on pull requests except use the overrides
{"pr-only-branch-overrides": "develop, master, trigger-ci.*, Version-v[0-9]+.[0-9]+.[0-9]+"}
So run on branches develop, master, trigger-ci.*, and Versions
@HowardBraham the script seems correct, my bad, the branch I was testing was not named properly, and i believe this approach is the easiest one. Tested it locally as well and all works well. @danjm and @Gudahtt If this approach is also acceptable with you, we can go ahead and close this PR & Ticket
It does seem like Howard's solution is working
Close because this has been implemented by @HowardBraham with a cleaner solution