Skip to content

Fix infinite loop in gh release list --limit 0#13097

Merged
babakks merged 1 commit intocli:trunkfrom
Bahtya:fix-limit-final
Apr 4, 2026
Merged

Fix infinite loop in gh release list --limit 0#13097
babakks merged 1 commit intocli:trunkfrom
Bahtya:fix-limit-final

Conversation

@Bahtya
Copy link
Copy Markdown

@Bahtya Bahtya commented Apr 4, 2026

Problem

gh release list --limit 0 loops infinitely, hitting the GraphQL API without terminating. All other list subcommands correctly reject --limit 0:

gh issue list --limit 0   → invalid limit: 0
gh pr list --limit 0      → invalid value for --limit: 0
gh repo list --limit 0    → invalid limit: 0
gh release list --limit 0 → 💥 infinite loop

Fix

Add limit validation (< 1 check) in the release list command, consistent with other subcommands. Includes a test.

Closes #13078

@Bahtya Bahtya requested a review from a team as a code owner April 4, 2026 10:11
@Bahtya Bahtya requested a review from BagToad April 4, 2026 10:11
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

Thanks for your pull request! Unfortunately, it doesn't meet the minimum requirements for review:

  • None of the referenced issues have the help wanted label

Please update your PR to address the above. Requirements:

  1. Include a detailed description of what this PR does
  2. Link to an issue with the help wanted label (use Fixes #123 or Closes #123 if it resolves the issue)

This PR will be automatically closed in 7 days if these requirements are not met.

@github-actions github-actions bot added external pull request originating outside of the CLI core team needs-triage needs to be reviewed labels Apr 4, 2026
Other list subcommands correctly reject --limit 0 but 'release list'
does not validate the limit, causing an infinite loop.

Add validation consistent with other subcommands and a test.

Closes #13078
@babakks babakks requested review from babakks and removed request for BagToad April 4, 2026 10:14
Copy link
Copy Markdown
Member

@babakks babakks left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the PR, @Bahtya! 🙏

@babakks
Copy link
Copy Markdown
Member

babakks commented Apr 4, 2026

@Bahtya, although the underlying issues is not marked as help wanted Contributions welcome , I'm merging this PR as this is a simple fix and I would have gone the same way for the fix.

Just as a reminder, please do not open PRs for such issues, as we might have no choice but to close them.

@babakks babakks merged commit d0558fc into cli:trunk Apr 4, 2026
18 checks passed
@babakks babakks removed the needs-triage needs to be reviewed label Apr 4, 2026
@t72053166-eng t72053166-eng mentioned this pull request Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team unmet-requirements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh release list --limit 0 loops infinitely

2 participants