slack
slack copied to clipboard
No Slack notification for label based subscription when using GitHub CLI to create PR
Describe the bug No Slack notification for label based subscription when using GitHub CLI to create PR
To Reproduce Steps to reproduce the behavior:
-
/github subscribe owner/arepo +label:“some_label
” -
gh pr create -t "some title" -a "some_user" -l "some_label"
- No Slack notification
-
gh pr close pr_id
- Slack notification received
Expected behavior I expect to see the Slack notification about the created PR.
Desktop (please complete the following information):
- OS: macOS Monterey
- Version 4.23.0
I have similar problem with dependabot notifications. Label based filtering does not deliver them at all.
Looks like this was already implemented: https://github.com/integrations/slack/pull/1252
I am also experiencing this error!
Background information
I have set up subscriptions into a slack channel:
/github subscribe <origin/repository> +label:dependencies
/github unsubscribe <origin/repository> issues commits releases deployments
Such that I will receive notifications for pull requestes with the label dependencies
only:
This channel will receive notifications from <origin/repository> for: pulls, +label:'dependencies'
Expected behavior
Receive notifications for dependabot pull requests when they are opened or closed
Actual behavior
I receive notifications when a dependabot-pr is closed, but there is no notification when the dependabot-pr is created.
After som exploring I think i know why. The label dependencies
is added to the pull request after the pull request is created. Since the subscription only provides notification when a pull request with this label is created (or closed), it will not post a notification.
Feature request
Change the behavior such that notifications are triggered also when the specified label is added to or removed from the pull request
I think it's an issue with Github CLI/API, not with the Slack integration
We use hub
(it's a wrapper around Github API) and we see that labels are applied a few seconds after PR is created, I even opened a bug for hub but I believe they can't do anything about it
Totally support @glemvik 's request to trigger a notification when label is added
I also have this issue, but I'm creating a PR through PyGithub package. It uses the Github API under the hood, which doesn't accept labels when creating a PR. I'm adding the labels right after, but it doesn't trigger the notification.
The easiest solution seems to be changing the Slack integration so it triggers the notifications on label added event too. Another would be to make the API request accept the labels, so newly created PRs already have the labels. Then make the change in Github CLI and other clients.