Skip to content

chore: modify dependency caching on bitrise#8561

Merged
dbrans merged 8 commits into
mainfrom
dbrans/bitrise-nocache
Feb 20, 2024
Merged

chore: modify dependency caching on bitrise#8561
dbrans merged 8 commits into
mainfrom
dbrans/bitrise-nocache

Conversation

@dbrans

@dbrans dbrans commented Feb 9, 2024

Copy link
Copy Markdown
Contributor

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
@github-actions

github-actions Bot commented Feb 9, 2024

Copy link
Copy Markdown
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.

@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

codecov-commenter commented Feb 9, 2024

Copy link
Copy Markdown

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 DEPRECATED: please use "team-confirmations" 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 commented Feb 9, 2024

Copy link
Copy Markdown
Contributor

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
@sonarqubecloud

Copy link
Copy Markdown

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
@dbrans dbrans requested a review from vinistevam February 14, 2024 14:07
@github-actions

Copy link
Copy Markdown
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
@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 team-confirmations-system-deprecated DEPRECATED: please use "team-confirmations" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants