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

chore: modify dependency caching on bitrise #8561

Merged
merged 8 commits into from
Feb 20, 2024
Merged

Conversation

dbrans
Copy link
Contributor

@dbrans dbrans commented Feb 9, 2024

Description

  • Remove caching around yarn install to reduce bitrise build times by approximately 1m46s.
    It is a "quick win" until a decision is made on a caching strategy.
  • Add caching of node_modules specifically to e2e tests: The end-to-end (e2e) tests on Bitrise leverage caching to ensure that artifacts generated during the build stage are available during the test stage for runtime. Without this caching mechanism, we would arrive at the test stage without the necessary components for a fully functional runtime.
    Passing pr_smoke_e2e_pipeline
    Passing pr_regression_e2e_pipeline

Background and discussion in this internal document, but the gist is:

  • @Gudahtt highlighted that a restored node_modules directory does not guarantee a fully functional environment due to potential modifications by dependencies' lifecycle scripts outside of node_modules.
  • Furthermore, the current approach to yarn cache management results in a net-negative impact, as loading and saving the cache takes longer than the time saved by yarn install.
  • By eliminating caching, the code_setup workflow duration decreases from approximately 5m29s to 3m53m.

Related issues

Fixes: https://github.com/MetaMask/mobile-planning/issues/1512

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • 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.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@dbrans dbrans requested a review from a team as a code owner February 9, 2024 20:28
Copy link
Contributor

github-actions bot commented Feb 9, 2024

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.

@dbrans dbrans marked this pull request as draft February 9, 2024 20:29
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Feb 9, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7012f65) 40.90% compared to head (3f310b2) 40.90%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8561   +/-   ##
=======================================
  Coverage   40.90%   40.90%           
=======================================
  Files        1245     1245           
  Lines       30150    30150           
  Branches     2895     2895           
=======================================
  Hits        12333    12333           
  Misses      17114    17114           
  Partials      703      703           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dbrans dbrans changed the title Removing node_modules and yarn cache during code_setup. Remove node_modules and yarn cache from bitrise Feb 9, 2024
@dbrans dbrans added the team-confirmations-system DEPRECATED: please use "team-confirmations" label instead label Feb 9, 2024
@dbrans dbrans changed the title Remove node_modules and yarn cache from bitrise chore: remove node_modules and yarn cache from bitrise Feb 9, 2024
@dbrans dbrans changed the title chore: remove node_modules and yarn cache from bitrise chore: remove dependencies cache from bitrise Feb 9, 2024
@dbrans dbrans marked this pull request as ready for review February 9, 2024 21:37
@github-actions github-actions bot added the Run Smoke E2E Triggers smoke e2e on Bitrise label Feb 9, 2024
Copy link
Contributor

github-actions bot commented Feb 9, 2024

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e34d0221-adf4-4042-89da-784a2e72feba
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@dbrans dbrans marked this pull request as draft February 13, 2024 14:40
@dbrans dbrans changed the title chore: remove dependencies cache from bitrise chore: modify dependency caching on bitrise Feb 14, 2024
Copy link

sonarcloud bot commented Feb 14, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@dbrans dbrans marked this pull request as ready for review February 14, 2024 14:07
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/5b36676b-cb2e-41ce-8ed6-e7ad549a998e
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@dbrans dbrans merged commit 472e953 into main Feb 20, 2024
33 checks passed
@dbrans dbrans deleted the dbrans/bitrise-nocache branch February 20, 2024 13:37
@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2024
@metamaskbot metamaskbot added the release-7.18.0 Issue or pull request that will be included in release 7.18.0 label Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template release-7.18.0 Issue or pull request that will be included in release 7.18.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-confirmations-system DEPRECATED: please use "team-confirmations" label instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants