Skip to content

skills(running-tend): exit silently when maintainer rejected the fix - #2499

Closed
worktrunk-bot wants to merge 2 commits into
mainfrom
skills/ci-fix-rejected-dedup-25172647142
Closed

worktrunk-bot wants to merge 2 commits into
mainfrom
skills/ci-fix-rejected-dedup-25172647142

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Problem

collect affected coverage fails on every push to main with the same cargo-affected runner-shim … target-name fallback ambiguous error. 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 bundled tend-ci-runner:ci-fix "check for existing fixes" step only looks at open fix/ci-* PRs, so a closed-with-rejection PR is invisible to it.

Solution

Add a fourth classification — Maintainer-rejected workaround — to the CI Fix section of running-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-fix skill — 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.

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 worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

Comment thread .claude/skills/running-tend/SKILL.md Outdated
Comment on lines +105 to +106
gh pr list --state closed --author "$BOT_LOGIN" --search "fix/ci- in:head" \
--json number,title,closedAt,comments,headRefName \

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

Suggested change
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 \

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.
@worktrunk-bot

Copy link
Copy Markdown
Collaborator Author

Fixed in 2452fc56. Switched to head:fix/ci- and added body to --json. Verified end-to-end against the live API — the recipe now returns only fix/ci-* PRs (including the rejected #2493) with non-empty bodies suitable for diagnostic shape-matching.

- **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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I think we should close this and instead log an issue upstream to include recently closed PRs

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed — filed upstream as max-sixty/tend#360 and closing this.

@worktrunk-bot

Copy link
Copy Markdown
Collaborator Author

Closing per @max-sixty's review — repo-local override deferred in favor of fixing the dedup at the source. Tracked upstream as max-sixty/tend#360.

@worktrunk-bot
worktrunk-bot deleted the skills/ci-fix-rejected-dedup-25172647142 branch April 30, 2026 17:17
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.

2 participants