Skip to content

fix: validate live PR title on workflow reruns - #234

Merged
martin-kolinek merged 2 commits into
mainfrom
fix/live-pr-title-reruns
Oct 8, 2026
Merged

martin-kolinek merged 2 commits into
mainfrom
fix/live-pr-title-reruns

Conversation

@martin-kolinek

Copy link
Copy Markdown
Collaborator

🤖 Resolves the current pull request title through the GitHub API immediately before each pr-fast matrix leg runs.

Workflow reruns retain the original pull_request event 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::github
  • cargo test --quiet -p cargo-anvil --test schemas
  • cargo test --quiet -p cargo-anvil --test snapshots
  • cargo run --quiet -p cargo-anvil -- anvil --dry-run
  • just anvil-fmt --fix

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>
Comment thread crates/cargo-anvil/templates/github/pr-impl-workflow.yml
Comment thread crates/cargo-anvil/docs/design/github.md
Comment thread crates/cargo-anvil/docs/design/github.md Outdated
Comment thread crates/cargo-anvil/docs/design/github.md Outdated
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-commenter

Codecov Comments Bot (codecov-commenter) commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.9%. Comparing base (3cd0306) to head (e859bdb).
⚠️ Report is 2 commits behind head on main.

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           
Flag Coverage Δ
linux 98.9% <ø> (ø)
linux-arm 98.9% <ø> (-0.1%) ⬇️
scheduled ?
windows 98.8% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@martin-kolinek
martin-kolinek marked this pull request as ready for review October 8, 2026 12:06
Copilot AI balanced review requested due to automatic review settings October 8, 2026 12:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

@martintmk martintmk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted by an AI agent

Automated fast-path approval at e859bdb: eligibility checks passed. Not a full PR review.

@martin-kolinek
martin-kolinek merged commit b0fb0d1 into main Oct 8, 2026
29 checks passed
@martin-kolinek
martin-kolinek deleted the fix/live-pr-title-reruns branch October 8, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants