fix(api): refuse state="merged" for issues with the documented message - #33
Merged
Merged
Conversation
fetch_issues shared the PR state validator, which accepts "merged". Issues have no merged state, so the value reached `gh issue list --state merged` and came back as a bare gh error instead of "state must be open|closed|all". The validator now takes the allowed set: issues use open|closed|all, and PRs keep all four. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LSRkzcPyaDrKSY7geFuGr3
There was a problem hiding this comment.
QA panel review — PASS
code-review · head f9e19bd1ce88 · formal
Low-risk change: _norm_state is parameterized with an allowed tuple so that fetch_issues rejects "merged" while fetch_prs retains it. The verifier confirmed the logic is correct, both callers are in the same file with no other call sites, and tests cover both the rejection and preserved paths. No defects found; the panel's empty findings array is confirmed.
No findings — the review came back clean.
findings JSON (machine-readable)
[]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the one finding on #32. It was out of scope for that PR, which didn't touch
api.py.Bug:
fetch_issuesused the PR state validator, which accepts"merged". Issues have no merged state, sostate="merged"passed validation and reachedgh issue list --state merged. It came back as a bare gh error instead of the documentedstate must be open|closed|all.Fix:
_norm_statenow takes the allowed set. Issues useopen|closed|all; PRs keep all four (default), sofetch_prsis unchanged.Tests
fetch_issues(state="merged")returns the validation error and never callsgh.test_fetch_prs_still_accepts_mergedcovers the PR path.api.py, the issue assertion fails.ruff check/ruff format --checkare clean.No version bump. This ships with the next release.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LSRkzcPyaDrKSY7geFuGr3