Skip to content

feat: add OR filter#282

Closed
barmac wants to merge 1 commit intonikku:mainfrom
barmac:OR-filter
Closed

feat: add OR filter#282
barmac wants to merge 1 commit intonikku:mainfrom
barmac:OR-filter

Conversation

@barmac
Copy link
Copy Markdown
Contributor

@barmac barmac commented Apr 21, 2026

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

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.
@nikku
Copy link
Copy Markdown
Owner

nikku commented Apr 25, 2026

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 OR filter meant to be used by board filters? Or is the OR filter meant to be used to exclude an issue/PR entirely from the app? If so, then we'd need a different approach.

OR filters as implemented will carry a performance toll - slow down filtering.

const regexp = /(?:([\w#/&]+)|"([\w#/&\s-.]+)"|([-!]?)([\w]+):(?:([\w-#/&@<>=.]+)|"([\w-#/&@:.,; ]+)")?)(?:\s|$)/g;

const terms = [];
const groups = [ [] ];
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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 }
            ]
          ]
        }
      ]);

@nikku
Copy link
Copy Markdown
Owner

nikku commented Apr 26, 2026

Thanks for your contribution.

I re-implemented it via #283 - you can see that filtering now supports all of GitHubs search syntax.

@nikku nikku closed this Apr 26, 2026
@nikku
Copy link
Copy Markdown
Owner

nikku commented Apr 26, 2026

Dependent on what you want to do, this may not be the right solution.

@barmac
Copy link
Copy Markdown
Contributor Author

barmac commented Apr 26, 2026

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 OR filter meant to be used by board filters? Or is the OR filter meant to be used to exclude an issue/PR entirely from the app? If so, then we'd need a different approach.

OR filters as implemented will carry a performance toll - slow down filtering.

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: repo:camunda/web-modeler label:team/canvas OR -repo:camunda/web-modeler

Thanks for the review and alternative implementation.

@nikku
Copy link
Copy Markdown
Owner

nikku commented Apr 26, 2026

The intended use is for the default filter.

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.

@barmac
Copy link
Copy Markdown
Contributor Author

barmac commented Apr 28, 2026

The intended use is for the default filter.

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants