When using slack with GitHub, is there any option to send messages by checking labels. For example if in commit exists label "design", message will go to 'design' channel. Is there any ready implementation or we need to do something custom?
No, not yet (May 2018, a year after the OP's question)
This is still pending in integrations/slack issue 384
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.
So it is technically possible, but for now through the use of an external third-party bot.
There is PR for this feature, but has not yet been approved/merged (15 months after it was submitted)
https://github.com/integrations/slack/pull/797
Our team ended up creating a custom integration
Related
I don't want to subscribe a slack channel to all issues on arbitrary third party repositories, just to the particular issues on which my team/organization is involved (contributing to / impacted by), so the usual github integration command /github subscribe thirdparty/arbitraryrepo issues does not suffice as it would cause a ton of unwanted noise in the channel. (and the existing label filtering would not cut it)
(Update: there is an open feature request for that https://github.com/integrations/slack/issues/1280)
I neither want to forward my personal github subscriptions to the slack channel as there are lots of projects I am individually involved that have nothing to do with my team's work. (e.g. my direct mentions)
Also, subscription should stay despite I leaved the team/company.
A per-issue public RSS/Atom feed would cut it but it does not exist.
Am I missing something obvious?
The only workaround I can think of is adding a channel email integration, registering that address to an organization-shared github account and subscribe it to the individual issues we run into.
But this is quite cumbersome (must keep an alternate github logged-in session while browsing, channel readability could be abused to hijack company account, subscriptions can't be managed from the slack channel...) so any different idea would be very welcome.
As far as I know there is nothing that would suit your need completely at this moment, but have you considered labels?
#1 option You could use filtering based on label which seems to be the closest:
That would notify you about all issues, pulls, commits, releases, deployments that has a given label. Syntax example:
/github subscribe repo-owner/repo-name +label:"team-a"
Pros: a general filter based on a label name, e.g. team-a
Cons:
a single label filter only (AFAIK: multiple labels aren't supported but discussed: https://github.com/integrations/slack/issues/384)
this works only for a label given when issue/PR is created. Not during its existence ("change label" events are not triggered). Known bug (https://github.com/integrations/slack/issues/1594) and feature PR is open https://github.com/integrations/slack/issues/965
Note: a workaround to get info about label change in PR: to convert PR to a draft and back (https://github.com/integrations/slack/issues/965#issuecomment-1330884166)
#2 option Another thing that might be considered is that the account that is used within GitHub Slack app for connecting to Git server will be actually notified also about all its mentions, assignments & reviews! So if you don't use your personal account, you could get generated some related notifications to the whole team / other specific user etc.
EDIT:
Workaround steps to achieve partially what you want (but it can be in some conflict with your Slack / GitHub settings that I’m not aware of):
Use / create a shared account (or other special account) in GitHub
In Slack, use this special GitHub account for connecting Slack GitHub app to GitHub (this enables notifications by default for this account - mentions and assignments).
Then, when this GitHub account is assigned / mentioned, you’d automatically get notified (but again, then it would work not just for issues but hypothetically also in PRs etc.) to a dedicated channel where you'd have your GitHub integration set.
To auto-assign an issue, you'd have to use e.g. GitHub Actions.
Caveat: But as we discuss, there’s no simple way to achieve your goal completely. To at least get closer to something similar to what you describe and require, you’d need to accept some compromises and extra steps for workaround as it’s unfortunately not currently natively supported. 3rd hypothetical way is to create even more complex mechanisms of filtering & redirecting data which would be increase a level of complexity to just introduce but also maintain (unless you'd already have something similar existing in your infrastructure) and I wouldn't recommend it.
How can we search/filter GitHub issues for the ones you've previously marked as 'watching'?
I can't spot any way to do it via the GUI, but perhaps there's some search parameter?
I took a guess and tried watching:true and currentUser(), but neither seemed to work
You can see all your subscriptions at https://github.com/notifications/subscriptions. You can filter by reason and repository and sort by Most recently subscribed or Least recently subscribed.
Available subscription-reason filters
Any reason - Show all subscriptions
Assign - You were assigned to the Issue/PR.
Author - You created the thread.
Comment - You commented on the thread.
Manual - You subscribed to the thread (via an Issue or Pull Request).
Mention - You were specifically #mentioned in the content.
Review Requested - You were requested for review.
State Change - You changed the thread state (for example, closing an Issue or merging a Pull Request).
Team Mention - You were on a team that was mentioned.
You would not get a web-based search filter for "watched": the Advanced search does not include anything related to "watched/watching".
Even the GitHub API does not include anything regarding watching at the issue level.
There are only API calls for listing watchers at the repository level.
I have a Github repo which hasn't been updated for a long while (up until today).
I would like to notify users who cloned it in the past that the repo has been updated and that they better pull the changes.
Is there a way to do that?
You can use GitHub webhooks for this. You'll have to read the docs and add your own consumption logic for it.
If you rather not build your own consumption pipeline, consider using LightFlare (I'm the creator) that has out of the box support of consuming Webhooks events from many services (github included) and notifies you at your choice(s) of destinations (slack / email etc ...).
On Github, I've noticed that some pull requests say that they're "Good to merge" because they have passed a Travis build passed. I have used Travis a little bit, how does it integrate with pull requests on Github?
Here's a screenshot of what I'm talking about:
Once you've set up Travis and tell it which branch need to be tested, it'll automatically run a build on each pull request targetting one of those branches (and every commit pushed to these branches).
Note that the Travis notification on Github only appears after the build/test is over (roughly 15min).
Also, this isn't Travis specific. Github has an API for continous integration, works for TravisCI, also works with CircleCI.
Note that since December, 8th 2014, you can see multiple status from multiple services on your pull request.
See results from all pull request status checks
Since we introduced the Status API, you've been able to improve the quality of your code by including the status of a pull request within the conversation timeline, for every push.
Before today, you've only been able to see results from one service. Now you can see all your results at once, from multiple CI systems that test your code against different platforms to simultaneous security testing and code coverage analysis.
You can also see how the status of a pull request has changed over its history by clicking the icons listed next to individual commits.
Since July 20th 2015, that status information will be clearly visible in the PR.
See "Clearer mergability information for Pull Requests":
Each month, 119,000 repositories on GitHub use automated status checks (via the GitHub Statuses API) and it’s important that this information is presented in a way that you can easily understand.
When you’re ready to merge a pull request, you should be able to see that it is ready.
If a check isn’t passing, you should be able to see why.
I want to integrate github with a external service.
In particular I want certain actions to happen when an issue closes or a milestone is completed. I can see how to do the above for issues by adding a webhook against the issue event updates http://developer.github.com/v3/repos/hooks/.
However, I don't see any events around milestones.
Why is that? Is it an ommission? I have seen some integrations of github milestones with the google calendar - I am assuming that this requires webhooks (I wouldn't expect them to use polling against the milestone api).
One alternative I have thought if there is no such event, is to listen for issue events and every time an issue closes, check whether this issue is associated with a milestone, and if it is check whether all other issues associated with that milestone are already closed and then create my own "milestone completed" event. ( I don't need milestone create events).
Any suggestions would be greatly welcomed.
Yeah, there are no milestone events at this time. Your idea using issue events and checking the milestone closed issues count is probably the way I'd do it too. Remember to use conditional GETs when fetching the milestone info in order to reduce your API quota consumption.
There are now webhook events for milestones - introduced by Github in October 2016. See:
https://developer.github.com/changes/2016-10-27-new-label-and-milestone-webhooks/