Skip to content

Invalidates gem caches and separates danger and macOS caches#1798

Merged
vegaro merged 3 commits into
mainfrom
fix-gem-caches
Aug 8, 2022
Merged

Invalidates gem caches and separates danger and macOS caches#1798
vegaro merged 3 commits into
mainfrom
fix-gem-caches

Conversation

@vegaro

@vegaro vegaro commented Aug 8, 2022

Copy link
Copy Markdown
Member

https://app.circleci.com/pipelines/github/RevenueCat/purchases-ios/7590/workflows/f9b051cd-6b41-4d7b-b4b1-77edbec943a5

Restoring caches is taking long time because it's failing to restore caches that are stored in Danger's job, which runs on a Docker image. In a run from before the merge of the Danger changes, it’s finding the cache in Cached paths: /Users/distiller/purchases-ios/vendor/bundle. In the newer runs it’s failing in /home/circleci/purchases-ios/vendor/bundle/

CircleCI docs say:

Warning: Caching files between different executors, for example, between Docker and machine, Linux, Windows or macOS, or CircleCI image and non-CircleCI image, can result in file permissions and path errors. These errors are often caused by missing users, users with different UIDs, and missing paths. Use extra care when caching files in these cases.
https://circleci.com/docs/caching

So it looks like the issue is with the paths. I think the best solution is to have two different caches, one for Danger and one for the MacOS executors

@vegaro vegaro added the ci label Aug 8, 2022
@vegaro vegaro requested a review from a team August 8, 2022 14:42

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! I see you're rerunning the jobs and they are using the cache much faster now 🎉

Comment thread .circleci/config.yml
- run: bundle install --clean --path vendor/bundle
- save_cache:
key: v1-gem-cache-{{ checksum "Gemfile.lock" }}
key: v2-gem-cache-{{ checksum "Gemfile.lock" }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm I wonder why we don't call install_dependencies here instead... But it's not related to this change, so we can look into it later.

@joshdholtz joshdholtz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙌 LGTM

@vegaro vegaro merged commit cb9d1d4 into main Aug 8, 2022
@vegaro vegaro deleted the fix-gem-caches branch August 8, 2022 14:51
This was referenced Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants