Skip to content

Commit 7666e87

Browse files
committed
Merge remote-tracking branch 'upstream/main' into 1fannnw/limit-parameter-types-2e62cbd8
Signed-off-by: 1fanwang <1fannnw@gmail.com>
2 parents c3fa51d + 5a44905 commit 7666e87

3 files changed

Lines changed: 37 additions & 0 deletions

File tree

‎ci/scripts/check_asf_yaml_status_checks.py‎

100644100755
File mode changed.

‎dev/rust_lint.sh‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,23 @@ done
8888
SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"
8989
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9090

91+
# `ci/scripts/check_asf_yaml_status_checks.py` runs with `python3` from PATH
92+
# and imports PyYAML. Report a missing prerequisite before any tool is
93+
# installed or any formatter runs, and point at `uv run`, which sets up the
94+
# Python dependencies from the uv workspace.
95+
ensure_python_with_yaml() {
96+
if ! command -v python3 &> /dev/null; then
97+
echo "[${SCRIPT_NAME}] python3 was not found on PATH. Please run the suite through uv, which provides Python and its packages: uv run ./dev/rust_lint.sh" >&2
98+
exit 1
99+
fi
100+
if ! python3 -c 'import yaml' &> /dev/null; then
101+
echo "[${SCRIPT_NAME}] PyYAML is not installed for $(command -v python3). Please run the suite through uv, which installs it: uv run ./dev/rust_lint.sh" >&2
102+
exit 1
103+
fi
104+
}
105+
106+
ensure_python_with_yaml
107+
91108
# Load the tool versions shared with CI (for example, LYCHEE_VERSION).
92109
source "${SCRIPT_DIR}/../ci/scripts/utils/tool_versions.sh"
93110

@@ -114,6 +131,7 @@ declare -a WRITE_STEPS=(
114131

115132
declare -a READONLY_STEPS=(
116133
"ci/scripts/check_no_cargo_install_in_workflows.sh|false"
134+
"ci/scripts/check_asf_yaml_status_checks.py|false"
117135
"ci/scripts/markdown_link_check.sh|false"
118136
"ci/scripts/rust_docs.sh|false"
119137
)

‎docs/source/contributor-guide/testing.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,25 @@ Rust doc comments are validated by rustdoc in CI and can be checked locally with
220220
bash ci/scripts/rust_docs.sh
221221
```
222222

223+
## ASF Status Check Validation
224+
225+
`ci/scripts/check_asf_yaml_status_checks.py` checks that every required status
226+
check in `.asf.yaml` matches a job in `.github/workflows`. `./dev/rust_lint.sh`
227+
runs it and needs `python3` with [PyYAML]. The [uv] workspace provides both:
228+
229+
```shell
230+
uv run ./dev/rust_lint.sh
231+
```
232+
233+
To run the check on its own:
234+
235+
```shell
236+
uv run python3 ci/scripts/check_asf_yaml_status_checks.py
237+
```
238+
239+
[pyyaml]: https://pypi.org/project/PyYAML/
240+
[uv]: https://docs.astral.sh/uv/
241+
223242
## Benchmarks
224243

225244
### Criterion Benchmarks

0 commit comments

Comments
 (0)