Skip to content

Issue searches with label are case-sensitive #1819

Description

@heaths

Describe the bug

When running something like gh issue list --label foo, issues with label Foo are not returned despite labels being case-insensitive on the GitHub web site both in terms of searching and creating, i.e. you can't create a label that differs only by case.

Assignee, author, and milestone queries are case-insensitive, however. I can pass "HEATHS" and get the same results as "heaths".

Steps to reproduce the behavior

  1. cd to your repo and type gh issue list --label <some-label> where <some-label> exists but diffs by case

Expected vs actual behavior

Issues with a label that differs by case are not returned.

Logs

Nothing very interesting it seems, but just in case it helps (against https://github.com/Azure/azure-sdk-for-net):

gh issue list --author HEATHS --milestone "[2020] october" --label Search
[git remote -v]
[git config --get-regexp ^remote\..*\.gh-resolved$]
* Request at 2020-09-18 14:40:25.6551043 -0700 PDT m=+0.232960001
* Request to https://api.github.com/graphql
* Request took 288.2938ms
* Request at 2020-09-18 14:40:25.9453834 -0700 PDT m=+0.523239101
* Request to https://api.github.com/graphql
* Request took 277.8304ms

Showing 5 of 5 issues in Azure/azure-sdk-for-net that match your search

#15135  Create sample showing how to use ETags in ...  (Client, Search)             about 4 days ago
#14588  Regenerate the Search SDK to pick up any n...  (Client, Search)             about 50 minutes ago
#12457  SearchResources do not clean up indexers o...  (Client, Search, Test Debt)  about 14 days ago
#12374  Implement/generate IndexingParameters mode...  (Client, Search)             about 15 days ago
#11593  Search: Rename/customize IndexBatch rather...  (Client, Search)             about 10 days ago

Activity

  1. heaths commented on Sep 18, 2020

    @heaths
    ContributorAuthor

    This appears to actually be a GraphQL / backend issue, as the following query yields the same empty results (sans milestone, which wasn't yielding results and I suspect requires some sort of escaping that wasn't among the obvious patterns I tried):

    {
      organization(login: "Azure") {
        repository(name: "azure-sdk-for-net") {
          issues(first: 10, filterBy: {assignee: "HEATHS", labels: "search", states: OPEN}) {
            nodes {
              assignees(first: 1) {
                nodes {
                  login
                }
              }
              author {
                login
              }
              title
            }
          }
        }
      }
    }
  2. heaths commented on Sep 18, 2020

    @heaths
    ContributorAuthor

    If changing the service is not under consideration, perhaps an edge query on a case-insensitive label search?

    {
      organization(login: "Azure") {
        repository(name: "azure-sdk-for-net") {
          labels(query: "search", first: 10) {
            edges {
              node {
                issues(filterBy: {assignee: "HEATHS", states: OPEN}, first: 10) {
                  nodes {
                    number
                    assignees(first: 2) {
                      nodes {
                        login
                      }
                    }
                    title
                    labels(first: 3) {
                      nodes {
                        name
                      }
                    }
                    milestone {
                      title
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  3. added a commit that references this issue on Sep 20, 2020
    a0bac16
  4. added
    priority-3Affects a small number of users or is largely cosmetic
    on Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions