ci: switch CI to paths-filter so pytest reports on docs-only PRs - #446
Conversation
… PRs The previous `paths-ignore` filter silently dropped the entire workflow on docs-only PRs, leaving the `pytest (3.12)` and `pytest (3.13)` required status checks unreported. With the `required_status_checks` ruleset on main, that meant docs-only PRs (e.g. README updates, version roadmap row flips) could not merge without manual intervention. Replaces the workflow-level `paths-ignore` with an in-job `dorny/paths-filter` step. The job now always runs (so the required check always reports a status) but the install + test steps are gated on `code` paths actually changing. Docs-only PRs see a short-circuit "reporting pass for docs-only PR" log line and a green check. Per the TODO note in the previous workflow body: "once branch protection requires this check, migrate to a dorny/paths-filter detection job so the workflow always runs and reports a status, with downstream jobs gated by `if:`." This is that migration.
Reviewer's GuideSwitches CI from workflow-level paths-ignore to in-job dorny/paths-filter-based gating so that pytest checks always run and report, but installation and tests are skipped for docs-only changes. Sequence diagram for CI workflow with paths-filter gating pytestsequenceDiagram
actor Developer
participant GitHub
participant CI_Workflow
participant PathsFilter as dorny_paths_filter_v3
participant SetupUV as setup_uv
participant Pytest as pytest_job
Developer->>GitHub: Open_or_update_pull_request
GitHub-->>CI_Workflow: Trigger_CI_on_pull_request_to_main
CI_Workflow->>PathsFilter: Run_paths_filter_with_code_filters
PathsFilter-->>CI_Workflow: code_output_true_or_false
alt Code_paths_changed
CI_Workflow->>SetupUV: Run_setup_uv_with_python_version
SetupUV-->>CI_Workflow: Environment_ready
CI_Workflow->>Pytest: uv_sync_frozen_dev_archive
Pytest-->>CI_Workflow: Dependencies_installed
CI_Workflow->>Pytest: uv_run_pytest_tests_ignore_e2e
Pytest-->>GitHub: Report_required_status_check_pass_or_fail
else No_code_paths_changed_docs_only
CI_Workflow->>GitHub: Run_echo_no_code_paths_changed
CI_Workflow-->>GitHub: Report_required_status_check_pass
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
| egress-policy: audit | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v5 | ||
| - uses: dorny/paths-filter@v3 |
| - 'uv.lock' | ||
| - '.github/workflows/ci.yml' | ||
| - if: steps.filter.outputs.code == 'true' | ||
| uses: astral-sh/setup-uv@v5 |
| egress-policy: audit | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v5 | ||
| - uses: dorny/paths-filter@v3 |
| - 'uv.lock' | ||
| - '.github/workflows/ci.yml' | ||
| - if: steps.filter.outputs.code == 'true' | ||
| uses: astral-sh/setup-uv@v5 |
Unblocks #426 (and any future docs-only PR).
Problem
required_status_checksruleset on main requirespytest (3.12)andpytest (3.13)to pass. The CI workflow'spaths-ignore: ['docs/**', '**/*.md', ...]causes the entire workflow to skip on docs-only PRs, so those checks never report — main rejects the FF push with2 of 5 required status checks expected.Caught while attempting to land #426 (README v1.7 row → shipped) as part of the v2.0 reproducibility-cut sequence.
Fix
Per the existing TODO note in
.github/workflows/ci.yml: replace the workflow-levelpaths-ignorewith an in-jobdorny/paths-filter@v3step. The job always runs (so the required check always reports a status) but the install + test steps are conditional oncodepaths having actually changed. Docs-only PRs short-circuit and report a green check.Test plan
pytest (3.12)andpytest (3.13).Refs
Summary by Sourcery
Ensure CI pytest jobs always run and report status while short-circuiting on non-code changes.
CI: