Skip to content

gh issue list --state all --search with OR operators searches across multiple repositories instead of current repo #11774

Closed

Description

@Tommynem

Describe the bug

When using gh issue list --state all --search with OR operators, the command incorrectly searches across multiple repositories instead of limiting the search to the current repository context.
This only happens in this exact combination, e.g. not with AND

This seems very weird and might possibly show issues I should not have access to, but I am neither able to nor interested in reverse engineering this to find out.

Affected version

gh version 2.79.0 (2025-09-08)
https://github.com/cli/cli/releases/tag/v2.79.0

Steps to reproduce the behavior

  1. Navigate to any repository directory
  2. Run: gh issue list (shows ~30 issues for me, highest 133, shown in logs below)
  3. Run: gh issue list --state all --search "gui OR architecture OR refactor OR event" --limit 20 (also works with other combinations, shown in logs below)

Expected vs actual behaviour

Expected:
Should return only issues from the current repository that match the search criteria.

Actual:

  • Returns ~1.8M total issues
  • Includes issues from other repositories with titles unrelated to current repo
  • Shows impossible duplicate issue numbers (multiple 1s, 20s, etc.)
  • Example: Issue 20 shows "Architectural: Refactor Application to Microservices Architecture" but actual repo issue 20 is "Detection of which template to use for document creation is not working"

Logs

(Edited to remove excessive whitespace from table shown in terminal)

  1. Normal output from issue listing:
    gh issue list
    Showing 30 of 36 open issues in Tommynem/VaWW
    ID TITLE ...
    133 [FEATURE] Integrate is_firm boolean into the filter menu ...
    129 [BUG] Fields highlighter uses non-existent border_color to highlight errors ...
    128 [FEATURE] Variable amounts of test data generated ...

  2. Broken command:
    gh issue list --state all --search "gui OR architecture OR refactor OR event" --limit 20
    Showing 20 of 1845031 issues in Tommynem/VaWW that match your search
    ID, TITLE, ...
    105 Architecture: Split EventHandler into domain-specific modules ...
    2 Refactor architecture ...
    1124 REF/GUI: General refactors of GUI and GUI testing ...
    ...
    1 Refactor monolithic architecture into modular components
    1 Refactor application to MVC architecture

(There are a lot of duplicates, clearly from different repos if the 1.8M entries didnt give it away)

Edit: removed hashtags from issue numbers to stop GitHub from automatically associating them with actual issues from this repo.

Activity

  1. added
    bug
    on Sep 20, 2025
  2. added
    needs-triage
    on Sep 20, 2025
  3. trishanu-init commented on Oct 4, 2025

    @trishanu-init

    Hi, I would like to work on this issue.

  4. jsoref commented on Oct 20, 2025

    @jsoref
    Contributor

    @trishanu-init please don't wait for someone to say "go ahead", just make a PR.


    Fwiw, here's my attempt at trying to help a colleague with something which appears to be this bug (note that in this directory, git remote get-url origin = https://github.com/check-spelling/check-spelling/ (or some equivalent)):

    check-spelling % GH_DEBUG=api gh issue list -S 'author:tas50 OR author:mook-as'
    [git remote -v]
    [git config --get-regexp ^remote\..*\.gh-resolved$]
    * Request at 2025-10-20 10:41:45.819231 -0400 EDT m=+0.254480126
    * Request to https://api.github.com/graphql
    > POST /graphql HTTP/1.1
    > Host: api.github.com
    > Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
    > Authorization: token ████████████████████
    > Content-Length: 125
    > Content-Type: application/json
    > Graphql-Features: merge_queue
    > Time-Zone: America/Toronto
    > User-Agent: GitHub CLI 2.82.0
    > X-Gh-Cache-Ttl: 24h0m0s
    
    {
      "query": "query SearchType_enumValues{SearchType: __type(name: \"SearchType\"){enumValues(includeDeprecated: true){name}}}"
    }
    
    < HTTP/2.0 200 OK
    < Access-Control-Allow-Origin: *
    < Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
    < Content-Security-Policy: default-src 'none'
    < Content-Type: application/json; charset=utf-8
    < Date: Mon, 20 Oct 2025 14:34:39 GMT
    < Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
    < Server: github.com
    < Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
    < Vary: Accept-Encoding, Accept, X-Requested-With
    < X-Accepted-Oauth-Scopes: repo
    < X-Content-Type-Options: nosniff
    < X-Frame-Options: deny
    < X-Github-Media-Type: github.v4; param=merge-info-preview.nebula-preview; format=json
    < X-Github-Request-Id: D60E:204970:326E26:D4E911:68F6487E
    < X-Oauth-Client-Id: 178c6fc778ccc68e1d6a
    < X-Oauth-Scopes: gist, read:org, repo, workflow, write:packages
    < X-Ratelimit-Limit: 5000
    < X-Ratelimit-Remaining: 4972
    < X-Ratelimit-Reset: 1760972872
    < X-Ratelimit-Resource: graphql
    < X-Ratelimit-Used: 28
    < X-Xss-Protection: 0
    
    {
      "data": {
        "SearchType": {
          "enumValues": [
            {
              "name": "ISSUE"
            },
            {
              "name": "ISSUE_ADVANCED"
            },
            {
              "name": "REPOSITORY"
            },
            {
              "name": "USER"
            },
            {
              "name": "DISCUSSION"
            }
          ]
        }
      }
    }
    
    * Request took 1.673625ms
    * Request at 2025-10-20 10:41:45.856573 -0400 EDT m=+0.291821626
    * Request to https://api.github.com/graphql
    > POST /graphql HTTP/1.1
    > Host: api.github.com
    > Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
    > Authorization: token ████████████████████
    > Content-Length: 754
    > Content-Type: application/json; charset=utf-8
    > Graphql-Features: merge_queue
    > Time-Zone: America/Toronto
    > User-Agent: GitHub CLI 2.82.0
    
    GraphQL query:
    fragment issue on Issue {number,title,url,state,updatedAt,labels(first:100){nodes{id,name,description,color},totalCount},stateReason}query IssueSearch($repo: String!, $owner: String!, $type: SearchType!, $limit: Int, $after: String, $query: String!) {
          repository(name: $repo, owner: $owner) {
            hasIssuesEnabled
          }
          search(type: $type, last: $limit, after: $after, query: $query) {
            issueCount
            nodes { ...issue }
            pageInfo {
              hasNextPage
              endCursor
            }
          }
        }
    GraphQL variables: {"limit":30,"owner":"check-spelling","query":"author:tas50 OR author:mook-as repo:check-spelling/check-spelling state:open type:issue","repo":"check-spelling","type":"ISSUE_ADVANCED"}
    
    < HTTP/2.0 200 OK
    < Access-Control-Allow-Origin: *
    < Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
    < Content-Security-Policy: default-src 'none'
    < Content-Type: application/json; charset=utf-8
    < Date: Mon, 20 Oct 2025 14:41:48 GMT
    < Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
    < Server: github.com
    < Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
    < Vary: Accept-Encoding, Accept, X-Requested-With
    < X-Accepted-Oauth-Scopes: repo
    < X-Content-Type-Options: nosniff
    < X-Frame-Options: deny
    < X-Github-Media-Type: github.v4; param=merge-info-preview.nebula-preview; format=json
    < X-Github-Request-Id: D6CC:2CEBFD:2E28788:C4D91D9:68F64A29
    < X-Oauth-Client-Id: 178c6fc778ccc68e1d6a
    < X-Oauth-Scopes: gist, read:org, repo, workflow, write:packages
    < X-Ratelimit-Limit: 5000
    < X-Ratelimit-Remaining: 4958
    < X-Ratelimit-Reset: 1760972872
    < X-Ratelimit-Resource: graphql
    < X-Ratelimit-Used: 42
    < X-Xss-Protection: 0
    
    {
      "data": {
        "repository": {
          "hasIssuesEnabled": true
        },
        "search": {
          "issueCount": 2461,
          "nodes": [
            {
              "number": 8701,
              "title": "Flatcar Container Linux",
              "url": "https://github.com/endoflife-date/endoflife.date/issues/8701",
              "state": "OPEN",
              "updatedAt": "2025-10-13T22:00:19Z",
              "labels": {
                "nodes": [
                  {
                    "id": "MDU6TGFiZWwyODkxMzY0NTY5",
                    "name": "request",
                    "description": "Request for a new tool or changes",
                    "color": "8701D2"
                  }
                ],
                "totalCount": 1
              },
              "stateReason": null
            },
            {
              "number": 8700,
              "title": "Scientific Linux",
              "url": "https://github.com/endoflife-date/endoflife.date/issues/8700",
              "state": "OPEN",
              "updatedAt": "2025-10-13T21:56:15Z",
              "labels": {
                "nodes": [
                  {
                    "id": "MDU6TGFiZWwyODkxMzY0NTY5",
                    "name": "request",
                    "description": "Request for a new tool or changes",
                    "color": "8701D2"
                  }
                ],
                "totalCount": 1
              },
              "stateReason": null
            },
            {
              "number": 598,
              "title": "Provider downloads fail on ubi containers",
              "url": "https://github.com/mondoohq/installer/issues/598",
              "state": "OPEN",
              "updatedAt": "2025-10-13T03:52:32Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": null
            },
            {
              "number": 6039,
              "title": "Further automate the provider version bumps",
              "url": "https://github.com/mondoohq/cnquery/issues/6039",
              "state": "OPEN",
              "updatedAt": "2025-10-10T19:00:33Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": null
            },
            {
              "number": 8650,
              "title": "[Request - Product] Bottlerocket",
              "url": "https://github.com/endoflife-date/endoflife.date/issues/8650",
              "state": "OPEN",
              "updatedAt": "2025-10-09T20:08:03Z",
              "labels": {
                "nodes": [
                  {
                    "id": "MDU6TGFiZWwyODkxMzY0NTY5",
                    "name": "request",
                    "description": "Request for a new tool or changes",
                    "color": "8701D2"
                  }
                ],
                "totalCount": 1
              },
              "stateReason": null
            },
            {
              "number": 8649,
              "title": "[Request - Product] EulerOS",
              "url": "https://github.com/endoflife-date/endoflife.date/issues/8649",
              "state": "OPEN",
              "updatedAt": "2025-10-09T20:08:00Z",
              "labels": {
                "nodes": [
                  {
                    "id": "MDU6TGFiZWwyODkxMzY0NTY5",
                    "name": "request",
                    "description": "Request for a new tool or changes",
                    "color": "8701D2"
                  }
                ],
                "totalCount": 1
              },
              "stateReason": null
            },
            {
              "number": 8644,
              "title": "[Request - Product] openEuler",
              "url": "https://github.com/endoflife-date/endoflife.date/issues/8644",
              "state": "OPEN",
              "updatedAt": "2025-10-09T20:07:57Z",
              "labels": {
                "nodes": [
                  {
                    "id": "MDU6TGFiZWwyODkxMzY0NTY5",
                    "name": "request",
                    "description": "Request for a new tool or changes",
                    "color": "8701D2"
                  }
                ],
                "totalCount": 1
              },
              "stateReason": null
            },
            {
              "number": 6010,
              "title": "network.interfaces does not properly parse gateways when using peer interfaces",
              "url": "https://github.com/mondoohq/cnquery/issues/6010",
              "state": "OPEN",
              "updatedAt": "2025-10-03T21:00:35Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": null
            },
            {
              "number": 5914,
              "title": "Update `VMware Asset Inventory Pack` to not use `esxi.host`",
              "url": "https://github.com/mondoohq/cnquery/issues/5914",
              "state": "CLOSED",
              "updatedAt": "2025-09-08T08:06:32Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": "COMPLETED"
            },
            {
              "number": 1824,
              "title": "Policy updates to deprecated fields",
              "url": "https://github.com/mondoohq/cnspec/issues/1824",
              "state": "CLOSED",
              "updatedAt": "2025-09-03T22:36:21Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": "COMPLETED"
            },
            {
              "number": 1798,
              "title": "Improve the CLI scan experience",
              "url": "https://github.com/mondoohq/cnspec/issues/1798",
              "state": "OPEN",
              "updatedAt": "2025-08-20T02:48:53Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": null
            },
            {
              "number": 1795,
              "title": "Linux Security policy remediations for backup files don't work on Debian",
              "url": "https://github.com/mondoohq/cnspec/issues/1795",
              "state": "OPEN",
              "updatedAt": "2025-08-18T23:10:27Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": null
            },
            {
              "number": 1751,
              "title": "K8s manifest discovery in GitHub repos not discovering manifests",
              "url": "https://github.com/mondoohq/cnspec/issues/1751",
              "state": "CLOSED",
              "updatedAt": "2025-08-11T04:19:22Z",
              "labels": {
                "nodes": [
                  {
                    "id": "LA_kwDOICZfr88AAAABD7L0Hg",
                    "name": "bug",
                    "description": "Something isn't working",
                    "color": "d73a4a"
                  }
                ],
                "totalCount": 1
              },
              "stateReason": "COMPLETED"
            },
            {
              "number": 5688,
              "title": "make lr/docs/stats fails",
              "url": "https://github.com/mondoohq/cnquery/issues/5688",
              "state": "CLOSED",
              "updatedAt": "2025-06-26T21:34:26Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": "COMPLETED"
            },
            {
              "number": 1708,
              "title": "Extend permissions in ms365 auto setup to allow querying devices",
              "url": "https://github.com/mondoohq/cnspec/issues/1708",
              "state": "OPEN",
              "updatedAt": "2025-07-10T22:58:12Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": null
            },
            {
              "number": 709,
              "title": "Open a PR for MQL docs when cnquery or providers ship",
              "url": "https://github.com/mondoohq/docs/issues/709",
              "state": "OPEN",
              "updatedAt": "2025-06-11T19:37:48Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": null
            },
            {
              "number": 5618,
              "title": "Panic linting policies in CI",
              "url": "https://github.com/mondoohq/cnquery/issues/5618",
              "state": "CLOSED",
              "updatedAt": "2025-06-04T16:08:50Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": "COMPLETED"
            },
            {
              "number": 5603,
              "title": "Better handle when the assumed Docker tag could not be found",
              "url": "https://github.com/mondoohq/cnquery/issues/5603",
              "state": "OPEN",
              "updatedAt": "2025-05-30T17:14:42Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": null
            },
            {
              "number": 94,
              "title": "Running as script unconditionally sets git.user and git.email",
              "url": "https://github.com/check-spelling/check-spelling/issues/94",
              "state": "OPEN",
              "updatedAt": "2025-05-28T14:38:12Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": null
            },
            {
              "number": 7537,
              "title": "[Request - Product] WinMerge",
              "url": "https://github.com/endoflife-date/endoflife.date/issues/7537",
              "state": "OPEN",
              "updatedAt": "2025-05-23T05:40:53Z",
              "labels": {
                "nodes": [
                  {
                    "id": "MDU6TGFiZWwyODkxMzY0NTY5",
                    "name": "request",
                    "description": "Request for a new tool or changes",
                    "color": "8701D2"
                  }
                ],
                "totalCount": 1
              },
              "stateReason": null
            },
            {
              "number": 7536,
              "title": "[Request - Product] VLC media player",
              "url": "https://github.com/endoflife-date/endoflife.date/issues/7536",
              "state": "OPEN",
              "updatedAt": "2025-05-23T12:01:33Z",
              "labels": {
                "nodes": [
                  {
                    "id": "MDU6TGFiZWwyODkxMzY0NTY5",
                    "name": "request",
                    "description": "Request for a new tool or changes",
                    "color": "8701D2"
                  }
                ],
                "totalCount": 1
              },
              "stateReason": null
            },
            {
              "number": 255,
              "title": "Add resource for Security Model -> SLAs",
              "url": "https://github.com/mondoohq/terraform-provider-mondoo/issues/255",
              "state": "OPEN",
              "updatedAt": "2025-05-21T23:05:04Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": null
            },
            {
              "number": 254,
              "title": "Allow configuring Security Model -> Risk Factors via TF",
              "url": "https://github.com/mondoohq/terraform-provider-mondoo/issues/254",
              "state": "OPEN",
              "updatedAt": "2025-05-21T23:04:45Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": null
            },
            {
              "number": 253,
              "title": "Add description support to mondoo_space",
              "url": "https://github.com/mondoohq/terraform-provider-mondoo/issues/253",
              "state": "CLOSED",
              "updatedAt": "2025-06-05T14:45:54Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": "COMPLETED"
            },
            {
              "number": 5524,
              "title": "Update GitHub dep to 72",
              "url": "https://github.com/mondoohq/cnquery/issues/5524",
              "state": "CLOSED",
              "updatedAt": "2025-05-30T17:44:15Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": "COMPLETED"
            },
            {
              "number": 526,
              "title": "Add additional GCP Compute Firewall checks to the Mondoo GCP Security policy",
              "url": "https://github.com/mondoohq/cnspec-policies/issues/526",
              "state": "CLOSED",
              "updatedAt": "2025-05-07T23:44:53Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": "COMPLETED"
            },
            {
              "number": 1623,
              "title": "cnspec scans still use A-F scoring",
              "url": "https://github.com/mondoohq/cnspec/issues/1623",
              "state": "CLOSED",
              "updatedAt": "2025-05-05T14:01:59Z",
              "labels": {
                "nodes": [
                  {
                    "id": "LA_kwDOICZfr88AAAABD7L0Hg",
                    "name": "bug",
                    "description": "Something isn't working",
                    "color": "d73a4a"
                  }
                ],
                "totalCount": 1
              },
              "stateReason": "COMPLETED"
            },
            {
              "number": 1621,
              "title": "cnspec not picking up a new hostname that is set",
              "url": "https://github.com/mondoohq/cnspec/issues/1621",
              "state": "CLOSED",
              "updatedAt": "2025-04-08T02:56:49Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": "COMPLETED"
            },
            {
              "number": 5418,
              "title": "GCP provider: Panic querying data that is not present",
              "url": "https://github.com/mondoohq/cnquery/issues/5418",
              "state": "OPEN",
              "updatedAt": "2025-04-05T01:27:45Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": null
            },
            {
              "number": 5402,
              "title": "Errors when Python dirs cannot be accessed during scanning",
              "url": "https://github.com/mondoohq/cnquery/issues/5402",
              "state": "CLOSED",
              "updatedAt": "2025-04-07T06:01:06Z",
              "labels": {
                "nodes": [],
                "totalCount": 0
              },
              "stateReason": "COMPLETED"
            }
          ],
          "pageInfo": {
            "hasNextPage": true,
            "endCursor": "Y3Vyc29yOjMw"
          }
        }
      }
    }
    
    * Request took 2.168761125s
    
    Showing 30 of 2461 issues in check-spelling/check-spelling that match your search
    
    ID     TITLE                                                                           LABELS   UPDATED
    #8701  Flatcar Container Linux                                                         request  about 6 days ago
    #8700  Scientific Linux                                                                request  about 6 days ago
    #598   Provider downloads fail on ubi containers                                                about 7 days ago
    #6039  Further automate the provider version bumps                                              about 9 days ago
    #8650  [Request - Product] Bottlerocket                                                request  about 10 days ago
    #8649  [Request - Product] EulerOS                                                     request  about 10 days ago
    #8644  [Request - Product] openEuler                                                   request  about 10 days ago
    #6010  network.interfaces does not properly parse gateways when using peer interfaces           about 16 days ago
    #5914  Update `VMware Asset Inventory Pack` to not use `esxi.host`                              about 1 month ago
    #1824  Policy updates to deprecated fields                                                      about 1 month ago
    #1798  Improve the CLI scan experience                                                          about 2 months ago
    #1795  Linux Security policy remediations for backup files don't work on Debian                 about 2 months ago
    #1751  K8s manifest discovery in GitHub repos not discovering manifests                bug      about 2 months ago
    #5688  make lr/docs/stats fails                                                                 about 3 months ago
    #1708  Extend permissions in ms365 auto setup to allow querying devices                         about 3 months ago
    #709   Open a PR for MQL docs when cnquery or providers ship                                    about 4 months ago
    #5618  Panic linting policies in CI                                                             about 4 months ago
    #5603  Better handle when the assumed Docker tag could not be found                             about 4 months ago
    #94    Running as script unconditionally sets git.user and git.email                            about 4 months ago
    #7537  [Request - Product] WinMerge                                                    request  about 5 months ago
    #7536  [Request - Product] VLC media player                                            request  about 5 months ago
    #255   Add resource for Security Model -> SLAs                                                  about 5 months ago
    #254   Allow configuring Security Model -> Risk Factors via TF                                  about 5 months ago
    #253   Add description support to mondoo_space                                                  about 4 months ago
    #5524  Update GitHub dep to 72                                                                  about 4 months ago
    #526   Add additional GCP Compute Firewall checks to the Mondoo GCP Security policy             about 5 months ago
    #1623  cnspec scans still use A-F scoring                                              bug      about 5 months ago
    #1621  cnspec not picking up a new hostname that is set                                         about 6 months ago
    #5418  GCP provider: Panic querying data that is not present                                    about 6 months ago
    #5402  Errors when Python dirs cannot be accessed during scanning                               about 6 months ago
    

    From my perspective, there are many bugs here:

    1. Showing 30 of 2461 issues in check-spelling/check-spelling that match your search is false -- if for any reason the results include more than one repository, the heading should not mention a repository. For the record, https://github.com/check-spelling/check-spelling/issues?q=is%3Aissue has <100 items (and https://github.com/check-spelling/check-spelling/pulls?q=is%3Apr has <10 items) collectively there are fewer than 100 items. (At least one of the two searched users is somewhat prolific across GitHub.)
    2. (unrelated to 1) When doing a search in a repository or with -R ..., unless the search text itself explicitly begs for org: or repo:, the search shouldn't extend beyond the selected repository.
    3. The user supplied portion of the query should unconditionally be wrapped in ()
  5. changed the title [-]gh issue list --state all --search with OR operators searches across multiple repositories instead of current repo[/-] [+]`gh issue list --state all --search` with `OR` operators searches across multiple repositories instead of current repo[/+] on Oct 20, 2025
  6. trishanu-init commented on Oct 21, 2025

    @trishanu-init

    @jsoref since you have linked a PR for the 1st point i will look into the rest 2 and try to resolve them, Thanks

  7. jsoref commented on Oct 21, 2025

    @jsoref
    Contributor

    @trishanu-init actually I only covered the last point. But yes, please and thanks!

  8. babakks commented on Oct 22, 2025

    @babakks
    Member

    Thanks for reporting this issue, @Tommynem! 🙏 Also thanks for your investigations, @jsoref and @trishanu-init! 🍻

    While we appreciate our community taking the initiative to help us ❤️, we also expect contributors to follow our contribution guidelines and processes. Opening a PR before an issue is fully triaged is discouraged because the expectations/requirements of changes are not yet clear (e.g. sometimes internal comms needed, or due to some reasons maintainers would decide the issue is not meant to be picked up by external contributors). These guidelines are in place because we deeply respect our community's time and efforts; opening a PR before an issue is triaged risks a contributor's time being wasted as it may not be accepted for reasonings not readily apparent to an external contributor.

    As a bit of context, since v2.79.0, gh uses the Advanced Issue Search backend for searching issues and PRs. Prior to this, there was no OR operator and therefore combining the user's search query (provided via the --search option) with the automatically-added scoping qualifiers (i.e. repo: or state:) was a correct approach. Now, it clearly needs to be fixed (See my notes below).

    As for the PR, @jsoref, I have reviewed it, and it's in the right direction. However, we still need more investigations, especially regarding more intricate/advanced queries. I'm going to close the PR since it's not going to be the complete fix we're hoping for.

    Temporary workaround

    As a temp workaround, enclosing the search query with brackets should block the unwanted mixing:

    gh issue list --search '(author:johndoe OR author:janedoe)'

    Notes on potential fix

    This is due the mixing of user search query and the auto-added scoping qualifiers. Regarding the problems @jsoref mentioned above, I believe fixing the third one is the only fix we should need. Once the scoping qualifiers are correctly added (i.e. not mixed with the rest of the final query), the results won't include hits from other repositories.

    As the advanced syntax supports grouping of nested queries, one simple fix could be to enclose the user's query in brackets. This'll prevent unexpected mixing of qualifiers. We need to make sure this is not going to break other use cases in any way.

    A few things we might want to consider here are:

    • Should we detect already bracket-enclosed user queries and leave them as is? IOW how double-enclosed queries get resolved, if even allowed.
    • If a user query ends with a \, then the rendered \) will be parsed as a escaped char and the mixing will still happen. As I checked this with @BagToad it seems like the API ignores such cases, but at the same time the behaviour seems to be a bit flaky. Definitely, something to investigate a bit more.
    • Do we need to do a lightweight parsing of the query to eliminate the chance for such edge cases?

    We probably need internal comms with other engineers for confirmation.

    Also, the advanced issue search backend is used in the commands below. So we should make sure the fix applies to all of them.

    • issue list (this issue)
    • pr list
    • search issues
    • search prs
  9. added
    priority-3
    gh-pr
    gh-issue
    gh-search
    core
    and removed
    needs-triage
    on Oct 22, 2025
  10. jsoref commented on Oct 22, 2025

    @jsoref
    Contributor

    I'd be inclined to change the wrap in this form:

    -(%s)
    +( %s )

    That'd mean at worst case a trailing \ would escape a space instead of the ).

    A quick check shows that the server side already has code for:

    Filter contains 1 issue:
    * Unbalanced parentheses
    

    So unless there's some other horrible escape handling for the other stanzas, if someone includes an unbalanced extra ( in their query, it would just trigger a server error.

  11. jsoref commented on Oct 22, 2025

    @jsoref
    Contributor

    currently, the same bug appears using:

    GH_DEBUG=api gh -R check-spelling/check-spelling pr list -S ' author:kylo252  OR author:Sin-Estres-dev  ' -s all

    and would go away with:

    GH_DEBUG=api gh -R check-spelling/check-spelling pr list -S '( author:kylo252  OR author:Sin-Estres-dev  )' -s all

    Unrelated (someone can file an issue for this, I'm disinclined at this time), but search is pretty buggy:

    GH_DEBUG=api gh search prs ' author:Sin-Estres-dev  '
    Invalid search query "author:\"Sin-Estres-dev  \" type:pr".
    

    Note that () wrapping for search prs works (again, spaces break everything--see above):

    GH_DEBUG=api gh search -R check-spelling/check-spelling prs '(author:Sin-Estres-dev)'

    Similarly, spaces break search issues.

    these work:

    GH_DEBUG=api gh -R check-spelling/check-spelling search issues 'author:tas50'
    GH_DEBUG=api gh -R check-spelling/check-spelling search issues '(author:tas50)'

    I suppose you have automated stats to have a sense of how many gh clients are sending the garbage generated queries based on the regression from GitHub CLI 2.79.0. From my perspective this regression cost me enough time that I spent time looking into it (our automatic tools relied on this stuff not being broken).

  12. babakks commented on Oct 22, 2025

    @babakks
    Member

    I'm sorry that has caused you problems, @jsoref 🙏, but at the gh side we had no choice but to switch to the advanced syntax, since the old backend is going out of service. Hopefully, we can get around the problems and stabilise the user experience.

    The commands that use the search API certainly need to be improved, especially with the new advanced syntax and its colorful syntax features. That's why I'm wondering if we might want to do a lightweight parsing of the user queries at the client side.

    One more reason is even budging whitespace into the enclosed query will not be the end of the story. Haven't yet tested it, but what happens if the query ends with a double-quote? Does that make the rest of the final query part of a quoted text? 🤷 On the other hand, getting gh involved in such details just makes gh maintenance harder, and prone to future incompatibility as the search syntax evolves. So, it's an intricate situation that requires thorough investigations.

  13. jsoref commented on Oct 22, 2025

    @jsoref
    Contributor

    Two cases:

    Query is broken with no error reporting
    GH_DEBUG=api gh -R check-spelling/check-spelling pr list -S 'author:kylo252"' -s all
    GraphQL variables: {"limit":30,"q":"author:kylo252\" repo:check-spelling/check-spelling type:pr","type":"ISSUE_ADVANCED"}
    no pull requests match your search in check-spelling/check-spelling
    
    GH_DEBUG=api gh -R check-spelling/check-spelling issue list -S 'author:tas50"' -s all
    GraphQL variables: {"limit":30,"owner":"check-spelling","query":"author:tas50\" repo:check-spelling/check-spelling type:issue","repo":"check-spelling","type":"ISSUE_ADVANCED"}
    no issues match your search in check-spelling/check-spelling
    
    Query is broken with horrible error reporting
    GH_DEBUG=api gh -R check-spelling/check-spelling search prs 'author:tas50"'
    Invalid search query "author:\"tas50\\\"\" repo:check-spelling/check-spelling type:pr".
    The listed users cannot be searched either because the users do not exist or you do not have permission to view the users.
    
    GH_DEBUG=api gh -R check-spelling/check-spelling search issues 'author:tas50"'
    Invalid search query "author:\"tas50\\\"\" repo:check-spelling/check-spelling type:issue".
    The listed users cannot be searched either because the users do not exist or you do not have permission to view the users.
    

    Seems to be an incredibly horrible error message.

  14. jsoref commented on Oct 22, 2025

    @jsoref
    Contributor

    I can't actually find a reference for GitHub's username rules. The closest I can find are for GHES (?):
    https://docs.github.com/en/[email protected]/admin/managing-iam/iam-configuration-reference/username-considerations-for-external-authentication#about-username-normalization

    Usernames for user accounts on GitHub can only contain alphanumeric characters and dashes (-).

    Given that a " is clearly not in that range, someone is being silly trying to treat it as a valid character for an author:... search -- offhand, given that it's a server side error, I blame the server. But I do not have the energy to try to file a ticket against the server, GitHub has not treated my tickets well so it's a bad use of my time.

  15. babakks commented on Nov 18, 2025

    @babakks
    Member

    We decided to move forward with adding the brackets, as it seems to be the right approach at the moment. Involving gh in parsing the query syntax is just a can of worms, as this is the responsibility of the user to provide a valid query.

    I also noted that the issue list --web needs to be fixed as well. Here it concatenates the user query and the compiled sequence of qualifiers out of the search package:

    var q string
    if advancedIssueSearchSyntax {
    q = query.AdvancedIssueSearchString()
    } else {
    q = query.StandardSearchString()
    }
    if options.Search != "" {
    return fmt.Sprintf("%s %s", options.Search, q)
    }
    return q

  16. jsoref commented on Nov 18, 2025

    @jsoref
    Contributor

    Are you going to do it yourself, or are you now open to someone else doing it?

  17. babakks commented on Nov 18, 2025

    @babakks
    Member

    The change would affect a shared search component used by almost all commands, hence I need to cover various scenarios. It's not a clear case, so it's best to be handled internally.

  18. self-assigned this
    on Nov 20, 2025
  19. babakks commented on Nov 20, 2025

    @babakks
    Member

    This is fixed now. Thanks again for your investigations and patience! 🍻

    Please feel free to try building gh from the trunk branch (run make) and give it a go, @jsoref @trishanu-init @Tommynem.

  20. babakks commented on Dec 11, 2025

    @babakks
    Member

    Fix is now available in the latest release, v2.83.2.

  21. eMPee584 commented on Jan 9, 2026

    @eMPee584

    Casually strolling by, wanting to open an issue to have an option for gh search issues to automatically search the current repo instead of manually specifying it with -R, only here did I discover the non-obvious issue list --search syntax. Guess issue search would be difficult to implement as a more intuitive way for search, right? 😅

  22. babakks commented on Jan 9, 2026

    @babakks
    Member

    @eMPee584, that's a fair suggestion, but the problem is it'll be a breaking change if search issues scope to the current repo by default.

  23. eMPee584 commented on Jan 10, 2026

    @eMPee584

    That's why I proposed an option.. but having gh issue search work would be higher up the list.
    There are more cases like this where synonyms being aliased could improve UX, f.e. issue show for alias to issue view .. No idea how to implement that though, or would have sent a PR ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcoregh-issuegh-prgh-searchpriority-3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions