Repository navigation
fix: validate live PR title on workflow reruns - #234
Conversation
Resolve the current pull request title through the GitHub API so rerunning an older workflow after a title correction does not reuse stale event data. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the live PR title lookup while adding bounded API retries, documenting its permission requirement, and syncing the generated catalog with current main. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #234 +/- ##
=====================================
Coverage 98.9% 98.9%
=====================================
Files 304 304
Lines 44436 44436
=====================================
Hits 43975 43975
Misses 461 461
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
The focused change preserves merge-group behavior, fails closed on lookup errors, and includes consistent tests, documentation, and generated updates.
0 open findings
What changed in this PR
Fixes stale PR-title validation on workflow reruns by fetching the current title before each pr-fast matrix leg.
Changes:
- Adds a retried GitHub API lookup that fails closed and skips merge-group runs.
- Adds regression assertions and updates generated workflows, snapshots, and checksums.
- Documents live-title resolution and permission requirements.
| File | Description |
|---|---|
justfiles/anvil/checks/pr-title.just |
Updates explanatory comments. |
crates/cargo-anvil/tests/snapshots/snapshots__local_only.snap |
Refreshes recipe-comment snapshot. |
crates/cargo-anvil/tests/snapshots/snapshots__github_backend.snap |
Captures lookup and comment changes. |
crates/cargo-anvil/tests/snapshots/snapshots__ado_backend.snap |
Refreshes recipe-comment snapshot. |
crates/cargo-anvil/templates/justfiles/anvil/checks/pr-title.just |
Documents API-based title resolution. |
crates/cargo-anvil/templates/github/pr-impl-workflow.yml |
Adds live-title lookup and output wiring. |
crates/cargo-anvil/src/anvil/artifacts/github.rs |
Adds workflow regression assertions. |
crates/cargo-anvil/docs/design/github.md |
Documents lookup behavior and permissions. |
crates/cargo-anvil/docs/design/checks.md |
Updates the title-check contract. |
.github/workflows/anvil-pr-impl.yml |
Applies the generated workflow change. |
.anvil.lock |
Refreshes generated-artifact checksums. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
🤖 Resolves the current pull request title through the GitHub API immediately before each
pr-fastmatrix leg runs.Workflow reruns retain the original
pull_requestevent payload, so a corrected title previously continued to fail when an older run was retried. The event payload now supplies only the stable PR number; title validation uses the current API value. Merge-group behavior remains unchanged, and lookup failures fail closed.Validation
cargo test --quiet -p cargo-anvil --lib anvil::artifacts::githubcargo test --quiet -p cargo-anvil --test schemascargo test --quiet -p cargo-anvil --test snapshotscargo run --quiet -p cargo-anvil -- anvil --dry-runjust anvil-fmt --fix