dev: include ASF status checks in the local lint suite - #25313
Open
kumarUjjawal wants to merge 2 commits into
Open
kumarUjjawal wants to merge 2 commits into
kumarUjjawal wants to merge 2 commits into
Conversation
`dev/rust_lint.sh` now runs `ci/scripts/check_asf_yaml_status_checks.py` as a read-only step, after the workflow install check and before the Markdown link check. The validator compares the required status names in `.asf.yaml` with the jobs in `.github/workflows`, so a renamed job that still has a stale requirement fails locally instead of leaving a pull request waiting for a status that never arrives. The validator runs with `python3` from PATH and imports PyYAML. The runner checks both before it installs any tool or runs any formatter, and reports a distinct, actionable error for each missing prerequisite. It does not install Python packages. Help output stays independent of these checks. The validator becomes executable so the runner can invoke it directly, as it does for every other registered script. Its body, `.asf.yaml`, and the GitHub workflow are unchanged, and `--write` never reaches it. Partial progress on apache#21048.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25313 +/- ##
========================================
Coverage 81.91% 81.92%
========================================
Files 1134 1134
Lines 425655 425990 +335
Branches 425655 425990 +335
========================================
+ Hits 348679 348989 +310
Misses 56300 56300
- Partials 20676 20701 +25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2010YOUY01
approved these changes
Sep 15, 2026
2010YOUY01
left a comment
Contributor
There was a problem hiding this comment.
Thank you. I've tested it locally and it works well.
| exit 1 | ||
| fi | ||
| if ! python3 -c 'import yaml' &> /dev/null; then | ||
| echo "[${SCRIPT_NAME}] PyYAML is not installed for $(command -v python3). Install it in your active Python environment with: python3 -m pip install pyyaml" >&2 |
Contributor
There was a problem hiding this comment.
nit: the error message could say something like 'please run through uv'
Now internal python scripts should be run through uv package manager, so
# Get dependency setup automatically
uv run ./dev/rust_lint.sh
Reference: #20414
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
.asf.yamllists the GitHub Actions jobs that must pass before a PR can merge. If a job is renamed and.asf.yamlstill requires the old name, PRs wait for a status that never arrives. CI runsci/scripts/check_asf_yaml_status_checks.pyindev.ymlto catch this, butdev/rust_lint.shdoes not. A contributor can pass the local lint suite and then see the failure only in CI. This PR adds the existing validator to the local suite.What changes are included in this PR?
dev/rust_lint.shrunsci/scripts/check_asf_yaml_status_checks.pyas a read-only step, after the workflow install check and before the Markdown link check. The--writeand--allow-dirtyflags never reach it.python3onPATHwith PyYAML installed. It checks both after argument parsing and before any tool install or formatter, and it reports a distinct error for each missing prerequisite. It does not install Python packages. Help output does not run these checks.ci/scripts/check_asf_yaml_status_checks.pybecomes executable, because the runner invokes each registered script directly. The script body,.asf.yaml, and the GitHub workflow do not change.docs/source/contributor-guide/testing.mddocuments the purpose of the check, the Python setup, the standalone command, and the local lint integration.What is the testing strategy for this PR?
python3 ci/scripts/check_asf_yaml_status_checks.pyand through direct invocation, with Python 3.14.7 and PyYAML 6.0.3.python3and a missing PyYAML each stop the suite with their own error before any tool install or formatter. Help output skips the checks. A validator failure stops the later steps..asf.yaml:./dev/rust_lint.shfails with the validator diagnostic before the link check, and passes again after the file is restored../dev/rust_lint.shpasses on this branch.Are there any user-facing changes?
No. The local lint suite gains the check and needs Python 3 with PyYAML. CI is unchanged.
🤖 Generated with Claude Code