Skip to content

feat: Add ExcludeLabels support to IssueListByRepoOptions#4290

Open
Muneerali199 wants to merge 3 commits into
google:masterfrom
Muneerali199:add-exclude-labels
Open

feat: Add ExcludeLabels support to IssueListByRepoOptions#4290
Muneerali199 wants to merge 3 commits into
google:masterfrom
Muneerali199:add-exclude-labels

Conversation

@Muneerali199

Copy link
Copy Markdown

Add field to to support excluding issues with specified labels using the query parameter.

Closes #3082.

opts := &github.IssueListByRepoOptions{
    Labels:        []string{"bug"},
    ExcludeLabels: []string{"wontfix"},
}
issues, resp, err := client.Issues.ListByRepo(ctx, "owner", "repo", opts)

Note: This uses an undocumented GitHub API parameter (-labels). The parameter works with the REST v3 API but is not officially documented in the GitHub API reference.

@gmlewis gmlewis changed the title Add ExcludeLabels support to IssueListByRepoOptions feat: Add ExcludeLabels support to IssueListByRepoOptions Jun 9, 2026
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Jun 9, 2026
@gmlewis

gmlewis commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Thank you, @Muneerali199!
Please run the shell scripts in step 4 of CONTRIBUTING.md and push the results to this PR before we proceed.

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.49%. Comparing base (946bd71) to head (08da79d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4290   +/-   ##
=======================================
  Coverage   97.49%   97.49%           
=======================================
  Files         192      192           
  Lines       19256    19256           
=======================================
  Hits        18774    18774           
  Misses        267      267           
  Partials      215      215           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Run generate.sh to generate GetExcludeLabels accessor
- Run fmt.sh to fix gci formatting in test file
- Add structfield exception for ExcludeLabels field
- All tests pass and lint reports 0 issues
@Muneerali199

Copy link
Copy Markdown
Author

done @gmlewis

Comment thread .golangci.yml Outdated
- Tree.Entries
- User.LdapDn # TODO: LDAPDN
- UsersSearchResult.Total
- IssueListByRepoOptions.ExcludeLabels # url:"-labels" can't match "Labels" (already taken)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this list is sorted asc

@Muneerali199 Muneerali199 Jun 9, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed the sort order, thanks @alexandear!

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @Muneerali199!
LGTM.
Awaiting second LGTM+Approval before merging.

cc: @alexandear

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

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Label exclusion in IssuesListOptions

3 participants