Hi All,
We have sonar analysis in place for our GitHub action pipelines
using jest unit test cases which generates code coverage report.
Our branching strategy is we create pull requests out of develop
branch ,perform sonar analysis for PR then merge feature branches
into develop. While promotion to higher environments, we create
another PR from develop to main execute sonar analysis for PR
and merge to main. Everything is automated in CICD manner via
github pipelines
Problem:
When we created the PR from develop to main ,sonar quality gate
checks fail for one of sonar repository. However ,sonar quality gates
until develop are all success for similar repository. This is unclear
as why it is failing as we are promoting same tested code from
develop to main.Can you please help us over here?
Version: Sonar Qube Developer Edition Version 8.9.6 (build 50800)
develop,main : These are set as branches
New code analysis : Previous version : The New Code will be based on the analysis following the previous version for all branches
Sonar Arguments passed via pipeline run :
-Dsonar.scm.exclusions.disabled=true
-Dsonar.projectVersion=1.0
-Dsonar.ws.timeout=600
-Dsonar.sourceEncoding=UTF-8
-Dsonar.qualitygate.timeout=500
-Dsonar.scm.provider=git
-Dsonar.projectKey=XXX
-Dsonar.scm.forceReloadAll=true
-Dsonar.javascript.file.suffixes=.js,.jsx
-Dsonar.typescript.file.suffixes=.ts,.tsx
-Dsonar.typescript.ignoreHeaderComments=true
-Dsonar.lang.patterns.ts=**/*.tsx,**/*.ts
-Dsonar.lang.patterns.js=**/*.jsx,**/*.js
-Dsonar.javascript.coveragePlugi`Preformatted text`n=lcov
-Dsonar.sources=${{ steps.sonar-scan-component.outputs.sonar_scan_comp}}
-Dsonar.tests=${{ steps.sonar-scan-component.outputs.sonar_scan_comp}}
-Dsonar.exclusions=**/node_modules/*,coverage/*,coverage/**,**/*.html,**/*.js,**/*.jsx,**/*.json,**/*-e2e/*
-Dsonar.test.inclusions=**/*.spec.*
-Dsonar.cpd.typescript.minimumLines=10
-Dsonar.cpd.typescript.minimumTokens=100
-Dsonar.javascript.lcov.reportPaths=/github/workspace/coverage/${{ steps.sonar-scan-component.outputs.sonar_scan_comp}}/lcov.info
Adding one more point, baseline for the newcode on
develop(its newer date)
and main(is older date) ,however its same for all
the repositories where
few are passing and few are failing. If this makes
failure for develop–>main merge then, it should fail for all
sonar repos?