Uploaded image for project: 'Product Roadmaps'
  1. Product Roadmaps
  2. MMF-2082

Help administrators configure branch/PR analysis in GitLab CI after GitLab onboarding

    XMLWordPrintable

    Details

    • Type: MMF
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Labels:

      Description

      Why ?

      Currently, project administrators are not guided to set up their branch & PR analysis via GitLab CI. They have to check the documentation to understand how to analyze their projects. We should provide a good guidance to project administrators so that they can easily integrate quality in their dev pipeline. 

      We want to provide a tutorial to help users analyze their GitLab project in GitLab CI, as we do Bitbucket Server and GitHub projects in Jenkins.

      What ?

      Use Cases

      As a project administrator, after I create my project, I am guided to set up the analysis of my project:

      • Manually: from my local machine for a test, or from an external CI for which we don't provide guidelines.
      • With GitLab CI:
        • I do not have an existing pipeline: I have received some help to create my pipeline
        • I have an existing pipeline: I can see from the tutorial what is recommended so that I can adapt my pipeline

      As a project administrator who wants to analyze with GitLab CI, I expect to know what are the steps to be guided to set up my quality analysis for master, branches, and PR directly in the product:

      • I have a checklist to ensure that I have the correct setup
      • I can follow the different steps to set up my analysis 
      • I can copy/paste the scripts when needed
      • I understand that after the next analysis launched on GitLab CI, the results of the analysis will appear on SQ.

      How

      The tutorial can be inspired from SonarCloud, with few adjustments:

      1. Configure your project:
        Depending on your project, a sonar-project.properties file should be created, your maven our gradle configuration should be updated
      2. Declare  environment variables:
        SONAR_HOST and SONAR_TOKEN should be masked (recommendation) but unprotected (must-have, because by default on gitlab.com branches and PRs are not protected)
      3. Create or update your yml file
        
      sonarqube-check:  
      image:  
      name: sonarsource/sonar-scanner-cli:latest  
      variables:  
      SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache  
      GIT_DEPTH: 0 # Tells git to fetch all the branches of the project, required by the analysis task  
      script:
      - sonar-scanner -Dsonar.qualitygate.wait=true  
      allow_failure: true  
      cache:  
      key: ${CI_JOB_NAME}  
      paths:
      - .sonar/cache  
      only:
      - merge_requests
      - master  
      

       

      The documentation should be updated accordingly with:

      • cache instructions
      • the use of environment variables for SONAR_HOST AND SONAR_TOKEN

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              christophe.havard Christophe Havard
              Reporter:
              christophe.levis Christophe Levis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: