具有新 Branch 功能的 SonarQube 失败并显示 "a measure can be set only once for a specific Component"?
SonarQube with new Branch feature fails with "a measure can be set only once for a specific Component"?
正在试用 SonarQube 中更新的分支支持功能。
我 运行 遇到了一个我不明白的问题。
我将我们的 SonarQube 实例升级到了开发者版。在 Long living branches pattern 的分支配置下,我将其设置为 (develop|master) 因为我们正在使用 GitFlow 分支策略。
在升级到开发人员版本后,我在 Jenkins 作业中执行了以下操作,我在其中传递了项目密钥和名称。这工作正常,我得到了对显示的网站项目的分析。
C:\Jenkins\sitecore\develop>SonarScanner.MSBuild.exe" begin /d:sonar.login=******** /k:NEON /n:Website /v:Build#3-SHA#a37bc8060e8d5a4264140784b1f93c9a4ca80b43 /d:sonar.host.url=http://codeanalysis.remoteiv.dk /d:sonar.cs.nunit.reportsPaths=C:\Jenkins\sitecore\develop\NUnitResult.xml /d:sonar.cs.opencover.reportsPaths=C:\Jenkins\sitecore\develop\OpenCoverResult.xml
然后对于后续的 运行s Jenkins 使用 sonar.branch.name 属性 传递功能分支名称,如下所示。
C:\Jenkins\sitecore\feature-NEON-10-Setting-Up-Toll-Gate@2>SonarScanner.MSBuild.exe" begin /d:sonar.login=********** /k:NEON /n:Website /v:Build#5-SHA#2acea67103ab4b1223d80bf62d23999dd5369c29 /d:sonar.branch.name=feature-NEON-10-Setting-Up-Toll-Gate /d:sonar.host.url=http://codeanalysis.remoteiv.dk /d:sonar.cs.nunit.reportsPaths=C:\Jenkins\sitecore\feature-NEON-10-Setting-Up-Toll-Gate@2\NUnitResult.xml /d:sonar.cs.opencover.reportsPaths=C:\Jenkins\sitecore\feature-NEON-10-Setting-Up-Toll-Gate@2\OpenCoverResult.xml
Jenkins 的结束步骤说它成功了。
INFO: Sensor C# Unit Test Results Import [csharp] (done) | time=30ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=341ms
INFO: Sensor CPD Block Indexer
INFO: Sensor CPD Block Indexer (done) | time=1ms
INFO: Skipping CPD calculation for short living branch
INFO: Analysis report generated in 378ms, dir size=841 KB
INFO: Analysis reports compressed in 61ms, zip size=55 KB
INFO: Analysis report uploaded in 49ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://codeanalysis.remoteiv.dk/dashboard/index/NEON
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://codeanalysis.remoteiv.dk/api/ce/task?id=AWL3Sf5q5_IkahY6f6q6
INFO: Task total time: 1:02.311 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:04.661s
INFO: Final Memory: 23M/692M
但是分析说在服务器上失败了,声纳服务器上的分支视图下没有分支?
错误是。
{"task":{"id":"AWL3Sf5q5_IkahY6f6q6","type":"REPORT","componentId":"AWL3Mrk25_IkahY6f6qw","componentKey":"NEON","componentName":"Website","componentQualifier":"TRK","status":"FAILED","submittedAt":"2018-04-24T12:54:04+0200","submitterLogin":"jenkins","startedAt":"2018-04-24T12:54:05+0200","executedAt":"2018-04-24T12:54:15+0200","executionTimeMs":10155,"logs":false,"errorMessage":"a measure can be set only once for a specific Component (key=NEON:BRANCH:feature-NEON-10-Setting-Up-Toll-Gate), Metric (key=test_execution_time). Use update method (Visit failed for Component {key=NEON:BRANCH:feature-NEON-10-Setting-Up-Toll-Gate,type=PROJECT} )","hasScannerContext":true,"organization":"default-organization","branch":"feature-NEON-10-Setting-Up-Toll-Gate","branchType":"SHORT"}}
如有任何帮助,我们将不胜感激。
您面临以下将在下一版本的 SonarQube 中修复的错误:SONAR-9384
我发现的临时解决方法如下:
- 转到您的项目"Administration > General Settings"页面
- 搜索设置
sonar.cs.vstest.reportsPaths
- 指定一个哑值,例如
foo
这样,分析器就不会尝试保留单元测试信息,因此不会失败。缺点是您将没有单元测试措施 - 与根本没有分析相比,IMO 是完全可以接受的。
正在试用 SonarQube 中更新的分支支持功能。
我 运行 遇到了一个我不明白的问题。
我将我们的 SonarQube 实例升级到了开发者版。在 Long living branches pattern 的分支配置下,我将其设置为 (develop|master) 因为我们正在使用 GitFlow 分支策略。
在升级到开发人员版本后,我在 Jenkins 作业中执行了以下操作,我在其中传递了项目密钥和名称。这工作正常,我得到了对显示的网站项目的分析。
C:\Jenkins\sitecore\develop>SonarScanner.MSBuild.exe" begin /d:sonar.login=******** /k:NEON /n:Website /v:Build#3-SHA#a37bc8060e8d5a4264140784b1f93c9a4ca80b43 /d:sonar.host.url=http://codeanalysis.remoteiv.dk /d:sonar.cs.nunit.reportsPaths=C:\Jenkins\sitecore\develop\NUnitResult.xml /d:sonar.cs.opencover.reportsPaths=C:\Jenkins\sitecore\develop\OpenCoverResult.xml
然后对于后续的 运行s Jenkins 使用 sonar.branch.name 属性 传递功能分支名称,如下所示。
C:\Jenkins\sitecore\feature-NEON-10-Setting-Up-Toll-Gate@2>SonarScanner.MSBuild.exe" begin /d:sonar.login=********** /k:NEON /n:Website /v:Build#5-SHA#2acea67103ab4b1223d80bf62d23999dd5369c29 /d:sonar.branch.name=feature-NEON-10-Setting-Up-Toll-Gate /d:sonar.host.url=http://codeanalysis.remoteiv.dk /d:sonar.cs.nunit.reportsPaths=C:\Jenkins\sitecore\feature-NEON-10-Setting-Up-Toll-Gate@2\NUnitResult.xml /d:sonar.cs.opencover.reportsPaths=C:\Jenkins\sitecore\feature-NEON-10-Setting-Up-Toll-Gate@2\OpenCoverResult.xml
Jenkins 的结束步骤说它成功了。
INFO: Sensor C# Unit Test Results Import [csharp] (done) | time=30ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=341ms
INFO: Sensor CPD Block Indexer
INFO: Sensor CPD Block Indexer (done) | time=1ms
INFO: Skipping CPD calculation for short living branch
INFO: Analysis report generated in 378ms, dir size=841 KB
INFO: Analysis reports compressed in 61ms, zip size=55 KB
INFO: Analysis report uploaded in 49ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://codeanalysis.remoteiv.dk/dashboard/index/NEON
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://codeanalysis.remoteiv.dk/api/ce/task?id=AWL3Sf5q5_IkahY6f6q6
INFO: Task total time: 1:02.311 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:04.661s
INFO: Final Memory: 23M/692M
但是分析说在服务器上失败了,声纳服务器上的分支视图下没有分支?
错误是。
{"task":{"id":"AWL3Sf5q5_IkahY6f6q6","type":"REPORT","componentId":"AWL3Mrk25_IkahY6f6qw","componentKey":"NEON","componentName":"Website","componentQualifier":"TRK","status":"FAILED","submittedAt":"2018-04-24T12:54:04+0200","submitterLogin":"jenkins","startedAt":"2018-04-24T12:54:05+0200","executedAt":"2018-04-24T12:54:15+0200","executionTimeMs":10155,"logs":false,"errorMessage":"a measure can be set only once for a specific Component (key=NEON:BRANCH:feature-NEON-10-Setting-Up-Toll-Gate), Metric (key=test_execution_time). Use update method (Visit failed for Component {key=NEON:BRANCH:feature-NEON-10-Setting-Up-Toll-Gate,type=PROJECT} )","hasScannerContext":true,"organization":"default-organization","branch":"feature-NEON-10-Setting-Up-Toll-Gate","branchType":"SHORT"}}
如有任何帮助,我们将不胜感激。
您面临以下将在下一版本的 SonarQube 中修复的错误:SONAR-9384
我发现的临时解决方法如下:
- 转到您的项目"Administration > General Settings"页面
- 搜索设置
sonar.cs.vstest.reportsPaths
- 指定一个哑值,例如
foo
这样,分析器就不会尝试保留单元测试信息,因此不会失败。缺点是您将没有单元测试措施 - 与根本没有分析相比,IMO 是完全可以接受的。