How to Get Slack Notifications for New Active Sprints
In this article, Denny Zhang explains how to set up Slack to give you notifications about new active Sprints. Read on to learn more!
Join the DZone community and get the full member experience.Join For Free
following git workflows, there is a branch called activesprint or develop. it is the release candidate. most active branches should base on it.
teams 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.
why we need slack notifications
for one, 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 less merge effort we should expect.
secondly, config files might need to be updated accordingly (especially the bump version).
backbone: jenkins and slack
first of all, we need to detect when a new git branch has been created.
we have two ways: push or poll. if we have the admin privilege of git repo, we can define a git hook. the hook subscribes to the git branch to create an event. or, we can define a crontab, which will periodically poll latest branch list of 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:
here comes a jenkins job, monitornewactivesprint in github. we can also find a live version in our public demo on jenkins .
whenever we detect a new activesprint , we fail the job and it sends out slack notifications.
this is how the jenkins job looks:
once we have it properly configured, we will get a lovely slack notification:
any improvements or suggestions? share your experience!
check out the original article here .
Published at DZone with permission of Denny Zhang, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.