fix: handle state=all in search query build with labels#13525
Open
ShahabAhmed01 wants to merge 2 commits into
Open
fix: handle state=all in search query build with labels#13525ShahabAhmed01 wants to merge 2 commits into
ShahabAhmed01 wants to merge 2 commits into
Conversation
Check Content-Type header to detect non-zipped artifacts and write them directly to destination without attempting to unzip. This fixes the issue where GitHub Actions now supports uploading artifacts with archive: false. Fixes cli#13012
|
Thanks for your pull request! Unfortunately, it doesn't meet the requirements for review:
Please update your PR to address the above. This PR will be automatically closed in 4 days if these requirements are not met. Full contribution requirements
|
When combining --state all with --label, the search query was not including any state qualifier, which caused the search API to return no results. This fix explicitly handles the all state case by not setting a state qualifier, allowing the search API to search all states by default. ## Changes - Modified pkg/cmd/pr/shared/params.go to handle the all state case - When state is all, we don't set a state qualifier in the search query - This allows the GitHub search API to return results across all states (open, closed, merged) ## Testing - Tested with gh pr list --state all --label <label> - Verified that results are now returned for all states when combined with label filter Fixes cli#5511
eda1d2b to
d3191dc
Compare
Author
|
Hi maintainers! I noticed the bot is warning that issue #5511 lacks the help wanted label. I've already implemented the bug fix here, could someone kindly apply the label so the PR can be reviewed? |
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.
When combining --state all with --label, the search query was not including any state qualifier, which caused the search API to return no results.
This fix explicitly handles the all state case by not setting a state qualifier, allowing the search API to search all states by default.
Root Cause
In SearchQueryBuild (pkg/cmd/pr/shared/params.go), the switch statement only handled "open", "closed", and "merged" states. When state was "all", both state and is remained empty strings, which caused the search query to not include any state qualifier.
Fix
Added a case for "all" in the switch statement. When state is "all", we don't set a state qualifier, which allows the search API to search all states by default.
Testing
Fixes #5511