Skip to content

ci: skip Python quality checks for docs-only PRs #1239

@planetf1

Description

@planetf1

Problem

ci.yml has no path filters — the full Python quality suite (~20 min × 3 matrix versions) runs on every PR, including docs-only changes to docs/, PUBLISHING.md, CONTRIBUTING_DOCS.md, etc.

For docs-only PRs the Python tests provide no value: they don't touch mellea/, cli/, or test/. This wastes ~1 hour of runner time per docs PR and slows iteration on the documentation.

Constraint

code-checks / quality (3.11/3.12/3.13) are required status checks on main. Simply adding paths-ignore to ci.yml doesn't work — if the workflow doesn't run at all, GitHub marks the required checks as "missing" and blocks merge.

What counts as "docs-only"

A PR is docs-only if it only touches:

  • docs/**
  • *.md files in the repo root (CONTRIBUTING.md, RELEASE.md, etc.)
  • tooling/docs-autogen/** ← this one is borderline: the autogen tooling affects docs output but not the Python library. Could go either way.

Changes to mellea/**, cli/**, test/**, pyproject.toml, or uv.lock always require the full quality run.

Options

Option A — paths filter + sibling pass-through job (recommended)

Add a check-changes job to ci.yml using dorny/paths-filter to detect whether src files changed. Make code-checks conditional on the output. Add a sibling code-checks-skip job (same matrix, matching job names) that runs only when code-checks is skipped and immediately exits 0.

The tricky part: the required check context is code-checks / quality (3.11) — generated from the reusable workflow call structure. The skip job must produce check names that exactly match. This requires careful naming or using the GitHub Checks API to post synthetic results.

Option B — internal skip inside quality.yml

Add a dorny/paths-filter step at the top of quality.yml and wrap all subsequent steps in if: steps.filter.outputs.src == 'true'. The job always completes (satisfying the required check) but exits early for docs-only changes after just a few seconds.

Simpler than Option A. Downsides: still spins up a runner for each matrix version; harder to read.

Option C — merge queue bypass

Use a merge queue rule that skips required checks for PRs with only docs-label or a docs-only label. Requires merge queue configuration changes.

Suggested approach

Option B is the lowest-risk change: no required check naming games, no new workflows, just an early-exit path inside the existing quality workflow. A paths-filter step at the top of quality.yml that sets run_tests=false for docs-only changesets, followed by if: env.run_tests == 'true' on the expensive steps (install deps, pull Ollama, run pytest). The pre-commit step could still run on docs changes to catch markdownlint and codespell issues — or be skipped too.

Rough time saving: docs-only PRs go from ~20 min to ~30 seconds per matrix version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions