chore(hooks): close hawkeye pin/coverage gaps flagged on #474 - #475
jussielo-amd wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused hook and regression-test changes correctly close the described coverage gaps.
Review effort: Balanced
Findings: None
What changed in this PR
Adds safeguards to keep local and CI hawkeye license-header checks aligned.
Changes:
- Adds a test enforcing consistent hawkeye version pins.
- Runs the local license-header hook for Markdown changes.
| File | Description |
|---|---|
xtask/src/main.rs |
Registers the pin-test module. |
xtask/src/hawkeye_pin.rs |
Verifies documented and CI hawkeye versions match. |
.pre-commit-config.yaml |
Includes Markdown in license-header hook triggers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Guard CONTRIBUTING.md's hawkeye@7.0.0 pin against drifting from ci.yml's HAWKEYE_VERSION (mirrors the existing cargo-about pin guard in xtask/src/tpn.rs, as a test-only module since hawkeye has no xtask subcommand to host a production constant). Also widen the local license-headers hook's types_or to include markdown, so a markdown-only commit no longer skips the local hook that CI's hawkeye check already enforces against **/*.md. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
9fe963a to
4b87dcf
Compare
|
🔴 Automated review · pr-review-watcher · 4b87dcf This automation never files a GitHub approval, so no approving review will SummaryThe PR does two things. It adds a test-only xtask module that fails if the hawkeye version in CONTRIBUTING.md and in CI on this head: these checks had not reported when this review ran — E2E tests (MI300X), E2E tests (MI350P), E2E tests (Strix Halo, Ubuntu), Sphinx docs build (-W), Skill checks (skillscope). No check had failed. This review does not claim CI passed. 🚫 Blocking (must fix before merge)None. Non-blocking
|
The guard's whole-file substring match on ci.yml could false-pass on a stray mention elsewhere in the file (a comment, another job), and was unanchored, so a suffixed version (v7.0.0-rc1) would still satisfy a check meant for v7.0.0. Extract the installed version from the license-headers job's env mapping instead, scoped and anchored, and derive the CONTRIBUTING.md assertion from it directly rather than duplicating the version into a third constant. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
|
Addressing the non-blocking findings: Fixed in 6764859 (the three Not changed, acknowledged as out of scope for this PR:
|
job_block's marker search is \n-literal. A Windows checkout with core.autocrlf can hand back \r\n even though the repo standardises on LF, which made the previous commit's extraction panic with "workflow defines job `license-headers`" on windows-build-and-test. Normalize the same way workflow_contract.rs's read_workflow already does. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
Summary
xtask/src/hawkeye_pin.rs) guarding that CONTRIBUTING.md'shawkeye@7.0.0install instruction andci.yml'sHAWKEYE_VERSIONnever silently drift apart.license-headerspre-commit hook'stypes_orto includemarkdown, so a markdown-only commit no longer skips the local safety net that CI's hawkeye check already enforces against**/*.md.Why
Follow-up to two non-blocking items an automated review surfaced on #474 and verified as real but out of scope for that docs-only PR:
hawkeye@7.0.0pin had nothing tying it to CI's pin, unlike the analogouscargo-aboutpin which already has this guard inxtask/src/tpn.rs.licenserc.tomldoes, so a markdown-only change passed locally without actually being checked.Non-obvious decisions
xtask/src/hawkeye_pin.rs), notxtask/src/tpn.rs: unlikecargo-about, hawkeye has nocargo xtasksubcommand to host a productionconst, so the whole file is test-only (#[cfg(test)]), following the existingworkflow_contract.rsprecedent instead.main) since the test's assertion depends on text docs(contributing): note hawkeye install for license-header hook #474 introduces.Test plan
cargo test -p xtask hawkeye_pinpasses; manually verified it fails when the pinned constant is changed, then reverted.cargo clippy --workspace --all-targets --exclude e2e-cucumber -- -D warningsandcargo fmt --all --checkclean.prek run license-headers --files README.mdconfirms the hook now fires on markdown (positive control);prek run license-headers --files Cargo.tomlconfirms it still skips non-matching types (negative control).prek run --all-files license-headerspasses — no existing markdown file regresses.prek run --hook-stage pre-commit license-headersto confirm the hook actually triggers end-to-end for a markdown-only commit, then reverted the edit.