Scanner: Allow dryrun flag

A few questions to help you:

  • What are you trying to accomplish?
    The sonar-scanner should have a dry-run flag available which will allow the scanner to do everything that it currently does, except for publishing the analysis to the sonarqube server.

  • Why does this matter to you?
    With CICD pipelines, you sometimes need to test things without making permanent changes. The sonar-scanner process can sometimes run for a number of minutes and consume large amounts of memory which is things that need to be tested within a CICD pipeline.
    An example where you want to do this would be where you are planning or building a new CICD pipeline and need to test the execution of sonar linting, but you don’t want the results pushed as the runs are only part of testing and has no bearing on product development.
    Being able to set a dry run flag will then take the sonar-scanner through it’s usual process, but not submit the results to sonarqube.

  • How would that look in [product]? Alternatives?
    N/A

  • How would we know it works well?
    The sonar-scanner process will run without submitting the results to sonarqube, and printing a message that the dry-run flag is enabled, so publishing is disabled.

  • Why should it be a priority now?
    This will help teams to test sonar-scanner in a near production environment without needing to publish analysis results but still able to get the performance impact of sonarscanner within the cicd pipeline.

1 Like