ci: skip Python quality checks for docs-only PRs

Đang mở
#1,239 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
22/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
github-actions
Lĩnh vực
ci-cd

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
1.8k
Fork
161
Merge trung bình
4 ngày 3 giờ
Pull request đã merge (30 ngày)
45

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của generative-computing/mellea

Tất cả issue của generative-computing/mellea

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.