Tidy Up CI Workflows#51
Conversation
📝 WalkthroughWalkthroughThis PR separates linting and testing into distinct workflows: adds ChangesCI Workflow Reorganization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci-lint.yml:
- Around line 7-10: The workflow currently triggers on both unscoped push and
pull_request which duplicates CI runs; update the GitHub Actions triggers in the
top-level "on" block to either remove the unscoped "push" entry or scope it to
protected branches (e.g. set "push" to only run on main/release branches) while
keeping "pull_request" for PR validation—modify the "on", "push", and
"pull_request" entries accordingly in the CI config so pushes to feature
branches no longer trigger a second run.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9ef38436-e65f-44cb-a5f1-70dca78db86a
📒 Files selected for processing (5)
.github/dependabot.yml.github/workflows/ci-dependencies.yml.github/workflows/ci-lint.yml.github/workflows/ci-package.yml.github/workflows/ci-test.yml
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
henry0816191
left a comment
There was a problem hiding this comment.
You should fix README.md/Contributing /CI coverage
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/ci-lint.yml (2)
7-15: ⚡ Quick winAdd a
concurrencygroup to cancel superseded runs.With
pull_request+pushonmain/develop, rapid pushes to a PR branch will queue multiple in-flight lint runs. Adding a per-ref concurrency group cancels older runs and saves CI minutes without changing behavior on protected branches (where you may want to keepcancel-in-progress: false).Suggested addition
permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci-lint.yml around lines 7 - 15, Add a top-level concurrency block to the workflow so superseded runs are cancelled for the same ref; specifically, under the existing top-level keys (near the on: pull_request / push block) add concurrency with a group that uses the ref (e.g., "ci-lint-${{ github.ref }}" or "${{ github.workflow }}-${{ github.ref }}") and set cancel-in-progress: true so rapid pushes to the same PR branch cancel earlier lint runs.
44-50: 💤 Low valueMinor:
prek cache gcis skipped when lint fails.Because both commands run in the same
run:block, a non-zero exit fromprek run --all-filesshort-circuits the script andprek cache gcnever executes. The cache entry is still saved byactions/cacheon a hit-miss, so over time it can grow until you bump the cache key. If gc on every run matters, split it into its own step withif: always()(and considercontinue-on-error: trueso a gc failure doesn't mask the real lint result).Suggested split
- name: pre-commit run: | uv run --only-group pre-commit prek run --all-files --show-diff-on-failure - uv run --only-group pre-commit prek cache gc env: RUFF_OUTPUT_FORMAT: github REUSE_OUTPUT_FORMAT: github + - name: prek cache gc + if: always() + continue-on-error: true + run: uv run --only-group pre-commit prek cache gc🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci-lint.yml around lines 44 - 50, The current single run block runs "uv run --only-group pre-commit prek run --all-files --show-diff-on-failure" and "uv run --only-group pre-commit prek cache gc" together so a failing lint aborts the gc; split the gc into its own workflow step that only runs "uv run --only-group pre-commit prek cache gc" and add "if: always()" (and optionally "continue-on-error: true") so "prek cache gc" executes regardless of the lint exit status; keep the env vars RUFF_OUTPUT_FORMAT and REUSE_OUTPUT_FORMAT on the lint step and add them to the new gc step as needed, referencing the existing pre-commit step name and the two commands shown in the diff.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/ci-lint.yml:
- Around line 7-15: Add a top-level concurrency block to the workflow so
superseded runs are cancelled for the same ref; specifically, under the existing
top-level keys (near the on: pull_request / push block) add concurrency with a
group that uses the ref (e.g., "ci-lint-${{ github.ref }}" or "${{
github.workflow }}-${{ github.ref }}") and set cancel-in-progress: true so rapid
pushes to the same PR branch cancel earlier lint runs.
- Around line 44-50: The current single run block runs "uv run --only-group
pre-commit prek run --all-files --show-diff-on-failure" and "uv run --only-group
pre-commit prek cache gc" together so a failing lint aborts the gc; split the gc
into its own workflow step that only runs "uv run --only-group pre-commit prek
cache gc" and add "if: always()" (and optionally "continue-on-error: true") so
"prek cache gc" executes regardless of the lint exit status; keep the env vars
RUFF_OUTPUT_FORMAT and REUSE_OUTPUT_FORMAT on the lint step and add them to the
new gc step as needed, referencing the existing pre-commit step name and the two
commands shown in the diff.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2ffd54cb-f60d-40ef-9a01-fae8a2740fe7
📒 Files selected for processing (1)
.github/workflows/ci-lint.yml
Close #37
Summary by CodeRabbit