Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

6 practical tips for introducing Git commit policies

Zsuzsa Galicza [Midori]
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 12, 2022

Automatically displaying software development updates in Jira issues is an effective way to share progress status across different teams. Git Integration for Jira is the popular, go-to app that software teams use to integrate their Git repositories with Jira. If you look at the features of Git Integration for Jira from a DevOps standpoint, particularly automation and open communication, they enable fundamental DevOps practices that help team members make confident and informed decisions.

While striving for improved efficiency, more and more teams also realize the importance of an orderly and consistent Git repository. Before you start displaying developer info in Jira, you want to verify that the right people changed the code, on the right branches, and the commits are compliant with your organization's rules. A Git repository that has clear commit rules, informative commit messages and practical controls is also something your DevOps strategy should include.

Sharing commit details on Jira issues is one thing, but introducing commit policies to verify those commits is another. If you are seeking help introducing commit best practices and rules to your team, you are not alone. Many developer team leads and product managers are looking for the right ways to implement them. Fortunately, there are a few practical pieces of advice that apply to all teams and environments.

If you are interested to learn how others use commit policies, read how engineers at Philips control their repositories containing mission-critical source code for medical devices. 

Standardizing commit best practices

Creating change in a developer team is never easy, so I bring 6 suggestions and best practices to follow if you are thinking of introducing commit policies to your software development process.

commit-rule-annotated.png

How to implement commit policies and quality standards:

1. Present to stakeholders and get their backing

You already have a plan for a new commit policy strategy, but make sure it makes sense for the business as well. Present your project plan to decision-makers and explain how the automation and standardization will result in better product quality, faster code reviews, quicker releases and happy users. Highlight how a consistent code repository makes it easy to answer audits and onboard new developers, bringing associated costs down.

2. Document the commit policies

Don't keep your plan to yourself. Create comprehensive and useful documentation about the code change requirements, commit rules and exceptions. Explain the reasoning behind each rule, giving as much information as possible. Developers appreciate it if you explain why you are controlling something.

3. Announce the new policies well ahead

Allow time for the whole team to familiarize with the new process. Use the team communication channels to encourage them to read the documentation. If it's a practice at your company, you can put out a banner announcement in Jira or Confluence to call their attention.

4. Provide hands-on support after go-live

Expect that some people will still first learn about the new commit rules when they get their first rejection message. On top of explaining in the rejection message exactly what's expected, provide examples of compliant commits and add links to the documentation. Also, be available personally to answer questions for some time after go-live.

5. Implement local commit verification

You will most probably configure commit checks on the server to verify pushed changes. But if there are several (non-compliant) commits pushed at the same time, it can be a headache for the developer to go back, select and amend the problematic commits and send a pull request again.

Work together with your developers and implement local commit verification. Instead of writing your own pre-commit hook script for that use a dedicated Jira app like the Better Commit Policy.

Local verification catches non-compliant commits right on the developer's computer and prevents committing anything that wouldn't be accepted to the blessed Git repository. This saves time, speeds up code reviews and helps developers get used to the commit policies.

6. Automate DevOps workflow actions

Use automation to let your developers leverage DevOps automation actions. Allowing developers to trigger DevOps actions right from the Git commit message helps them cut on administrative tasks and avoid context switching.

jira-automation-rules.png

Atlassian doesn't focus on DevOps automation features for Jira Server and Data Center users, but you can get the Better DevOps Automation app to extend Automation for Jira with DevOps automation triggers.

These triggers can be events like accepted or rejected commits, branch or tag creation or specific @commands used in the Git commit message. The commands can be built-in commands (like the ones for commenting or logging work on issues) or custom commands that you created.

They can start a wide range of automation actions from sending Slack messages or emails, running tests to automatically triggering Jenkins, Bamboo or any other CI/CD builds and many more.

A software team can be a tough bunch when it comes to rules and policies, but if you outline the hard reasons behind the new rules and ease their life with automation, they are much more likely to cooperate and even support you.

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events