1: Use CI/CD Pipeline Verification
2: Integrate with Adadot to make the most of the wealth of data on offer
3: Compare commits from the command line
4: Integrate Jira with GitLab and make use of the time savings
5: Reflect on your deployment size
Gitlab is a behemoth on the git scene, with most developers spending a good chunk of their working life in the depths of the famous fox logoed company’s git product. We’ve delved deep and talked to a range of developers to get their top tips on using GitLab that bit better in 2022.
Pro tip #1: CI/CD Pipeline Verification
Thankfully, gone are the days of having to commit a change to .gitlab-ci.yml to check validity. GitLab’s new pipeline editor made this workflow a hell of a lot easier in 2021, but are you making the most of it?
This new pipeline editor allows you to preview stages and dependencies, whilst also providing live linting, helping you understand if there are any last minute problems like incorrect keywords in use before you commit. Furthermore, the editor makes use of the /ci/lint API endpoint, allowing you to rapidly verify that templates with extends and reference tags work in the way you expect them to.
Fancy trying this out? Work through an example GitLab has kindly provided here.
Pro tip #2: Integrating with Adadot
Everyone works differently. GitLab has a vast amount of data on how you work, packed full of untapped insights. This covers everything from the classic commitment phobe (yes we’re looking at you, Ms. “I only commit my code at close of play”) to deployment success rate and duration.
But how do you get at that juicy sea of data? GitLab has some of its own dashboards, but to take this data to the next level, give Adadot a whirl. Yes, this is a shameless self plug, but we really do eat our own dog food, and have seen some massive benefits in using our own product, doubling our throughput through actions based on insight including:
1: Improving the ‘lines per MR’ metric by taking action to break our stories down smaller
2: Increased our understanding of blockers by noting where our overall speed dropped in a sprint
3: Made the team more self organizing simply by empowering them with data about their performance
Adadot has a mass of insights all collated into one easy dashboard, check out the integration yourself on Adadot. Just want a flavor? This is just one section from the ‘work’ dashboard, covering Merge Requests:
Pro tip #3: Compare commits from the command line
On the subject of commits, this is a really handy and easy to apply tip. Simply use the git diff command for a quick means of comparing the difference between commits of the same file.
A simple way to compare the differences between commits or versions of the same file is to use the git diff command.
Run the below to do this:
$ git diff $start_commit..$end_commit — path/to/file
To more specifically compare the changes between two commits, shoot for:
$ git diff $start_commit..$end_commit
Pro tip #4: Integrate Jira with GitLab
A great way to bridge the gap between being ‘in the weeds’ of GitLab and surfacing conversation within Jira tickets is through integrating the two platforms together. This can really help with making communication more seamless, particularly when you have non-development team members in your team.
There’s a vast range of things this powerful integration can achieve, but a few of our favorites are listed below. They might seem small in isolation, but packaged together they can make quite the time saving:
- Create a Jira issue from a vulnerability or finding in GitLab.
- Create a GitLab branch from a Jira issue.
- Use a GitLab commit to automatically close a Jira issue, a useful one if the user story’s acceptance criteria is satisfied via the commit.
- Add Jira time tracking to an issue.
- Mention a Jira issue ID within a GitLab commit and the Jira issue will automatically show the commit message as a comment.
- Comment on Jira issues within GitLab, meaning you never have to leave!
Pro tip #5: Reflect on your deployment size
To really get the best out of GitLab you need to also look inwards. A platform can only do so much, and whilst GitLab is an industry leader in terms of speedy DevOps platforms, it takes some introspection to ensure your deployments truly are hitting 0-60mph in the quickest amount of time possible.
This needs to happen as a team. Collaborate to define a deployment protocol that empowers rapid code commits whilst minimizing the hurdles and blockers. Make sure you very explicitly document this in a team wiki using a platform like Confluence to ensure consistency and remove ambiguity. Measure what your deployment speed currently is and then let the process fly for a sprint.
Surface your deployment speed stats in retro, reflect on the deployment process, make a few tweaks and go again.
This process should never stop; we never reach perfection, and constant attention and discipline is needed to ensure you stay at the cutting edge.
Over to you
That’s five pro tips to take your development practices to the next level using GitLab. Give them a go, see if they work for you, and let us know!
Psst, on the fence about GitLab or GitHub as your git platform of choice? Check out our independent blog that battles the two platforms against each other here.