Skip to content

ci: switch CI to paths-filter so pytest reports on docs-only PRs - #446

Merged
robotrocketscience merged 1 commit into
mainfrom
ci/paths-filter-always-report-pytest
May 5, 2026
Merged

ci: switch CI to paths-filter so pytest reports on docs-only PRs#446
robotrocketscience merged 1 commit into
mainfrom
ci/paths-filter-always-report-pytest

Conversation

@yoshi280

@yoshi280 yoshi280 commented May 5, 2026

Copy link
Copy Markdown
Collaborator

Unblocks #426 (and any future docs-only PR).

Problem

required_status_checks ruleset on main requires pytest (3.12) and pytest (3.13) to pass. The CI workflow's paths-ignore: ['docs/**', '**/*.md', ...] causes the entire workflow to skip on docs-only PRs, so those checks never report — main rejects the FF push with 2 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-level paths-ignore with an in-job dorny/paths-filter@v3 step. The job always runs (so the required check always reports a status) but the install + test steps are conditional on code paths having actually changed. Docs-only PRs short-circuit and report a green check.

Test plan

Refs

Summary by Sourcery

Ensure CI pytest jobs always run and report status while short-circuiting on non-code changes.

CI:

  • Replace workflow-level paths-ignore with in-job dorny/paths-filter usage to detect code vs non-code changes.
  • Gate environment setup and pytest steps on code path changes so docs-only PRs report a passing required check without running tests.

… 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.
@sourcery-ai

sourcery-ai Bot commented May 5, 2026

Copy link
Copy Markdown

Reviewer's Guide

Switches 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 pytest

sequenceDiagram
    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
Loading

File-Level Changes

Change Details Files
Ensure CI workflow always runs while conditionally gating pytest setup and execution on code-path changes using dorny/paths-filter.
  • Remove pull_request.paths-ignore block that previously skipped the CI workflow entirely for docs-only changes.
  • Add dorny/paths-filter@v3 step to detect changes in code-related paths (src, tests, pyproject.toml, uv.lock, ci workflow).
  • Gate setup-uv, dependency installation, and pytest commands behind an if: steps.filter.outputs.code == 'true' condition.
  • Add final no-op echo step that runs when no code paths changed to mark docs-only PRs as passing while avoiding pytest execution.
  • Update workflow comments to document the new behavior and its relationship to required pytest status checks and referenced issues.
.github/workflows/ci.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented May 5, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@yoshi280 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 20 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a56fae14-9c07-45d8-93b3-56bfc0c3c386

📥 Commits

Reviewing files that changed from the base of the PR and between a3e4940 and e6f0290.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/paths-filter-always-report-pytest

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 and usage tips.

Comment thread .github/workflows/ci.yml
egress-policy: audit
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- uses: dorny/paths-filter@v3
Comment thread .github/workflows/ci.yml
- 'uv.lock'
- '.github/workflows/ci.yml'
- if: steps.filter.outputs.code == 'true'
uses: astral-sh/setup-uv@v5
Comment thread .github/workflows/ci.yml
egress-policy: audit
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- uses: dorny/paths-filter@v3
Comment thread .github/workflows/ci.yml
- 'uv.lock'
- '.github/workflows/ci.yml'
- if: steps.filter.outputs.code == 'true'
uses: astral-sh/setup-uv@v5

@sourcery-ai sourcery-ai 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.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@robotrocketscience
robotrocketscience merged commit e6f0290 into main May 5, 2026
19 of 28 checks passed
@robotrocketscience
robotrocketscience deleted the ci/paths-filter-always-report-pytest branch May 5, 2026 17:25
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.

3 participants