Repository navigation
skills(ci-fix): dedup against recently closed fix/ci-* PRs - #369
Conversation
When a maintainer closes a workaround with a rejection rationale, the next CI failure re-runs ci-fix and re-derives the same workaround. Extend Step 1 to scan closed bot-authored fix/ci-* PRs from the last 14 days and shape-match by failure diagnostic in the PR body, exiting silently when the prior PR was rejected. Codifies the two gotchas from #360: closed-state needs the head:fix/ci- search qualifier rather than --head, and --json must include body. Fixes #360.
tend-agent
left a comment
There was a problem hiding this comment.
One inline suggestion on the first gotcha — the technical claim about --head is empirically incorrect (verified with GH_DEBUG=api). The recipe itself works; only the explanation needs correction.
|
|
||
| Two gotchas: | ||
|
|
||
| - For closed-state, use the `head:fix/ci-` **search qualifier**, not `--head` — `--head` filters client-side and is ignored by the search API path. `in:head` is silently dropped and falls back to default-field text matching. |
There was a problem hiding this comment.
The claim that --head filters client-side / is ignored by the search-API path is empirically incorrect. Running GH_DEBUG=api gh pr list --state closed --author tend-agent --head fix/ci- shows gh translates the flag to head:fix/ci- in the GraphQL search query (q: "author:tend-agent head:fix/ci- repo:max-sixty/tend state:closed type:pr") and returns the same row count as --search "head:fix/ci-". So --head works fine for closed state.
The genuinely useful gotcha (and the one #360 raised) is in:head vs head: — keep that, drop the inaccurate --head framing:
| - For closed-state, use the `head:fix/ci-` **search qualifier**, not `--head` — `--head` filters client-side and is ignored by the search API path. `in:head` is silently dropped and falls back to default-field text matching. | |
| - Use the `head:fix/ci-` **search qualifier** (or `--head fix/ci-` — gh translates it to the same query). Don't use `in:head` — that's silently dropped and falls back to default-field text matching. |
There was a problem hiding this comment.
Verified and applied in 60d8417. GH_DEBUG=api confirms --head fix/ci- becomes q: "... head:fix/ci- ..." in the GraphQL search query — same row count as --search "head:fix/ci-". Reworded the gotcha to keep the real in:head trap and drop the inaccurate --head framing.
Verified with GH_DEBUG=api: gh pr list --head fix/ci- emits q: "... head:fix/ci- ..." in the GraphQL search query. The genuine gotcha is in:head silently falling back to default-field text matching.
Fixes #360.
Extends the bundled
ci-fixskill's existing-fix dedup (Step 1) to also scan recently closed bot-authoredfix/ci-*PRs, so a maintainer's rejection rationale ("won't fix", "fix upstream") isn't ignored on the next failure of the same root cause.The new query uses the
head:fix/ci-search qualifier (not--head, which is ignored by the search API path) and requestsbodyin--jsonso the prior diagnostic is available for shape-matching. Both gotchas are codified in the skill body.Test plan
uv run pytest).ci-fixinvocation that hits a recently rejected workaround.