Get Slack Notifications For New Active Sprint

Following git workflows, there is a branch called activesprint, or develop. It is the release candidate. Most of active branches should base on it.
Team need to be notified, whenever a new activesprint branch has been created. To lower the communication effort, we can automate the detection process and get slack notifications.

Get Slack Notifications When A New Active Sprint Has Been Created



1.1 Why We Need Slack Notifications

  1. When a new active sprint is created, we usually need to merge our private branches as soon as possible. The earlier we do the branch merge, the fewer merge effort we could expect.
  2. Config files might need to be updated accordingly. Especially the bump version.

1.2 Backbone: Jenkins + Slack

First of all, we need to detect when a new git branch has been created.

Apparently we have 2 ways: push or poll. If we have the admin privilege of git repo, we can define a git hook. The hook subscribes to git branch create event. Or we can define a crontab, which will periodically poll latest branch list, via git ls-remote –heads origin.
Fortunately activesprint usually has a strong naming convention. Say sprint-37/sprint-38 or 1.37/1.38. Once we figure out latest branch list, we can easily detect whether a new activesprint branch has been created.

For a bigger adoption, we use the poll mechanism.
Get Slack Notifications For New Active Sprint

Here comes a Jenkins job, MonitorNewActiveSprint in github. We can also find a live version in our public demo jenkins.

GitHub

Whenver we detect a new activesprint, we fail the job. Then it send out slack notifications.
Get Slack Notifications For New Active Sprint

This is how the Jenkins job looks like.
github_monitor_new_active.png

Once we have it properly configured, we will get the lovely slack notification like below.
Get Slack Notifications For New Active Sprint

Any improvements or suggestions? Share your experience with us!

More Reading:

linkedin
github
slack

PRs Welcome

Blog URL: https://www.dennyzhang.com/slack_activesprint


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.