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

ci: a new prep-deps workflow with caching #29979

Merged
merged 4 commits into from
Mar 3, 2025
Merged

Conversation

HowardBraham
Copy link
Contributor

@HowardBraham HowardBraham commented Jan 29, 2025

Description

Major changes

  • prep-deps
    • There's a new workflow that parallels the CircleCI workflow. prep-deps runs first and caches the result, then prep-build-test-webpack makes an artifact, then the benchmarks run.
    • Several of the existing workflows were changed to now depend on prep-deps
    • Many of the file changes are just using the new checkout-and-setup@caching and deleting the independent "Checkout repository" step
  • vars.USE_CACHING No longer using this
    • This allows us to toggle the caching feature on and off in a centralized way. I left instructions as a comment in main.yml for how to toggle it. We can discuss implementing this in a different way, but passing this variable through different workflows is actually kind of a pain (that's the first way I implemented it). Several of the jobs are 30-60 seconds faster when this is turned on.
  • test-short-suite repository-health-checks
    • I think this could be slightly controversial, but I think it's for the better.
    • I noticed that there were 7 individual really short tests, that each ran on their own VM. Each VM instance took about 1m30s to execute. I combined these together into a single VM that runs all the short tests in sequence, and takes about 1m20s combined. The if: always() statements make all independent tests run, even if one fails.
    • The 7 jobs were: test-lint-shellcheck, test-lint-changelog, test-lint-lockfile, test-deps-audit, test-yarn-dedupe, test-deps-depcheck, validate-lavamoat-allow-scripts
    • If this were running on VMs that cost money, this would be a no-brainer. As is on GitHub runners, it doesn't really cost us any time or money. All we can really say is 7 separate jobs burn fossil fuels for a slight bit of convenience in terms of seeing individual test failures in the GitHub PR page.

Prerequisites to merging this PR

Open in GitHub Codespaces

Related issues

Split off from: #29955

@HowardBraham HowardBraham added the team-extension-platform Extension Platform team label Jan 29, 2025
@HowardBraham HowardBraham self-assigned this Jan 29, 2025
Copy link
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.

@metamaskbot metamaskbot added the team-tiger Tiger team (for tech debt reduction + performance improvements) label Jan 29, 2025
@HowardBraham HowardBraham removed the team-tiger Tiger team (for tech debt reduction + performance improvements) label Jan 29, 2025
@HowardBraham HowardBraham marked this pull request as ready for review January 29, 2025 18:41
@HowardBraham HowardBraham added the DO-NOT-MERGE Pull requests that should not be merged label Jan 29, 2025
@HowardBraham HowardBraham force-pushed the self-hosted-benchmarks branch from c9f1e1e to 6266945 Compare January 29, 2025 21:50
@metamaskbot
Copy link
Collaborator

Builds ready [1283bfe]
Page Load Metrics (1641 ± 69 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14061928164214569
domContentLoaded13981902162013967
load14071926164114469
domInteractive21118382411
backgroundConnect106324157
firstReactRender15101362411
getState479192110
initialActions01000
loadScripts9981388117711555
setupStore66316168
uiStartup15862435188520096

Copy link
Contributor

@NicholasEllul NicholasEllul left a comment

Choose a reason for hiding this comment

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

Left one question & reviewed usage of caching from a security POV. No concerns from our end. I'll let the others chime in with regards to reviewing the functionality

@NicholasEllul
Copy link
Contributor

Change setup-environment@caching back to setup-environment@main

(Not blocking) Are there plans to version changes? While for now pointing directly to the main branch allows for immediate updates, it can result in challenges down the road if a breaking change is introduced. Could be handy to have things set up now to save time in the long run.

@HowardBraham HowardBraham requested review from a team as code owners February 11, 2025 07:20
@HowardBraham HowardBraham force-pushed the self-hosted-benchmarks branch from 6266945 to abcd5a1 Compare February 11, 2025 07:24
@HowardBraham HowardBraham removed the request for review from a team February 11, 2025 07:25
@metamaskbot
Copy link
Collaborator

Builds ready [5973f94]
Page Load Metrics (1899 ± 62 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16152125189912560
domContentLoaded16002057185911857
load16092130189912862
domInteractive29104452110
backgroundConnect1092392512
firstReactRender167332199
getState66821199
initialActions01000
loadScripts11251604138811957
setupStore86515157
uiStartup18342443216215876
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@HowardBraham
Copy link
Contributor Author

@NicholasEllul @itsyoboieltr @Gudahtt
The dependent PR MetaMask/github-tools#42 has been updated, and now this PR needs another look from you guys

Copy link
Contributor

@NicholasEllul NicholasEllul left a comment

Choose a reason for hiding this comment

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

Overall changes look good 👍

@metamaskbot
Copy link
Collaborator

Builds ready [a25ff4b]
Page Load Metrics (1548 ± 37 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1429180315477737
domContentLoaded1394173715237134
load1433180615487737
domInteractive16108352110
backgroundConnect107128157
firstReactRender1478282311
getState56516209
initialActions01000
loadScripts997133911276732
setupStore84813126
uiStartup1637204117488742
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@HowardBraham HowardBraham force-pushed the prep-deps-caching branch 2 times, most recently from 388a3c0 to 8fc4b17 Compare March 3, 2025 08:34
@HowardBraham HowardBraham removed the DO-NOT-MERGE Pull requests that should not be merged label Mar 3, 2025
Copy link
Contributor

@NicholasEllul NicholasEllul left a comment

Choose a reason for hiding this comment

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

Reviewed from a security POV, LGTM!

@metamaskbot
Copy link
Collaborator

Builds ready [d6851b8]
Page Load Metrics (1873 ± 128 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint60323411775351168
domContentLoaded149325431831270130
load153225531873267128
domInteractive22210454120
backgroundConnect1286412311
firstReactRender1571362010
getState55116126
initialActions01000
loadScripts109020881382247119
setupStore76420199
uiStartup176828542128301145
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@HowardBraham HowardBraham added this pull request to the merge queue Mar 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 3, 2025
@HowardBraham HowardBraham added this pull request to the merge queue Mar 3, 2025
Merged via the queue into main with commit ff15246 Mar 3, 2025
74 checks passed
@HowardBraham HowardBraham deleted the prep-deps-caching branch March 3, 2025 22:06
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2025
@metamaskbot metamaskbot added the release-12.15.0 Issue or pull request that will be included in release 12.15.0 label Mar 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.15.0 Issue or pull request that will be included in release 12.15.0 team-extension-platform Extension Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants