Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified ci/scripts/check_asf_yaml_status_checks.py
100644 → 100755
Empty file.
18 changes: 18 additions & 0 deletions dev/rust_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@ done
SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# `ci/scripts/check_asf_yaml_status_checks.py` runs with `python3` from PATH
# and imports PyYAML. Report a missing prerequisite before any tool is
# installed or any formatter runs, and point at `uv run`, which sets up the
# Python dependencies from the uv workspace.
ensure_python_with_yaml() {
if ! command -v python3 &> /dev/null; then
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
exit 1
fi
if ! python3 -c 'import yaml' &> /dev/null; then
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
exit 1
fi
}

ensure_python_with_yaml

# Load the tool versions shared with CI (for example, LYCHEE_VERSION).
source "${SCRIPT_DIR}/../ci/scripts/utils/tool_versions.sh"

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

declare -a READONLY_STEPS=(
"ci/scripts/check_no_cargo_install_in_workflows.sh|false"
"ci/scripts/check_asf_yaml_status_checks.py|false"
"ci/scripts/markdown_link_check.sh|false"
"ci/scripts/rust_docs.sh|false"
)
Expand Down
19 changes: 19 additions & 0 deletions docs/source/contributor-guide/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,25 @@ Rust doc comments are validated by rustdoc in CI and can be checked locally with
bash ci/scripts/rust_docs.sh
```

## ASF Status Check Validation

`ci/scripts/check_asf_yaml_status_checks.py` checks that every required status
check in `.asf.yaml` matches a job in `.github/workflows`. `./dev/rust_lint.sh`
runs it and needs `python3` with [PyYAML]. The [uv] workspace provides both:

```shell
uv run ./dev/rust_lint.sh
```

To run the check on its own:

```shell
uv run python3 ci/scripts/check_asf_yaml_status_checks.py
```

[pyyaml]: https://pypi.org/project/PyYAML/
[uv]: https://docs.astral.sh/uv/

## Benchmarks

### Criterion Benchmarks
Expand Down