Skip to content

ci: cache gem downloads - #3247

Merged
solnic merged 1 commit into
masterfrom
ci/cache-gem-downloads
Dec 1, 2026
Merged

solnic merged 1 commit into
masterfrom
ci/cache-gem-downloads

Conversation

@solnic

@solnic solnic commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Every test job re-downloaded its gems from rubygems.org, cloned ruby/debug from GitHub and recompiled native extensions.

  • Test jobs run with BUNDLE_GLOBAL_GEM_CACHE=true, so Bundler keeps gems, compiled extensions, git checkouts and the index in ~/.bundle/cache.
  • A new gem-cache job per gem installs every cell once (bin/test --install-only) and saves one cache, keyed by the gem's lockfiles. It only does this when the lockfiles change.
  • Test jobs restore that cache read-only, falling back to the previous cache while a new one is being built.

With a warm cache, bundle install takes about 3s instead of 20–70s. It downloads no gems and no git checkouts, and compiles nothing; only the index metadata is checked. The median job time drops from 52s to 18s. The caches total about 555 MB across the seven gems.

@solnic
solnic changed the base branch from master to ci/optimize-source-built-rubies November 25, 2026 12:33
@solnic
solnic added this pull request to stack #3248 November 25, 2026 12:33
@solnic
solnic marked this pull request as ready for review November 25, 2026 13:42
@solnic
solnic requested a review from a team as a code owner November 25, 2026 13:42

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6a3a2f8. Configure here.

uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.bundle/cache
key: ${{ steps.lookup.outputs.cache-primary-key }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cache job failure fails the tests

Medium Severity

The new gem-cache job is not in test.needs, so spec jobs run in parallel, but it still counts toward the reusable workflow result. A timeout, bundle install flake, or cache save error fails the caller test job and skips codecov, even when every spec cell passed. That contradicts the intended fallback path where tests proceed from the previous cache.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6a3a2f8. Configure here.

@solnic
solnic force-pushed the ci/cache-gem-downloads branch from 6a3a2f8 to 137ac19 Compare November 30, 2026 13:35
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 7ecb1ac.

The model rated this change low. It was raised to medium because:

  • R6: build or release configuration changed: .github/workflows/gem_test.yml, bin/test

This label is a hint for reviewers, not an approval.

Base automatically changed from ci/optimize-source-built-rubies to master December 1, 2026 13:40
@solnic
solnic force-pushed the ci/cache-gem-downloads branch from 137ac19 to 7ecb1ac Compare December 1, 2026 13:40
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 1, 2026
@solnic
solnic merged commit 6cad679 into master Dec 1, 2026
179 checks passed
@solnic
solnic deleted the ci/cache-gem-downloads branch December 1, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants