MR decoration of scans with results in Gitlab not shown
Added configuration and Gitlab integration, results added to sonarcube but i dont see MR’s decorated
gitlab-ci.yml
sonarqube-check:
stage: test
<<: *ci_img
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
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script: gradle sonarqube -Dsonar.qualitygate.wait=true
allow_failure: true
build.gradle
plugins {
id 'java'
id 'checkstyle'
id "org.sonarqube" version "3.4.0.2513"
}
sonarqube {
properties {
property "sonar.projectKey", "xxxxxxx"
property "sonar.qualitygate.wait", true
}
}
$ gradle sonarqube -Dsonar.qualitygate.wait=true
Welcome to Gradle 6.8.3!
Here are the highlights of this release:
- Faster Kotlin DSL script compilation
- Vendor selection for Java toolchains
- Convenient execution of tasks in composite builds
- Consistent dependency resolution
For more details see https://docs.gradle.org/6.8.3/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* Where:
Build file '/builds/prismacloud/iam/pcs-iam-ingestion/build.gradle' line: 18
* What went wrong:
A problem occurred evaluating root project 'prisma-iam-ingestion'.
> No signature of method: build_xxxxxx.sonarqube() is applicable for argument types: (build_xxxxx$_run_closure1) values: [build_xxxxx$_run_closure1@3a931fcd]
Hi i now get the job run successfully but with no mr decoration still:
sonarqube-check:
stage: test
<<: *ci_img
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
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- export JAVA_OPTS="-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError"
- gradle sonarqube -Dsonar.qualitygate.wait==true -Dsonar.qualitygate.timeout=1000
allow_failure: true
tags:
- k8sdev-app
- eks
> Task :sonarqube
Unresolved imports/types have been detected during analysis. Enable DEBUG mode to see them.
Use of preview features have been detected during analysis. Enable DEBUG mode to see them.
Use of preview features have been detected during analysis. Enable DEBUG mode to see them.
Unresolved imports/types have been detected during analysis. Enable DEBUG mode to see them.
Use of preview features have been detected during analysis. Enable DEBUG mode to see them.
Use of preview features have been detected during analysis. Enable DEBUG mode to see them.
BUILD SUCCESSFUL in 9m 14s
11 actionable tasks: 11 executed
Saving cache for successful job
00:07
Creating cache sonarqube-check-5-non_protected...
.sonar/cache: found 145 matching files and directories
No URL provided, cache will be not uploaded to shared cache server. Cache will be stored only locally.
Created cache
Cleaning up project directory and file based variables
00:00
Job succeeded
Can you confirm that the required details are set for GitLab Integration at the project-level? You can check in the project-level Project Settings > General Settings > DevOps Platform Integration
Did everything that is mentioned in the Doc Passed the Env of the SONAR_TOKEN and the URL variables through the CI
Also added the app and the scan config to gitlab-ci.yaml
Configured the global integration and projects were added also.
We are using gitlab runners
In Project setting Devops integration:
I see we have a Configuration name with the url of the api and i have a project key also when i click test configuration
i get configuration is valid
Any suggestions on how we can resolve this issue ?
Shallow clone detected during the analysis. Some files will miss SCM information. This will affect features like auto-assignment of issues. Please configure your build to disable shallow clone.