Must-share information (formatted with Markdown):
Hello,
I just create a new job in my Gitlab to launch an analyze sonar of all my commits.
For now, I have two job, one with sonarscanner with maven and another with sonarscanner CLI
I want to put my job in failed if I have vulnerabilities in my code. But I can’t get an artifact in my job to see the analyze of sonar.
Is there anyone who knows how to get me to retrieve sonar analysis information from my commit. Or the differences with the last analysis
This topic is well-covered in our docs. You can have your job wait to check the quality gate status and fail if the QG status is failed. Whether a vulnerability will fail your QG depends upon your specific QG criteria.
Maybe I didn’t cover all my interogation.
I want to know if we can do this with another scan than the last one.
Because with the quality gate we compare with our latest analyze. But it is possible if I want compare with a specific analyze thath is not the last one ?
I’m not sure I understand why you’d want to get an analysis result for an old analysis dynamically in GitLab CI. Let’s assume I don’t need to understand your use case. You might want to look at our web API, specifically api/project_analyses/search, which can be used to return prior quality gate results from earlier commits/analyses.
This is because you need to tell your gitlab pipeline to not allow failure.
Change this to false.
I’m not sure if you’ll succeed; we didn’t introduce GitLab CI support until SonarQube 8. But I believe the functionality here mostly depends upon the sonar-scanner CLI, and you appear to be running the latest, so try it anyhow.