【问题标题】:We dont want to merge pull requests with a failed quality gate on TFS我们不想将拉取请求与 TFS 上的失败质量门合并
【发布时间】:2019-07-16 05:45:04
【问题描述】:

使用过的软件:

  1. SonarQube 7.6
  2. nuget dotnet-sonarscanner https://www.nuget.org/packages/dotnet-sonarscanner,
  3. TFS 本地化

我们正在使用来自 nuget 的 SonarQube 和 dotnet-sonarscanner,效果很好。 很遗憾,我们无法将有关声纳扫描和质量门的信息返回到 TFS。

如果没有通过质量门,我们希望阻止合并 PullRequest。我知道如果质量门被打破,你不想再破坏构建。

我在文档 (https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS) 上找到了一些东西,但我没有找到提到的设置,例如“管理 -> 常规设置 -> 拉取请求”

背景是我们在 docker 构建中使用 sonarqube 扫描仪:

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"

【问题讨论】:

    标签: tfs sonarqube sonarscanner


    【解决方案1】:

    如果没有通过质量门,我们希望防止合并 PullRequest。

    然后有失败的质量门使构建失败。

    我了解到,如果质量门被打破,你不想再破坏构建。

    为什么不呢?你是说你确实希望质量门成为一个障碍,所以它应该会导致构建失败。

    【讨论】:

    • 对不起,我对“我理解你不想破坏构建”的评论是因为如果质量门被打破,声纳库团队决定不再破坏构建。 “然后有失败的质量门使构建失败”这怎么可能。这正是我想要的
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-06-23
    • 2014-04-07
    • 2018-11-11
    • 2016-03-13
    • 1970-01-01
    • 2019-02-18
    • 2017-04-11
    相关资源
    最近更新 更多