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

Subscribe to certain labels only #384

Closed
Viper007Bond opened this issue Feb 27, 2018 · 51 comments · Fixed by #911
Closed

Subscribe to certain labels only #384

Viper007Bond opened this issue Feb 27, 2018 · 51 comments · Fixed by #911
Assignees
Labels
topic:subscription Issue related to the `/github (un)subscribe` command type:feature Feature request

Comments

@Viper007Bond
Copy link

I'm a member of a Slack channel dedicated to a specific feature of a repo that covers a wide variety of features. Right now we have an internal Hubot to filter down to a specific label and then post messages to the channel.

It'd be cool if this official integration could replace our internal by allow subscribing to only issues/PRs that have a specific label instead of the entire repo.

@integrations integrations deleted a comment from pimearht220256 Feb 27, 2018
@bkeepers bkeepers changed the title Feature Request: Subscribe to certain labels only Subscribe to certain labels only Feb 28, 2018
@bkeepers bkeepers added type:feature Feature request topic:subscription Issue related to the `/github (un)subscribe` command labels Feb 28, 2018
@serhalp
Copy link

serhalp commented Mar 27, 2018

We would love this to be able to filter out Greenkeeper PRs from polluting our Slack channels.

A cursory glance at the code makes it seem like this would be fairly straightforward to implement. If I worked on a PR, would this feature be accepted? What would the preferred command syntax be? /github unsubscribe owner/repo label:[label]? Thanks.

@vaidas-lungis
Copy link

@serhalp

A cursory glance at the code

Can you provide a link to specific lines you had in mind? Or you already started work in this feature?

@serhalp
Copy link

serhalp commented Mar 29, 2018

I have not started on this. But from glancing at the code, it seems that it already fetches the labels for PRs/issues here and here and includes them on the objects passed around. (I think this is just so they can be included in Slack messages).

So, roughly, I was imaging you'd pass in optional label filters to subscribe/unsubscribe here and right around... here (and in the analogous spot for issues) you'd exit early (not send a message) if the PR matches blacklisted labels?

People may want both the ability to whitelist labels and to blacklist labels... Hrm.

@RealAndyLawton
Copy link

^ Bump this. When working on a monorepo type project it's useful for feature teams/pods to only subscribe to their specific labels.

@zetbrush
Copy link

zetbrush commented May 18, 2018

@bkeepers @serhalp any news on this? how to subscribe to PRs with Specified Label only?

@steipete
Copy link

Monorepo here as well. This currently makes GH Slack Notifications unusable because of the traffic.

Even for our other repos, a more fine-grained selection of notifications would me this immensely useful, for example only post if a certain tag is set (e.g READY FOR REVIEW) We currently deploy our own bot to work around this limitation: https://pspdfkit.com/blog/2018/reviewbot/

(We cant run our own bot for filtering - that’s too complex)

@DeMarko
Copy link

DeMarko commented Jul 10, 2018

I've got a similar issue, we have a monorepo for our API/web but we label PRs for our the API that concern our internal tools, it'd be great to have them emit into a specific channel

@shoheikawano
Copy link

Same here, we have monorepo as well.

It would be cool to be able to setup something like this on Slack:
/github unsubscribe owner/repo label:[label]

@ffMathy
Copy link

ffMathy commented Oct 25, 2018

We really need this too.

@johanatan
Copy link

Also need.

@allendewilzin
Copy link

This will be cool

@hatched-anthony
Copy link

Also need.

@zubhav
Copy link

zubhav commented Dec 4, 2018

Would be very helpful for a monolithic codebase where you want to filter front-end/back-end PRs seperately

@repi
Copy link

repi commented Dec 9, 2018

Would love this, both for monorepo use cases but also to filter out automatic/bot PRs that become too noisy in some projects (and that all have a specific label)

@mistercrunch
Copy link

Our use case is for our designers to be informed on their slack channels when we label an issue with needs:design-review

@murphymi
Copy link

+1 we also need this....any update as to whether this will be provided?

@vdelimpa
Copy link

That would be great! Please make it happen 🤞

@ewdave
Copy link

ewdave commented Jan 28, 2019

+1 for this feature.

@joegesualdo
Copy link

+1 This would be extremely helpful and make this integration work better with our teams' workflow.

@alex-polunochev-zz
Copy link

This is a great idea and my team will definitely benefit from having this option! Bump ^

@justportillo
Copy link

+1!

@envato-daniellucas
Copy link

➕ 1️⃣

@dennissivia
Copy link
Contributor

Everybody who is interested in sharing their thoughts about a future filter syntax that allows AND/OR combinations, feel free to add your two cents in #913

@dennissivia
Copy link
Contributor

Filtering by a "required-label" is now possible 🎉 .
I removed the support for AND/OR combinations and multiple labels for now.
As documented in PR #911, the new syntax for adding a required label is:

# Notify events which have `todo` label
/github subscribe owner/repo +label:todo

# You can specify labels which have spaces when enclosed in quotes
/github subscribe owner/repo +label:"help wanted"

# Unsubscribe
/github unsubscribe owner/repo +label:"help wanted"

@erinkshaw
Copy link

Hi @scepticulous thanks so much for doing this!

I'm currently running into issues subscribing to labels with whitespace. I'm getting this error
+label:"help is not a valid argument.

when entering the command
/github subscribe owner/repo +label:"help wanted"

@dennissivia
Copy link
Contributor

I'm currently running into issues subscribing to labels with whitespace. I'm getting this error
+label:"help is not a valid argument.

I assume there is a problem with the quotes or the whitespace. Can you try typing the double quotes " or a single quotes ' manually?
I am planning to add support of all well-known and typical unicode-quotes very soon, but for now we use standard ascii quotes.

Here is my example:

Command
/github subscribe integrations/test +label:"help wanted"

Visual
labels-with-quotes

@DeMarko
Copy link

DeMarko commented Aug 28, 2019

Thanks again for tackling this! I'm getting the same error using double or single ASCII quotes.

My command was /github subscribe owner/repo +label:“System Integrity” and my error was:

+label:"System is not a valid argument.

FWIW, the repo was private, not sure if that matters, but the GitHub Slack integration can view things in that repo

@erinkshaw
Copy link

my new theory is that my github integration does not have the most recent updates. I've tried updating slack, reinstalling the integration, and restarting slack to no avail.

@dennissivia
Copy link
Contributor

dennissivia commented Aug 29, 2019

@DeMarko Thanks for sharing your exact command. Your example is actually not using ASCII double-quotes (ASCII 34).

Here is the difference:
/github subscribe owner/repo +label:“System Integrity”
/github subscribe owner/repo +label:"System Integrity"

However, that is hard to spot, confusing and annoying.
So I 🚢 a change that adds supports for the quotes that you are using (and others). PR: #927

In addition to ' and " we now support:

✓ supports '«'
✓ supports '»'
✓ supports '“'
✓ supports '”'
✓ supports '„'
✓ supports '‟'

@DeMarko
Copy link

DeMarko commented Aug 29, 2019

oh woah! Thanks for spotting that, I had no idea Slack (or maybe my OS?) was doing "smart" Unicode quotes

@omarreiss
Copy link

Hey there, thanks for this awesome feature. Just wondering. Is it entirely impossible to subscribe to multiple labels?

When I run
/github subscribe owner/repo +label:"label a"
/github subscribe owner/repo +label:"label b"
I expected to see both labels added to my subscription. But that didn't work.

Then I tried
/github subscribe owner/repo +label:"label a" +label:"label b"
But that didn't work either. Am I doing something wrong? Is this still on your list?

I would very much like to filter issues on multiple labels. Should I open a new issue to propose this and describe my usecase?

@efung
Copy link

efung commented Sep 27, 2019

I would expect to get a notification if the required label I'm filtering on, was added after the issue was initially created, e.g.:

  • Configuring a filter for a required label, say, Foo
  • Creating a new issue with no labels set. I don't expect to get a notification (and I don't).
  • Updating the issue by adding the label Foo. I expect to get a notification, but I don't

I am only subscribed to the issues event. But I don't see any other events that would represent the issue metadata getting updated, or a label changed event.

@p3l6
Copy link

p3l6 commented Oct 11, 2019

@efung Did you ever find a workaround for this? I am finding the same issue with our workflow.

We're using a github action to set the labels automatically, so they aren't set until after PR creation.

@efung
Copy link

efung commented Oct 11, 2019

Did you ever find a workaround for this?

No, I haven't.

@Tankard
Copy link

Tankard commented Dec 9, 2019

I would expect to get a notification if the required label I'm filtering on, was added after the issue was initially created, e.g.:

  • Configuring a filter for a required label, say, Foo
  • Creating a new issue with no labels set. I don't expect to get a notification (and I don't).
  • Updating the issue by adding the label Foo. I expect to get a notification, but I don't

I am only subscribed to the issues event. But I don't see any other events that would represent the issue metadata getting updated, or a label changed event.

It seems that labeled/unlabeled events are not triggered at all. For issues and for PRs as well.

@seanmunson
Copy link

Filtering by a "required-label" is now possible 🎉 .
I removed the support for AND/OR combinations and multiple labels for now.
As documented in PR #911, the new syntax for adding a required label is:

# Notify events which have `todo` label
/github subscribe owner/repo +label:todo

# You can specify labels which have spaces when enclosed in quotes
/github subscribe owner/repo +label:"help wanted"

# Unsubscribe
/github unsubscribe owner/repo +label:"help wanted"

Does this support multiple labels, or just one?

@taw123
Copy link

taw123 commented May 22, 2021

Any progress here? I hate adding a"me too" tag here but...

I'm trying to track new issue related to a Repo I DON'T own so I can't add the GitHub Action I found elsewhere that runs at label creation and allows for notice on label if added to the repo issue-label-notifier). This was actually found in a similar request for label subscription in GitHub, that is still open tracing back to 2016... Automatically subscribe to an issue by label or a set of labels

Using the command described HERE I would like to follow ONLY specific label(s) in the Home Automation repo that are associated with the integrations I use....

Sounds simple enough... but to date after searching and reading this thread, I don't see a way to subscribe/follow say home-assistant/core +label:"integration: shelly" +label:"integration: apple_tv" The following command would seem like it SHOULD work IF the command would actually provided notification of ALL NEW AND MODIFIED issues with label(s) found in list...
/github subscribe home-assistant/core +label:"integration: shelly" +label:"integration: apple_tv"

Additional, WHEN this DOES (hopefully) work, can one make changes in the future by simply adding/removing labels from a potential CURRENT/pre-existing subscription list? (i.e. will the following result in 1 or 3 subscribed labels?)
/github subscribe home-assistant/core +label:"integration: shelly" +label:"integration: apple_tv"
/github subscribe home-assistant/core +label:"integration: additional_new_label"

IDEALLY the result of the 2 separate commands above would be a subscription to the repo home-assistant/core for the 3 labels: integration: shelly, apple_tv, additional_new_label

Correspondingly then, one would hope that the 2 commands:
/github subscribe home-assistant/core +label:"integration: shelly" +label:"integration: apple_tv" +label:"integration: additional_new_label"

/github unsubscribe home-assistant/core +label:"integration: additional_new_label"

SHOULD produce a subscription list for home-assistant/core to just 2 labels labels: integration: shelly and integration: apple_tv. Correct?

Thanks for any help here.
--Tom

@thetaiter
Copy link

I'd also like to know if multiple labels are supported. This is a quite simple and extremely useful feature.

@patrickracicot
Copy link

Any news on the multi-label ?

@namolnad
Copy link

Plus one on the multi label question -- this and or a custom query would be a huge help for me

@dankentfield
Copy link

At my day job we use a mono-repo structure too and getting bombarded with notifications for all pulls has stopped us being able to use this plugin too.

I decided to fix the problem myself and created https://www.pullmate.io/ 🎉 which lets you subscribe to notifications for pulls only from specified sub-directories:

e.g. running /sub-path repo/sub/directory/repo-1 will only get notifications for pulls opened in the repo-1 path

I was wondering if this helps mitigate the need to filter by label? or is that still required?

@ytvnr
Copy link

ytvnr commented Sep 29, 2021

On my side, I am not allowed to filter on label with an _ in it :(

@mrmanc
Copy link

mrmanc commented Apr 25, 2022

This feature seems really really useful. Is there any plan to make this available for GitHub Enterprise Server users?

@cryptiklemur
Copy link

At my day job we use a mono-repo structure too and getting bombarded with notifications for all pulls has stopped us being able to use this plugin too.

I decided to fix the problem myself and created pullmate.io 🎉 which lets you subscribe to notifications for pulls only from specified sub-directories:

e.g. running /sub-path repo/sub/directory/repo-1 will only get notifications for pulls opened in the repo-1 path

I was wondering if this helps mitigate the need to filter by label? or is that still required?

What happened to pullmate?

@codingtony-candid
Copy link

Is it possible to filter out when a label is present?
I.e subscribe to all pulls except the ones that contain a specific label.

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

Successfully merging a pull request may close this issue.