Skip to content

ci: cache mypy incremental state in Backend Type Check - #520

Merged
corrin merged 1 commit into
mainfrom
ci-mypy-incremental-cache
Aug 2, 2026
Merged

ci: cache mypy incremental state in Backend Type Check#520
corrin merged 1 commit into
mainfrom
ci-mypy-incremental-cache

Conversation

@corrin

@corrin corrin commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Backend Type Check ran full-strict mypy cold on every push (~2m15s across recent runs). Mypy is incremental by design, so this restores .mypy_cache before the gate: typical pushes re-check only the modules whose dependencies changed, dropping the job to tens of seconds.

Cache mechanics: actions/cache never overwrites an existing key, so the key embeds the commit SHA (every run saves a fresh snapshot) and restore-keys falls back to the newest snapshot for the same poetry.lock + pyproject.toml. A deps or mypy-config change misses the fallback and does one cold run, exactly as today. Same pinned actions/cache SHA as the existing Poetry cache steps.

Investigated and rejected while here: caching ~/.cache/pre-commitpre-commit/action@v3 already does that internally (verified in its action.yml), so the Pre-commit job's ~3m40s is genuine hook execution. Backend Tests' ~6m is real test execution; the lever there would be --parallel, deliberately not bundled into this change.

First run on this PR is the cold seed; the speedup shows from the next push onward.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PnuHL7w3UisSk6KQ81q3Qf

Backend Type Check ran full-strict mypy cold on every push (~2m15s).
Mypy is incremental, so restoring .mypy_cache lets it re-check only the
modules whose dependencies changed — typical pushes drop to seconds.
The key embeds the commit SHA because actions/cache never overwrites an
existing key; restore-keys falls back to the newest snapshot for the
same poetry.lock + pyproject.toml.

The other candidate (caching pre-commit hook environments) turned out
to already exist inside pre-commit/action@v3, so it is not duplicated
here.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PnuHL7w3UisSk6KQ81q3Qf
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@corrin, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1d8c94a7-83bd-46d2-b75c-51504467a6db

📥 Commits

Reviewing files that changed from the base of the PR and between 8e01781 and 4410d88.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@corrin
corrin merged commit b126a76 into main Aug 2, 2026
9 checks passed
@corrin
corrin deleted the ci-mypy-incremental-cache branch August 2, 2026 08:43
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.

1 participant