ci: skip Python quality checks for docs-only PRs

Aperta
#1,239 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
github-actions
Ambito
ci-cd

Direzione di ricerca

Start with the workflow files: ci.yml calls the reusable quality.yml, and the required check names come from that call structure. Compare Option B (a paths-filter step inside quality.yml) with the sibling-job approach, and confirm how GitHub reports skipped required checks. Done means docs-only PRs skip the expensive steps while code-checks / quality still reports success, which the maintainers must agree on first.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement p2

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.

Lingua principale
Python
Stelle
1.8k
Fork
161
Merge medio
4g 3h
PR unite (30g)
45

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di generative-computing/mellea

Tutte le issue di generative-computing/mellea

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.