简体   繁体   English

我们不想将拉取请求与TFS上的质量门失败合并

[英]We dont want to merge pull requests with a failed quality gate on TFS

used software: 二手软件:

  1. SonarQube 7.6 SonarQube 7.6
  2. nuget dotnet-sonarscanner https://www.nuget.org/packages/dotnet-sonarscanner , nuget dotnet-sonarscanner https://www.nuget.org/packages/dotnet-sonarscanner
  3. TFS on prem TFS上班

We are using SonarQube and the dotnet-sonarscanner from nuget which works great. 我们使用的是SonarQube和nuget的dotnet-sonarscanner,效果很好。 Unfortunately, we are not able to get the information about the sonarqube scan and quality gates back to TFS. 不幸的是,我们无法将有关声纳波扫描和质量门的信息返回给TFS。

We want to prevent PullRequests from being merged if the quality gate is not passed. 如果质量门未通过,我们要防止PullRequests合并。 I understood that you don't want to break the build anymore if the quality gate is broken. 我知道,如果质量门被打破,您就不再希望破坏构建。

I found something on the documentation ( https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS ) but I am not finding the mentioned settings like “Administration -> General Settings -> Pull Requests” 我在文档中找到了一些东西( https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS ),但是找不到诸如“管理->常规设置”之类的设置->拉取请求”

The background is that we use the sonarqube scanner within our docker builds: 背景是我们在Docker构建中使用了声纳扫描仪:

dotnet tool install --global dotnet-sonarscanner --version 4.4.2
apt-get -yqq update && apt-get -yqq install openjdk-8-jre-headless > /dev/null


dotnet-sonarscanner begin /k:$BUILD_NAME /d:sonar.host.url="$SONAR_HOST" /d:sonar.login="$SONAR_LOGIN" /d:sonar.exclusions="**/bin/**/*,**/obj/**/*" /d:sonar.cs.opencover.reportsPaths=/src/opencover.xml /v:$BUILD_ID


dotnet build $UNITTEST_PROJECT
coverlet $UNITTEST_ASSEMBLY --target "dotnet" --targetargs "test $UNITTEST_PROJECT --no-build" --output /src/opencover.xml --format opencover
dotnet publish $PROJECT -c Release -o /app


dotnet-sonarscanner end /d:sonar.login="$SONAR_LOGIN"

We want to prevent PullRequests from being merged if the quality gate is not passed. 如果质量门未通过,我们要防止PullRequests合并。

Then have failing quality gates fail the build. 然后,质量门失败会使构建失败。

I understood that you don't want to break the build anymore if the quality gate is broken. 我知道,如果质量门被打破,您就不再希望破坏构建。

Why not? 为什么不? You're saying that you do want the quality gate to be a blocker, so it should cause the build to fail. 您的意思是您确实希望质量门成为障碍,所以它应该导致构建失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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