fix: keep the org filter when a repo is excluded from the search - #187
Open
davinkevin wants to merge 1 commit into
Open
fix: keep the org filter when a repo is excluded from the search#187davinkevin wants to merge 1 commit into
davinkevin wants to merge 1 commit into
Conversation
Terms with an excluded "repo" qualifier were handled like positive ones, which dropped the "org" qualifier and turned the query into a search over the whole of GitHub.
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.
Hi 👋
Excluding a repository from a section makes it return pull requests from the whole of GitHub.
With a connection filtered on the
exampleorg, and this query in a section:prepareQuery()returnsis:open draft:false -repo:example/foo type:pr archived:false sort:updated: theorg:exampleterm is gone.It comes from the workaround for #48: terms with the
orgqualifier are dropped as soon as the query has arepoone, buthas()only looks at the qualifier and never at the exclusion flag, so-repo:takes that path as well. Only a positiverepo:restricts the search to a set of repositories and should replaceorg:, an excluded one should not — GitHub handlesorg:x -repo:x/yjust fine.I gave
has()an optionalexcludeoption instead of changing its default behaviour, so the other call site (has("archived")) keeps working as before. The mixed caserepo:example/foo -repo:example/barstill drops the org filter.Tests added for both cases.