Slack and github integration: start receiving updates for tasks in a github project for status changes on a single slack channel - github

We use slack for internal communication in our team and have configured github on slack for getting updates about new commits and issues. Now, we want our workstream to be managed by tasks in github projects and for this need to configure a slack channel for receiving updates about the tasks being created, assigned, completed or any other status change on a task need to be notified over the same slack channel. Like we do it for commits and issues. I have searched for having it done but, nowhere I found how can one do this.
Here are the references I have gone through, they only suggest slack and github integration for - commits, issues, pull requests, status check on pull requests, code reviews and deployments :
https://slack.github.com/
https://github.com/integrations/slack
https://github.blog/2019-07-29-whats-new-in-the-github-and-slack-integration/
https://slack.com/intl/en-in/help/articles/232289568-GitHub-for-Slack
Is the feature available that I am looking for, or not?

So, after contacting Github support I got a confirmation from them that the feature is not available presently and they are not working on this feature as well. To request this feature,
https://github.com/integrations/slack/issues/699
is the link to existing issue and number of reactions on this will help them to prioritize work in the future.

Related

Slack / Github integration - How to query Github PRs, reformat description and publish to a Slack channel

I need to publish a changelog to a Slack Channel room for all the Pull Requests of a GitHub repository when promoted to Production.
I was investigating at https://github.com/integrations/slack but I haven't found any way of doing this particular integration.
Kind of things I need to do:
Query all the Pull Requests from a Github repository, containing a
substring in their title
Process the text in the PR description, formatting it in a different way.
Send the new formatted PR texts to a Slack Channel and email them to an email account.
Is there a mechanism in Slack/Github or a free tool that I can use to implement this requirement?

Limit Github slack integration to only reviews to which I'm assigned or participating

Has anyone figured out how to limit Github slack integration to only reviews in which you are assigned or a reviewer?
I added it to my slack workspace and set the subscriptions thus:
/github subscribe myOrg statuses, reviews
I was hoping to only get my reviews and not all reviews. I can't seem to figure out how to filter down to the items I care about especially as the notification options are: every new message or none.
Install the GitHub Slack integration in your workspace
Go to your github settings reminders
Enable real-time alerts and check the appropriate boxes (which is probably all but Your PR has failed CI checks)
In slack you do not need to subscribe to anything. Doing so will get you all kinds of additional notifications

Automatically merge verified and tested GitHub Pull Requests

I'd like to automatically (i.e. from Jenkins) merge a GitHub pull request that has been approved by a person and has been tested successfully; in other words, when all THREE of these checkmarks are green:
Is this possible? I haven't found any documentation on an API for GitHub's new "changes approved" code review functionality.
There is a new PullRequestReviewEvent webhook that is triggered when a review is submitted in a non-pending state. The body of the webhook contains the ["review"]["state"] field, which will be approved when all reviewers have approved the changes (i.e. when you get the green "changes approved" tick in the UI).
Combine this with the StatusEvent for the head SHA of your pull request to get the status checks from CI and so on, then finally check the "merge-ability" of the pull by requesting the pull request from the API:
GET /repos/:owner/:repo/pulls/:number
Once you have all three things, you can merge the pull request with:
PUT /repos/:owner/:repo/pulls/:number/merge
and appropriate payload parameters. Note you'll need the Accept: application/vnd.github.polaris-preview+json for some of the payload parameters as they are in a preview period.
Official documentation: "Managing auto-merge for pull requests in your repository".
That is now (Dec. 2020, 4 years later) available:
Pull request auto-merge public beta
Pull request auto-merge is now rolling out as a public beta!
With auto-merge, pull requests can be automatically merged when all requirements for merging are met. No more waiting for long checks to finish just so you can press the merge button!
To use auto-merge, a repository maintainer or admin must first toggle on the repository setting to allow auto-merge (see steps).
Then any user with write permission can enable or disable auto-merge by navigating to the pull request page.
Keep in mind that auto-merge is only available for pull requests targeting a branch with required reviews or required status checks, and therefore is only available on public repositories and private repositories on Team and GitHub Enterprise Cloud plans.
Learn more about pull request auto-merge.
Update Feb. 2021:
Pull request auto-merge is now generally available
With auto-merge, pull requests can be set to merge automatically when all merge requirements are met.
No more waiting on slow CI jobs or tests to finish just so you can click the merge button!
To use auto-merge, first have an administrator allow auto-merge in the repository settings.
Then to enable auto-merge, navigate to the pull request on GitHub.com or GitHub Mobile and tap the button to enable.
Note that auto-merge can only be enabled by users with permission to merge and when there are unsatisfied merge requirements, like missing approvals or failing required status checks.
GraphQL APIs will be rolling out later this week. The pull request webhook event also now includes actions that indicate when auto-merge is enabled or disabled.
Learn more about pull request auto-merge
However, as The Godfather mentions in the comments:
The problem with this is that it doesn't do auto-update.
So as soon as your repo has "branches must be up-to-date" and some other PR got merged, this "auto-merge" doesn't work any more.
It should have been called the same way as Gitlab: "merge when pipeline succeeds", at least it's not as confusing... –
Update Aug. 2021:
Maintainers can now manage the availability of auto-merge in a repository
Maintainers can now manage the repository-level "Allow auto-merge" setting.
This setting, which is off by default, controls whether auto-merge is available on pull requests in the repository.
Previously, only admins could manage this setting.
Additionally, this setting can now by controlled using the "Create a repository" and "Update a repository" REST APIs.
I wrote an app that does this. It responds to the review, labelled, and commit status/checks events, and merges when the merge button is green.
The fact that it merges when the merge button is green means that you can configure the requirements for a mergeable PR in the GitHub settings, there's no need to write separate configuration for the app.
Mergery is:
Free, including for private repositories.
Fast. It's event-driven, it doesn't run on a schedule.
Simple. No configuration required. Just label your PRs with automerge.
You can use Mergify to do exactly this, since this is what it has been created for. Just set up a minimal .mergify.yml file in your repository:
rules:
default:
protection:
required_status_checks:
context:
- continuous-integration/travis/pr
required_pull_request_reviews:
required_approving_review_count: 1
And you'll be good to go.
(disclaimer: I'm one of the Mergify founders)
Using github actions which is one of the new ways, this can be done. I have written a blog about auto approving and auto merging PRs using github actions. However, if the intent is to just merge the PRs only, then then the second job in this work flow would be enough to do it.
https://github.com/bobvanderlinden/probot-auto-merge is a free GitHub app that does the job. It's configurable in .github/auto-merge.yml.

Github notifications - Mail to PR creator

If I raise a Pull request and if I need to be notified by a mail saying --
You have created a Pull request for "bla bla" on "so and so" date.
On merge - I get a notification
On comment - I get a notification
So my question is...
Are there any such settings in github which sends a mail to PR creator?
Can I tag myself in the PR comment ?
Any help !!
Are there any such settings in github which sends a mail to PR creator?
There's currently no setting in GitHub that makes the platform work in that way. Note: You can send an email to support#github.com to request for such a feature.
Can I tag myself in the PR comment ?
Yes, you can. But that won't trigger an email sent to your mailbox
However, if what you're after is keeping track of your own activity on GitHub, there may exist another alternative: GitHub exposes atoms feeds for various endpoints. The user is one of them. Register your own feed in a RSS reader and you're done.
Syntax: https://github.com/{:user}.atom
Sample: https://github.com/mojombo.atom
I'm surprised that despite being up for so long, this question hasn't really been meaningfully addressed. Axibase designed a cool little tool which can do exactly what you're describing here: if a PR is raised in one of your repositories you'll be notified via email or third-party messenger service.
By default the rule will fire when anyone raises a PR, but it can be configured to only respond to specific users as that seems to be one of your requests.
The workflow here describes the underlying mechanics of the tool and this guide will take you through the entire set-up. The whole process should only take about 10 minutes from start to finish.
Disclaimer: I've worked for the team that develops ATSD, which is the database at work here.

How to get specific github notifications like pull requests or assigned issues?

Github provides notifications via mail or web, based on watched repos. But is there a way to get more in detail? Like only watch a specific pull requet or assigned issue? I feel like i get spammed from comments on other pull requests that have nothing to do with me.
Update Nov. 2020: you now have "Custom notification controls"
This week we are giving you more control over the types of content that you are notified about on GitHub:
Watching a repository can often be a double-edged sword.
You want to stay up to date with a project, but if you have a specific interest or role within the community, you have no choice but to subscribe to updates on everything.
No more.
Beneath the watch button, you’ll find that we have made a few changes: we’ve made the language clearer so you know what you’ll receive updates about, we’ve made the interface more accessible and, we’ve introduced a new custom category.
Within this, you can select the types of content you would like to be notified about.
Do you focus on code review? Limit your notifications to pull requests.
Are you a community manager? Select Discussions.
As new types of notifications are added, you’ll find them in this menu.
You’ll find these controls on all repository pages and on your watching page where you can customize notifications for repositories you already watch.
Update May 2019: you now have "Custom thread subscriptions"
You can now limit the types of notifications you receive for any issue and pull request to be specific to merge, reopened and/or closed events.
That should allow to further control the amount of emails received.
Update July 2017: you now can declare in the GitHub repo a code owner.
Any pull request touching a file managed by said code owner will trigger a notification to that person.
See "Repo owner automatic notification after updating a pull request"
2015: Yes, for instance, for a specific issue on a project (issue 2595), you can register by clicking the "Subscribe" button at the right side of the page (since 2015).
Once clicked, it will appear as "Unsubscribe" (for you to click if you don't want any more notifications)
So you don't have to watch the all repo, you can subscribe only to specific issues.
Not sure if this has changed, but now there's a subscribe button in the top right corner:
https://help.github.com/articles/subscribing-to-conversations/
first disclaimer, Im part of the team at zigi.ai
Instead of getting notifications for every activity on Git via email or web, Zigi integrates with your Github to learn your pull request activity,
Filters the information and sends you actionable notifications on your pull requests activity (from all repos) that is relevant to your work directly from Slack.
Once a PR is created in GitHub, Zigi manages the entire workflow:
Gathers all the communications related to a PR- that's relevant to
you
Tells me which PRs are waiting for my review from all repos
Shows which of my PRs are waiting for a teammate's review and for how
long
Makes it easy to ping teammates to remind them (without feeling
awkward about bothering them)
Lets me add reviewers
Tells me when a PR is stuck or open for a long time
Helps me make sure the code owner approved
See here an example of a Slack message with filtered notification for pull request