Blog post

Sonar Streamlines the Race to Release

Clint Cameron photo

Clint Cameron

Product Marketing Manager

Date

  • SonarQube for IDE
  • SonarQube Server
  • SonarQube Cloud
Knowing if your latest release candidate is built with clean code doesn’t have to be a guessing game. With Sonar at your side, you’ll know that every new line, every PR and every build is...

<It’s 6 PM in the meeting room at Acme Software and all eyes are on the product manager…>


Everyone in the room is waiting for your answer. Time freezes for a moment as you feel a cold sweat rolling down the back of your neck. You summon some courage and your voice chokes a little as you say “I think the release candidate is good, we can’t let the schedule slip, let’s move forward.” You’re relieved and yet uneasy because you made that decision mostly from your gut and not from a place of knowledge. 


This is the last time, you tell yourself...there has to be a better process!!


If our product manager had only known about Sonar, all that stress could have been avoided! In this blog, I’ll share how a key Sonar methodology, Clean as You Code, helps you streamline your app release process. With Clean as You Code, you and your team can push more features while holding the schedule and without a technical debt penalty. It sounds too good to be true, right?…well, read on mon ami.

What’s Hiding in Your Code?

Stripped down to the essentials, building an application is really just combining many chunks of code and nicely packaging them up to interact and play nice with their other app friends.


If we consider the chunks of code as marbles, they can either be colored red or green. Red marbles represent code that isn’t clean and green marbles represent code that is clean. Over the course of the sprint, the devs are pumping out marbles and adding them to the app jar. At the end of the release cycle, the jar will be full representing all the new/changed code that goes into the next app version. 


Now, imagine the app jar is opaque and doesn’t have a lid. During the course of the sprint, we never really know the condition of the code inside as the marbles accumulate. And because it’s an open jar, there’s nothing to prevent devs from merging code with quality and/or security issues. It’s only when we pour out the contents into the build machine that the color makeup of the marbles is revealed. 


If you’re dumping a lot of red marbles into your build machine, you’ve got issues. With these issues, comes some hard decision-making. Do you delay the release so that the red marbles can be refactored into green marbles or do you hold the schedule and revisit the red marbles later? Neither choice is attractive. Repeatedly delaying the release only leads to frustration and tough conversations, while holding the schedule means you’re just creating more technical debt…which can lower developer morale. Things get worse if we include vulnerabilities in the equation. Some of those red marbles could be security issues just waiting to slip into the wild and create a massive credibility problem for your organization.

Unknown Code Quality is the Enemy of Good Decision Making

Too many development organizations call this their release process - as if it were the norm and just the way things are. Organizations that work this way are subjecting their release teams to endless, unpredictable roller coaster rides - release after release after release…

yoda saying that... is why you fail (in reference to sonar steamlining the race to release.

As the planned release date approaches, how can you be confident about making a Go / No-Go decision when you’re constantly battling quality issues that unexpectedly come to light? Whether you’re a product manager, a release manager or the VP of Engineering, the decision doesn’t get any easier. Wouldn’t things be a lot easier if you knew all along how many red marbles were accumulating so you could do something about it? In fact, wouldn’t it be awesome if you could just keep the red marbles out of the app jar from the start? That’s the most efficient way to build a quality app. You need to turn the unknown into the known. Sonar can help…

Sonar - A Better Way to Develop

Sonar combines the proven methodology of Clean as You Code with SonarQube for IDE in your IDE and SonarQube Server or SonarQube Cloud for your team. This powerful combination continually analyzes your code to help you find and fix quality issues in your IDE and PRs - BEFORE they get merged. This means your app jar only gets filled with green marbles because they’re the only ones allowed. 


In our analogy above, we said the app jar didn’t have a lid and that’s how it was so easy to add red marbles along with the green ones. What if we could add a lid to the jar and make it a smart lid that only allowed green marbles? We can, and it’s called a Quality Gate and it’s central to the concept of Clean as You Code. 


Clean as You Code is based on two principles: 

  • Individual devs own the quality of their code, and
  • Only code that passes the Quality Gate gets merged

With every pull request, Sonar analyzes the added/changed code and if the code doesn’t meet the agreed-upon quality standard, it fails the Quality Gate and it doesn’t get merged. The red marbles can’t bring release-time doubts because they simply don’t exist. 

Yoda saying clear your mind of questions (sonar streamlines the race to release)

Sonar - Good Vibes In Your Workflow

Sonar is straightforward and a bit magical in how powerful and effective it can be. With traditional methods, you’re making progress while stopping occasionally to clean up the problems and then it’s back to progress. It’s two steps forward and one step back. A traditional workflow like this isn’t efficient and it isn’t continually building toward a clean app because code quality isn’t transparently known at all times. 


Sonar also brings good vibes to the team by systematically reversing the technical debt burden. When you start using Sonar, you immediately improve things by ‘gating’ the red marbles and keeping them out of the new/changed code the team is working on now. Over time, you’ll refactor the parts of your code base that matter and when you do, that code will also be nicely cleaned! With all that green goodness in your codebase, you’ll have devs knocking at your door to come work for you.

Sonar - For the Team Win

Sonar combines Clean Code theory with the practical tools that empower devs to own the quality of their code. Perhaps the most powerful and important point is also probably the most pedestrian. It’s the process! Adoption of the Clean as You Code process is the true differentiator(s) because that is what gives Sonar the staying power. It becomes an indispensable part of the dev workflow and not having it would be inconceivable to the team!  


Devs are not the only beneficiaries. Having a clear Green / Red Quality Gate for your overall project makes the release decision simple - if your project is green, you can release with confidence. There’s less stress on the whole team and that translates to improved job satisfaction, better mental and physical health along with higher employee retention.


Sonar can be the catalyst that alters your organization’s release mindset and sets it on a streamlined course. Sonar is transformational for your team. It’s truly shifting left. It’s giving your talented devs the means to delight customers by letting them focus on creativity instead of digging through old code to fix things - and that’s the ultimate good vibes!


<It’s 6 PM in the meeting room at Acme Software and all eyes are on the product manager…>


Everyone in the room is waiting for your answer.  You smile and say “The Sonar Quality Gate is green, we’re good to go! Let’s share our latest release with the world; they’re eagerly awaiting it - good work everyone!” You’re excited and pleased because this version has new functionality that will catch the competition by surprise!


As you file out of the room, you remark to a colleague that Sonar made it easy to determine if the app was built with clean code and that made the Go / No-Go decision straightforward.


Thanks for reading and happy, clean coding!


Pick a topic to discover more:

  • Legal documentation
  • Trust center
  • Follow SonarSource on Twitter
  • Follow SonarSource on Linkedin

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.