ci: use artifact + actions/cache for coverage, remove git push to master#1325
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts the CI workflow’s concurrency behavior and hardens the “commit regenerated coverage cache to master” step to better handle edge cases during long-running cache rebuilds.
Changes:
- Update workflow-level
concurrencygrouping/cancelation rules to treat push events differently from PRs. - Make the cache-commit step more resilient by aborting a failed rebase and switching to pushing via an authenticated
originremote URL.
| # PRs: group by branch (new push cancels old). Push to master: unique per SHA (never cancelled). | ||
| group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.ref }} |
| # is changed, so rebase conflicts are essentially impossible. | ||
| git fetch origin master | ||
| git rebase origin/master | ||
| git rebase origin/master || { git rebase --abort; echo "Rebase conflict — cache will be regenerated on the next trigger."; exit 0; } |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Important Merge conflicts detected (Beta)
📝 Coding Plan
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. Comment |
312a304 to
b2cf5a1
Compare
|
Claude Code Review Head SHA: b2cf5a1 Files changed:
Findings:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1325 +/- ##
=======================================
Coverage 45.01% 45.01%
=======================================
Files 70 70
Lines 20562 20562
Branches 1962 1962
=======================================
Hits 9255 9255
Misses 10179 10179
Partials 1128 1128 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary\n\nReplaces the git-push-to-master approach for the coverage cache with a combination of artifacts (same-run) and
actions/cache(cross-run). This eliminates all branch protection and PAT issues.\n\n### Changes\n-rebuild-cacheuploads artifact AND saves toactions/cache\n- Test jobs try artifact first (same run as rebuild), fall back toactions/cache(previous runs)\n- Cache key includes PR number — subsequent pushes to the same PR reuse the cache without rebuilding\n- Staleness check (cases_hash) is now a warning, not a rejection — old tests' coverage is still valid, new tests are conservatively included\n- Added weekly schedule (cron: Monday 6AM UTC) to prevent cache expiry\n- Removed: git commit/push to master,CACHE_PUSH_TOKENsecret,permissions: contents: write\n\n### How it works\n- First push to PR (changescases.py):rebuild-cachetriggers → builds fresh cache → uploads artifact + saves toactions/cache→ test jobs download artifact → prune tests\n- Subsequent push to same PR (fixup):rebuild-cacheskipped → test jobs restore fromactions/cache→ prune tests\n- Push to master:rebuild-cachetriggers if deps changed, otherwise skipped → tests use committed cache fallback\n\n## Test plan\n- [ ] PR withcases.pychange: rebuild-cache triggers, test jobs get fresh cache\n- [ ] Subsequent push to same PR: rebuild-cache skipped, test jobs restore from actions/cache\n- [ ] Weekly schedule triggers rebuild-cache\n\n🤖 Generated with Claude Code"