Configuring merge request decoration for SonarQube Cloud with GitLab CI/CD

Time to complete icon15 minutes to complete

Overview

This course teaches you how to integrate SonarQube Cloud's merge request (MR) decoration and merge blocking directly into your GitLab CI/CD pipelines. This powerful integration will make your code reviews more efficient and lead to a more secure codebase.

Learning objectives

  • Configure the GitLab merge request decoration feature with SonarQube to display results directly in your merge requests
  • Configure merge request blocking by using SonarQube quality gate enforcement

Key topics

  • Defining success and the benefits of automated code analysis
  • Enhancing your code review with MR decoration and blocking
  • Configuring SonarQube Cloud for MR decoration and merge prevention
  • Configuring GitLab to enable automatic merge blocking
  • Testing MR decoration
  • Preventing an MR when a quality gate fails

Target audience

  • DevOps engineer
  • Developer
  • Engineering leader
  • Analyst

Prerequisites

  • Complete the GitLab CI/CD code analysis set up so you can enable MR decoration
  • Refer to the Configuring code analysis for SonarQube Server with GitLab CI/CD course in the Sonar Learning catalog for guidance
  • Refer to the Configuring code analysis for SonarQube Cloud with GitLab CI/CD course in the Sonar Learning Center for guidance on setting environment variables for SONAR_TOKEN or SONAR_HOST_URL