metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

feat(2675): exclude ci build for non-pr

Open DDDDDanica opened this issue 1 year ago • 2 comments

Description

To reduce cost for circle ci and allocate more resources to PR, we remove the circle build for non-pr branches.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2675

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

截屏2024-06-24 15 15 50

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.

DDDDDanica avatar Jun 24 '24 15:06 DDDDDanica

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.

github-actions[bot] avatar Jun 24 '24 15:06 github-actions[bot]

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.

codecov[bot] avatar Jul 10 '24 14:07 codecov[bot]

Builds ready [013018f]
Page Load Metrics (65 ± 8 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6214192178
domContentLoaded95624105
load4111365168
domInteractive95623105
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar Jul 11 '24 01:07 metamaskbot

Builds ready [8abf362]
Page Load Metrics (161 ± 189 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint64130102188
domContentLoaded95826147
load411873161393189
domInteractive95826147
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar Jul 11 '24 11:07 metamaskbot

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: image

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:

image

@DDDDDanica @Gudahtt please do try some independent tests on this, but I think it's fully working now without this PR.

HowardBraham avatar Jul 11 '24 22:07 HowardBraham

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 avatar Jul 12 '24 11:07 DDDDDanica

@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 avatar Jul 13 '24 00:07 HowardBraham

@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

DDDDDanica avatar Jul 13 '24 02:07 DDDDDanica

It does seem like Howard's solution is working

danjm avatar Jul 19 '24 09:07 danjm

Close because this has been implemented by @HowardBraham with a cleaner solution

DDDDDanica avatar Jul 19 '24 23:07 DDDDDanica