【问题标题】:SonarQube 5.3 stopped analyzing Github pull requestsSonarQube 5.3 停止分析 Github 拉取请求
【发布时间】:2016-09-16 08:26:00
【问题描述】:

我们最近将 SonarQube 版本从 5.0 更新到 5.3,并将 SonarQube Scanner/Runner 从 2.3 更新到 2.4。

在此次升级期间,SonarQube 已停止分析我们的 GitHub 拉取请求。我们运行 SonarQube 扫描仪作为 jenkins 作业的最后一步。

我们运行的命令如下:

/usr/local/sonar-runner/bin/sonar-runner -Dsonar.analysis.mode=issues \
     -Dsonar.github.pullRequest=${ghprbPullId} \
     -Dsonar.github.repository=OurRepository/OurRepository \
     -Dsonar.github.login=MyUsername \
     -Dsonar.github.oauth=MyToken \
     -Dsonar.login=MyUsername \
     -Dsonar.password=MyPassword \
     -Dsonar.sources=./app/ \
     -Dsonar.projectKey=MyProject \
     -Dsonar.projectName=MyProject \
     -Dsonar.projectVersion=2.9.0 \
     -Dsonar.exclusions=app/Vendor/**,app/Plugin/**/Test/**,app/Test/**

我们在这次升级中唯一改变的是分析模式。升级前我们使用的是增量模式,在 5.2 中被移除了。

命令的输出如下:

+ /usr/local/sonar-runner/bin/sonar-runner -Dsonar.analysis.mode=issues -Dsonar.github.pullRequest=2944 -Dsonar.github.repository=OurRepository/OurRepository -Dsonar.github.login=Username -Dsonar.github.oauth=MyToken -Dsonar.login=MyUsername -Dsonar.password=MyPAsword -Dsonar.sources=./app/ -Dsonar.projectKey=MyProject -Dsonar.projectName=MyProject -Dsonar.projectVersion=2.9.0 '-Dsonar.exclusions=app/Vendor/**,app/Plugin/**/Test/**,app/Test/**'
SonarQube Runner 2.4
Java 1.7.0_101 Oracle Corporation (64-bit)
Linux 3.10.0-327.13.1.el7.x86_64 amd64
INFO: Runner configuration file: /usr/local/sonar-runner/conf/sonar-runner.properties
INFO: Project configuration file: /projectpath/sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: /projectpath/./.sonar
INFO: SonarQube Server 5.3
12:54:00.422 INFO  - Load global repositories
12:54:00.927 INFO  - Load global repositories (done) | time=505ms
12:54:00.988 INFO  - User cache: /projectpath/.sonar/cache
12:54:01.016 INFO  - Exclude plugins: devcockpit, jira, pdfreport, views, report, buildstability, buildbreaker, scmstats
12:54:01.417 INFO  - Load plugins index
12:54:01.431 INFO  - Load plugins index (done) | time=14ms
12:54:02.121 INFO  - Found project [MyProject] cache [Thu May 19 11:29:15 CEST 2016]
12:54:02.280 INFO  - Process project properties
12:54:02.723 INFO  - Load project repositories
12:54:03.461 INFO  - Load project repositories (done) | time=738ms
12:54:03.485 INFO  - Apply project exclusions
12:54:03.629 INFO  - Load quality profiles
12:54:04.348 INFO  - Load quality profiles (done) | time=719ms
12:54:04.357 INFO  - Load active rules
12:54:09.383 INFO  - Load active rules (done) | time=5026ms
12:54:09.401 INFO  - Issues mode
12:54:09.401 INFO  - Scanning only changed files
12:54:09.405 INFO  - -------------  Scan MyProject
12:54:10.217 INFO  - Language is forced to php
12:54:10.238 INFO  - Load server rules
12:54:11.104 INFO  - Load server rules (done) | time=866ms
12:54:11.233 INFO  - Base dir: /projectpath/workspace
12:54:11.233 INFO  - Working dir: /projectpath/.sonar
12:54:11.235 INFO  - Source paths: app
12:54:11.235 INFO  - Source encoding: UTF-8, default locale: en_US
12:54:11.236 INFO  - Index files
12:54:11.265 INFO  - Excluded sources: 
12:54:11.266 INFO  -   app/Vendor/**
12:54:11.266 INFO  -   app/Plugin/**/Test/**
12:54:11.266 INFO  -   app/Test/**
12:54:11.266 INFO  -   app/Test/**
12:54:11.266 INFO  - Included tests: 
12:54:11.266 INFO  -   app/Test/**
12:54:16.551 INFO  - 983 files indexed
12:54:16.552 INFO  - 12296 files ignored because of inclusion/exclusion patterns
12:54:16.661 INFO  - Quality profile for php: Sonar way
12:54:17.180 INFO  - JaCoCoSensor: JaCoCo report not found : /projectpath/target/jacoco.exec
12:54:17.183 INFO  - JaCoCoItSensor: JaCoCo IT report not found: /projectpath/target/jacoco-it.exec
12:54:17.220 INFO  - Sensor NoSonar and Commented out LOC Sensor
12:54:17.926 INFO  - Sensor NoSonar and Commented out LOC Sensor (done) | time=706ms
12:54:17.926 INFO  - Sensor Lines Sensor
12:54:18.161 INFO  - Sensor Lines Sensor (done) | time=235ms
12:54:18.162 INFO  - Sensor PHPSensor
12:54:18.894 INFO  - 509 source files to be analyzed
12:54:28.909 INFO  - 265/509 files analyzed, current file: /projectpath/MyFile.php
12:54:38.479 INFO  - Sensor PHPSensor (done) | time=20317ms
12:54:38.479 INFO  - Sensor PHPUnit Sensor
12:54:38.479 INFO  - 509/509 source files have been analyzed
12:54:38.480 INFO  - PHPUnit xml test report not found: app/junit-output.xml
12:54:38.480 INFO  - PHPUnit xml unit test coverage report not found: app/clover-coverage.xml
12:54:38.480 INFO  - No PHPUnit integration test coverage report provided (see 'sonar.php.coverage.itReportPath' property)
12:54:38.480 INFO  - No PHPUnit overall coverage report provided (see 'sonar.php.coverage.overallReportPath' property)
12:54:38.480 INFO  - Sensor PHPUnit Sensor (done) | time=1ms
12:54:38.480 INFO  - Load server issues
12:54:40.752 INFO  - Load server issues (done) | time=2272ms
12:54:40.753 INFO  - Performing issue tracking
12:54:43.215 INFO  - 1210/1210 components tracked
12:54:43.216 INFO  - ANALYSIS SUCCESSFUL
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
Total time: 45.188s
Final Memory: 7M/215M
INFO: ------------------------------------------------------------------------

有人知道为什么这次升级会阻止 SonarQube 扫描器评论/分析我们的拉取请求吗?

【问题讨论】:

    标签: sonarqube sonarqube-scan


    【解决方案1】:

    呃,我们忘记在我们的新 SonarQube 实例上安装 github 插件...

    命令输出应包括:

    开始分析拉取请求: https://github.com/Organization/OurRepository/pull/2940

    如果没有,您很可能缺少 github 插件。

    【讨论】:

      猜你喜欢
      • 2017-03-09
      • 2019-12-19
      • 2016-06-11
      • 2019-06-23
      • 2017-08-02
      • 2022-06-28
      • 2023-03-02
      • 1970-01-01
      • 2015-12-13
      相关资源
      最近更新 更多