Repository navigation
skills(running-tend): exit silently when maintainer rejected the fix - #2499
worktrunk-bot wants to merge 2 commits into
Conversation
The bundled `tend-ci-runner:ci-fix` open-PR dedup check misses closed PRs, so a rejected-by-maintainer fix can be re-derived on the next push that hits the same failure. Add a closed-state lookup and a "Maintainer-rejected workaround" classification so ci-fix exits silently instead of re-proposing rejected workarounds. Triggered by recurrence of the cargo-affected runner-shim failure already covered by closed PR #2493 ("we'll fix upstream"). Co-Authored-By: Claude <[email protected]>
worktrunk-bot
left a comment
There was a problem hiding this comment.
Two issues in the new lookup snippet, surfaced by running it: --search "fix/ci- in:head" doesn't constrain to fix/ci-* branches (in:head isn't a valid qualifier — it's silently ignored, so the search becomes default-field text matching and returns nightly/daily/hourly PRs that happen to contain "fix" or "ci"), and the --json list omits body, which is where the failure diagnostic lives. The prose tells the bot to "match by failure shape (the diagnostic snippet)", but comments only carries the maintainer's rejection rationale — without body, there's nothing to match against.
Verified locally: head:fix/ci- returns only fix/ci-* branches, and body is a valid --json field on gh pr list.
| gh pr list --state closed --author "$BOT_LOGIN" --search "fix/ci- in:head" \ | ||
| --json number,title,closedAt,comments,headRefName \ |
There was a problem hiding this comment.
in:head is not a valid GitHub search qualifier — without head:, the search degrades to default-field text matching and returns unrelated PRs (nightly/*, daily/*, hourly/*) that happen to mention "fix" or "ci". And --json is missing body, which is the only place the failure diagnostic appears (the maintainer's rejection rationale lives in comments, but the failure-shape match needs the body).
| gh pr list --state closed --author "$BOT_LOGIN" --search "fix/ci- in:head" \ | |
| --json number,title,closedAt,comments,headRefName \ | |
| gh pr list --state closed --author "$BOT_LOGIN" --search "head:fix/ci-" \ | |
| --json number,title,body,closedAt,comments,headRefName \ |
There was a problem hiding this comment.
Applied in 2452fc56 — both the qualifier change and body are in. I kept closedAt ahead of body rather than the literal field order in your suggestion; functionally equivalent. Verified the recipe end-to-end: returns fix/ci-* PRs only (including the rejected #2493) with non-empty bodies for shape-matching.
Apply review feedback on the new closed-PR lookup. Two issues surfaced when the snippet was actually run: - `--search "fix/ci- in:head"` doesn't constrain to fix/ci-* branches. `in:head` isn't a valid issues/PRs search qualifier and is silently ignored, so the search degrades to default-field text matching and pulls in nightly/daily/hourly PRs whose titles contain "fix" or "ci". Use `head:fix/ci-` instead. - `--json` omitted `body`, where the failure diagnostic from `gh run view --log-failed` is embedded in the PR description. Without `body` there's nothing to shape-match against; `comments` only carries the maintainer's rejection rationale. Add `body`. Verified locally: `head:fix/ci-` returns only fix/ci-* branches and the body field carries the PR description, including the run-link block.
| - **Maintainer-rejected workaround** — if a recent same-failure fix PR was | ||
| closed by a maintainer with rejection rationale (e.g., "we'll fix | ||
| upstream", "won't fix"), do **not** open another PR. The bundled | ||
| `tend-ci-runner:ci-fix` open-PR check (`gh pr list --state open --head |
There was a problem hiding this comment.
I think we should close this and instead log an issue upstream to include recently closed PRs
There was a problem hiding this comment.
Agreed — filed upstream as max-sixty/tend#360 and closing this.
|
Closing per @max-sixty's review — repo-local override deferred in favor of fixing the dedup at the source. Tracked upstream as |
Problem
collect affected coveragefails on every push to main with the samecargo-affected runner-shim … target-name fallback ambiguouserror. PR #2493 proposed a workaround (renaming the helper-crate dummy test files); @max-sixty closed it less than 8 hours later with "we'll fix upstream".The next push (
90d5cfcb) hit the same failure and triggered ci-fix again (run 25170507538). Without guidance, the ci-fix workflow would re-derive the same workaround and re-open a near-duplicate of the rejected PR — the bundledtend-ci-runner:ci-fix"check for existing fixes" step only looks at openfix/ci-*PRs, so a closed-with-rejection PR is invisible to it.Solution
Add a fourth classification — Maintainer-rejected workaround — to the
CI Fixsection ofrunning-tend. Before classifying a failure as a real regression, do an extra closed-state lookup for recent bot fix PRs and match by failure shape (not branch name — branches encode run IDs and never repeat). If a maintainer closed a same-failure PR within the last 14 days, exit silently.This is repo-local guidance because the rejection ("we'll fix upstream") is also repo-local. The closed-PR check itself is generic enough that it might belong in the bundled
tend-ci-runner:ci-fixskill — happy to file an upstream issue against tend if @max-sixty thinks it should live there instead.Testing
Skill-only edit; no code touched.
Triggered by failed run 25170507538.