feat: add OR filter#282
Conversation
This allows to divide the filter into groups with "OR" semantics. As a result, it's possible to select issues from a specific repo with a desired label next to the negated filter for other repos.
Could you share with me more details what you'd like to accomplish? Is the
|
| const regexp = /(?:([\w#/&]+)|"([\w#/&\s-.]+)"|([-!]?)([\w]+):(?:([\w-#/&@<>=.]+)|"([\w-#/&@:.,; ]+)")?)(?:\s|$)/g; | ||
|
|
||
| const terms = []; | ||
| const groups = [ [] ]; |
There was a problem hiding this comment.
The proposed design changes the API surface to return a OR group - this is entirely unnecessary and prevents us by supporting AND or nested groups ((a OR B) AND (b OR c OR D)) in the future - the way to extend the current API surface is to introduce an or qualifier, wrapping the results in its value property:
it('should parse OR groups', function() {
// when
const search = parseSearch('repo:foo/bar label:bug OR -repo:baz/qux');
// then
expect(search).to.eql([
{
qualifier: 'or',
values: [
[
{ qualifier: 'repo', value: 'foo/bar', negated: false, exact: false },
{ qualifier: 'label', value: 'bug', negated: false, exact: false }
],
[
{ qualifier: 'repo', value: 'baz/qux', negated: true, exact: false }
]
]
}
]);|
Thanks for your contribution. I re-implemented it via #283 - you can see that filtering now supports all of GitHubs search syntax. |
|
Dependent on what you want to do, this may not be the right solution. |
The intended use is for the default filter. I want to setup https://tasks.bpmn.io/board so that only selected issues from the Web Modeler repo are visible, and we keep filtering out the repos that we decided to ignore. End game is this: Thanks for the review and alternative implementation. |
If your intend is to instead only show particular issues on the board (drop others during synchronization) then you may want to use a different feature. We could ensure that only issues matching a particular filter are synchronized - and only related PRs are show. |
Hmm that makes sense. Let me prepare a proposal in an issue (not PR). With the OR filter we'd achieve hiding some issues per default, but best if we can never add wuffle labels to them. |
This allows to divide the filter into groups with "OR" semantics. As a result, it's possible to select issues from a specific repo with a desired label next to the negated filter for other repos.
The solution follows GH code search syntax: https://docs.github.com/en/search-github/github-code-search/understanding-github-code-search-syntax#using-boolean-operations.
Which issue does this PR address?
Related to https://github.com/bpmn-io/internal-docs/issues/1281