potiuk opened a new pull request, #419: URL: https://github.com/apache/airflow-steward/pull/419
## Why Adding a new tool required editing **five** surfaces with the same per-project shape: - 4 hook blocks in `.pre-commit-config.yaml` - 1 matrix entry in `.github/workflows/tests.yml` - A standalone `uv.lock` per tool - A duplicated `[dependency-groups] dev` in every member pyproject - And the surfaces drifted: 3 tools had pre-commit coverage with no matrix entry; the renames between pre-commit IDs and matrix names made matching brittle. This was the cause of the #417 ↔ #418 rebase conflict. ## What This refactors all of it to a **single source of truth**: the `[tool.uv.workspace] members` list in the root `pyproject.toml`. Adding a tool is now **one line**. ### 1. uv workspace - Root `pyproject.toml` declares every Python project under `tools/` as a workspace member. - The shared dev toolchain (`ruff`, `mypy`, `pytest`) lives in root `[dependency-groups] dev` — members no longer duplicate it. - 16 per-member `uv.lock` files collapse to one root `uv.lock`. Dependency drift is caught at sync time. ### 2. Driver script `tools/dev/run-workspace-check.sh` reads the workspace members list and runs the requested check in each via `uv run --directory`. **Auto-discovery**: each member's own pyproject tells the driver which checks apply: - `[tool.ruff]` present → ruff + ruff-format run - `[tool.mypy]` present → mypy runs - `[tool.pytest.ini_options]` present → pytest runs Members opt-out explicitly via `[tool.steward.checks] skip = [...]`. ### 3. Pre-commit shrinks 492 → 151 lines The ~340 lines of per-project hooks collapse to **4 workspace-level hooks** calling the driver. Adding a tool requires **zero** `.pre-commit-config.yaml` edits. ### 4. tests.yml matrix is dynamic A new `members` job emits the workspace members list as JSON; the `pytest` matrix consumes `fromJSON(needs.members.outputs.members)`. Adding a tool requires **zero** workflow edits. ### 5. One fix-along `tools/skill-evals/runner.py` had a B905 (`zip()` without `strict=`) lint error that wasn't enforced because no pre-commit ruff hook existed for skill-evals. The auto-discovery driver picks it up; added `strict=False`. ### 6. Format pass `ruff format` on `tools/skill-evals/` and `tools/spec-validator/` — they had `[tool.ruff]` configs but weren't enforced by the old hand-rolled hook list. ## Coverage delta | Check | Was | Now | |---|---|---| | pytest matrix | 9 entries | 16 (every member with `[tool.pytest.ini_options]`) | | ruff hooks | 11 tools | 13 (every member with `[tool.ruff]`) | | mypy hooks | 11 tools | 12 | New tools picked up by pytest CI: `github-body-field`, `permission-audit`, `preflight-audit`, `pr-management-stats`, `skill-evals`, `spec-status-index`, `spec-validator`. The branch-protection contract is **unchanged** — `.asf.yaml` still requires only the `tests-ok` umbrella check, which `needs:` every matrix entry regardless of count or name. ## Diff scale `+1,097 / -4,975` across 44 files. Most of the deletions are the 15 per-tool `uv.lock` files and the duplicated `dev` deps in member pyprojects. ## Test plan - [x] `prek run --all-files` — all 4 workspace hooks pass - [x] `tools/dev/run-workspace-check.sh ruff "ruff check"` — 13 members pass - [x] `tools/dev/run-workspace-check.sh ruff-format "ruff format --check"` — 13 members pass - [x] `tools/dev/run-workspace-check.sh mypy mypy` — 12 members pass - [x] `tools/dev/run-workspace-check.sh pytest "pytest -q"` — 16 members pass - [x] YAML syntax check on edited workflows - [x] `uv sync` at workspace root resolves cleanly (45 packages, 1 lock) - [ ] CI: `tests-ok` matrix expands to 16 entries; `prek` runs the 4 workspace hooks - [ ] CI: real-PR validation that branch protection still passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
