Repository navigation
fix(ci): run workspace checks on plugins and ai-tutors - #2207
Conversation
The ruff, ruff-format and mypy workspace hooks filtered on `tools/` paths only, so a pull request that changed Python under `plugins/` or `ai-tutors/` skipped all three while `main` still checked them. That is how the formatting and typing break in apache#2199 reached `main`. Extend the shared filter to the two members and pin it with a test that runs every member path through each hook's pattern. Generated-by: OpenCode v2.3.2 (DeepSeek V4.1 Flash 1017)
There was a problem hiding this comment.
@Anurag-S1ngh, thanks for the PR.
Reading the patterns straight out of .pre-commit-config.yaml in the new test is a good way to stop this from regressing quietly.
Giving all three hooks the same filter keeps them from drifting apart again.
It also helps that the PR body says the Markdown-only skip is deliberate, so nobody has to guess.
Should change
- The inline comment on
.pre-commit-config.yaml:691.
Smaller points (non-blocking)
- Two small suggestions inline on
tools/dev/tests/test_workspace_hook_filters.py(lines 24 and 59).
Thanks again for chasing this down.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. After you've
addressed the points above and pushed an update, an Apache Magpie
maintainer — a real person — will take the next look
at the PR. The findings cite the project's review criteria;
if you think one of them is mis-applied, please reply on the
PR and a maintainer will weigh in.More on how Apache Magpie handles maintainer review:
Contributing guide.
The previous filter only recognised `src/`, `tests/` and a top-level `pyproject.toml` under a `tools/` member, and only a top-level `pyproject.toml` under `plugins/`. Scripts at a member root, such as `tools/dev/check-doc-sync.py`, and nested member configs under `plugins/magpie-*/tools/` still skipped ruff and mypy on a pull request. Match Python and `pyproject.toml` anywhere under the three trees, the same scope `workspace-pytest` already uses. Derive the test paths from `git ls-files` filtered by the workspace members so a new member or a new layout inside one cannot slip past, and pin the deliberate Markdown-only skip with a negative case.
|
Pushed ddffea3.
|
KatalKavya96
left a comment
There was a problem hiding this comment.
@Anurag-S1ngh, thanks for the quick and thorough follow-up, especially building the test from git ls-files instead of examples.
I re-checked ddffea3a against main's tracked files: the old filter skips 62 .py / pyproject.toml files under workspace members (your count), the new one skips none, and the SKILL.md negative case holds. All three earlier threads are addressed and resolved.
Generated by Claude Code
Summary
workspace-ruff-check,workspace-ruff-formatandworkspace-mypyhooks filtered ontools/paths only, so Python underplugins/andai-tutors/skipped all three on a pull request whilemainstill checked it.Type of change
prek, workflows, validators)Test plan
tools/dev/tests/test_workspace_hook_filters.pyfailed on the old filter and passes on the new one.prek run workspace-ruff-check workspace-ruff-format workspace-mypy --files plugins/magpie-setup/skills/status/scripts/collect_status.pyfires all three hooks and passes.prek run --all-files --skip workspace-pytestpasses.prek run workspace-pytest --from-ref upstream/main --to-ref HEADpasses.RFC-AI-0004 compliance
No principle touched: the hooks already existed, and this only widens when they run.
Linked issues
Closes #2201
Notes for reviewers
The filter now matches
^((tools|plugins|ai-tutors)/(.*\.py|.*pyproject\.toml)|pyproject\.toml|tools/dev/run-workspace-check\.sh)$, so Python andpyproject.tomlanywhere under the three trees fire the hooks. Markdown-only changes in those trees still skip the static checks, which is deliberate. The test derives its paths fromgit ls-filesfiltered by the workspace members, so a new member or a new layout inside one is covered without edits.Generative AI disclosure: written with help from OpenCode (DeepSeek V4.1 Flash 1017). I have read every line of the diff and run the checks.