简体   繁体   中英

sonar QualityGate Should be Checked before SVN Commit— How to achive this?

QualityGate Should be Checked before SVN Commit

I have to check sonar quality gate before SVN commit, Quality gate should check before code commit into SVN repository only,

Can you suugest any suitable aproach.

What you're asking for is not practical, but you can get the same effective result by redesigning your branch and build architecture.

If we were using git, the solution would include the following elements:

When developers first implement changes, they do it on a feature branch and create a "pull request" for that branch. The pull request is reviewed by humans, but when the pull request is created, an automated build starts in the CI server, which also runs the SonarQube scan. The quality gate in SonarQube specifies that particular quality thresholds have to be satisfied. If they are not satisfied, then the scan is marked as failed, and that also causes the pull request build to be marked as failed.

In the central git repository (BitBucket, for instance), the repository can be configured so that pull requests cannot be merged to a target branch if they don't have a successful build.

With these elements, code that does not satisfy the SonarQube quality gates cannot be merged to the target branch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM