Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future filter syntax and logical combinators #913

Open
dennissivia opened this issue Aug 20, 2019 · 7 comments
Open

Future filter syntax and logical combinators #913

dennissivia opened this issue Aug 20, 2019 · 7 comments
Labels
topic:filters Filter subscription based on defined rules topic:subscription Issue related to the `/github (un)subscribe` command type:feature Feature request

Comments

@dennissivia
Copy link
Contributor

dennissivia commented Aug 20, 2019

What

  • Allow AND and OR combination of filters.
  • Add a new command for managing filters

When adding the capability to filter incoming events based on certain rules (e.g. labels), it will eventually become necessary to combine rules via boolean logic and requested here: #911 (comment).

Why

We implementing label features we can only make AND or OR the default behavior.
For now, OR seemed like the approach, that would address more use-cases. This can be wrong however and either way, we will have to support both combinators sooner or later.

Eventually, this will require a more sophisticated filter syntax.
As a first step, this can be done by adding inline tokens. As a second step filters might need to become more explicit.

Syntax

Ideas

I don't have strong feelings about the details of the syntax, but it should be:

  • Easy to type
  • Delimiters should be very unique so that we do not end up having parsing issues.

Some inspiration can be found in @izuzak 's comment label:foo,bar label:baz.
Another, very similar source would be Looker string expressions.

We could also use boolean operators like" label: foo|"foo bar" baz to express (foo or "foo bar" and baz).

Since we already use space as a combinator (currently OR), we can keep that (as shown above) and only need an additional combinator for the other case.

Proposal

Inline combinators

  • Make " " (space) match the default operator (AND), which matches Looker and GitHub-UI filters
  • Make one of |, , the OR operator.

Dedicated syntax

When filters gain adoption and become more sophisticated it might make sense to add a new command instead or in addition to allowing it as part of the subscribe command.

One example could be /github filter issues <filter expression>

Required features

In order to consider this syntax successful, the following (requested) use cases should be covered:

  • Users can filter PRs by team and/or me
  • Issues and comments are filtered by label and/or term (in title)

Feedback

This topic is not going to be implemented very soon, so I would love to get as much feedback as possible about preferences and also about existing standards or libraries, that already parse expressions like this, so we could skip writing grammar and parser.

cc @izuzak @integrations/integrations-reviewers for ideas

@dennissivia dennissivia added type:feature Feature request topic:subscription Issue related to the `/github (un)subscribe` command topic:filters Filter subscription based on defined rules labels Aug 20, 2019
@dennissivia dennissivia changed the title Logical combinators for filters Future filter syntax and logical combinators Aug 20, 2019
@mraakashshah
Copy link

mraakashshah commented Aug 29, 2019

I would really enjoy being able to use wildcard syntax. Something like label:severity* which would act as a way to see all issues prepended with severity. We use four "severity" labels to triage issues:
image

The Looker syntax seems like a good start.


I came here from #384. Thank you so much scepticulous!

@stale
Copy link

stale bot commented Aug 29, 2020

Is this still relevant? If so, just comment with any updates and we'll leave it open. Otherwise, if there is no further activity, it will be closed.

@stale stale bot added the wontfix label Aug 29, 2020
@mraakashshah
Copy link

I can promise this is still valuable to SlackOps.

@stale stale bot removed the wontfix label Aug 30, 2020
@glenwinters
Copy link

I'm interested in having an exclusion filter, so I would get all notifications except those with a particular label. I think that's relevant to this issue.

For example, we get a bunch of dependabot PRs every time it runs, and the PR previews take up a ton of space. Dependabot allows you to automatically add a label to its PRs, and I'd use that label to ignore notifications.

Example (using - as exclude rather than +):

/github subscribe owner/repository -label:dependabot

@jakeatoms
Copy link

I would also love to see the ability to apply the label filters to either pulls or issues. For instance, I want a team channel to only see PRs opened with a fixes-main label, but we want to see all issues.

@Ghostavio
Copy link

It would be really nice to have some combination of commits and labels, so I could subscribe to commits in any branches with PRs associated with any given label.

@neverbot
Copy link

I'm interested in having an exclusion filter, so I would get all notifications except those with a particular label. I think that's relevant to this issue.

For example, we get a bunch of dependabot PRs every time it runs, and the PR previews take up a ton of space. Dependabot allows you to automatically add a label to its PRs, and I'd use that label to ignore notifications.

Example (using - as exclude rather than +):

/github subscribe owner/repository -label:dependabot

Exactly the same feature I was looking for, filtering some bots PRs. A syntax like -label:foo would be perfect.

In the Slack Scheduled Reminders (https://github.com/organizations/xxx/settings/reminders) you can filter by a certain text in the title or some labels, but this is just for the daily reminder:

Screenshot 2022-12-19 at 18 18 58

It seems this issue has not received a lot of love in recent times... is still planned to work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:filters Filter subscription based on defined rules topic:subscription Issue related to the `/github (un)subscribe` command type:feature Feature request
Projects
None yet
Development

No branches or pull requests

6 participants