Feature Branch Showing Bugs, Vulnerability and code smells in my PR that I haven’t touched

Hi Team,

It would be better if I get some support on this issue. we are still stuck here.

Ramesh

Finally the issue was at the Jenkins command that we tried the following scanner way

export PR_DETAILS=" -Dsonar.pullrequest.branch=$SRC_BRANCH -Dsonar.pullrequest.key=$PR_NUMBER -Dsonar.pullrequest.base=$TGT_BRANCH -Dsonar.pullrequest.provider=vsts -Dsonar.pullrequest.vsts.instanceUrl=${VSTS_PROVIDER} -Dsonar.host.url=$SERVER_URL"

sonar-scanner $PR_DETAILS

Unfortunately the above doesn’t workout well with delta analysis and moved to Gradle property execution and its working fine:

export PR_DETAILS="
-PpullRequestId=$PR_NUMBER 
-PbaseBranchName=$PR_BASE_BRANCH 
-PtargetBranchName=$SRC_BRANCH"

bash ./gradlew sonarqube ${PR_DETAILS}

Sonar gradle file

 property "sonar.pullrequest.branch", project.properties.get("targetBranchName")
 property "sonar.pullrequest.key", project.properties.get("pullRequestId")
 property "sonar.pullrequest.base", project.properties.get("baseBranchName")
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.