Remove Sonar Integration (#4135)

Sonar has been removed from the build workflow. This PR removes all
configuration and code markings that were used to facilitate it.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
pull/4150/head
Danno Ferrin 2 years ago committed by GitHub
parent 1dd7357257
commit d0c71c3bdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      .circleci/config.yml
  2. 41
      .github/workflows/sonarcloud.yml
  3. 6
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  4. 13
      build.gradle
  5. 1
      util/src/main/java/org/hyperledger/besu/util/Slf4jLambdaHelper.java

@ -212,11 +212,6 @@ jobs:
command: |
./gradlew --no-daemon build
- capture_test_results
# Temporarily disabled
# - run:
# name: SonarQube
# no_output_timeout: 30m
# command: ./gradlew --no-daemon jacocoRootReport sonarqube -Dsonar.login=$SONAR_TOKEN
integrationTests:
executor: xl_machine_executor
@ -411,9 +406,7 @@ workflows:
- dco
- spotless
- unitTests:
# Temporarily disabled
# context: SonarCloud
requires:
requires:
- assemble
- testWindows:
requires:

@ -1,41 +0,0 @@
name: SonarCloud analysis
on:
push:
branches: [ "main", release* ]
# pull_request:
# branches: [ "main" ]
workflow_dispatch:
permissions:
pull-requests: read # allows SonarCloud to decorate PRs with analysis results
jobs:
Analysis:
runs-on: ubuntu-latest
steps:
- name: Analyze with SonarCloud
# You can pin the exact commit or the version.
# uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049
uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)
with:
# Additional arguments for the sonarcloud scanner
args:
# Unique keys of your project and organization. You can find them in SonarCloud > Information (bottom-left menu)
# mandatory
-Dsonar.projectKey=hyperledger_besu
-Dsonar.organization=hyperledger
# Comma-separated paths to directories containing main source files.
#-Dsonar.sources= # optional, default is project base directory
# When you need the analysis to take place in a directory other than the one from which it was launched
#-Dsonar.projectBaseDir= # optional, default is .
# Comma-separated paths to directories containing test source files.
#-Dsonar.tests= # optional. For more info about Code Coverage, please refer to https://docs.sonarcloud.io/enriching/test-coverage/overview/
# Adds more detail to both client and server-side analysis logs, activating DEBUG mode for the scanner, and adding client-side environment variables and system properties to the server-side log of analysis report processing.
#-Dsonar.verbose= # optional, default is false

@ -1190,7 +1190,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
"Maximum number of pending transaction hashes that will be kept in the transaction pool (default: ${DEFAULT-VALUE})",
arity = "1")
@SuppressWarnings("unused")
private final Integer pooledTransactionHashesSize = null; // NOSONAR
private final Integer pooledTransactionHashesSize = null;
@Option(
names = {"--tx-pool-retention-hours"},
@ -1906,7 +1906,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
"--privacy-flexible-groups-enabled");
}
if (txPoolOptionGroup.pooledTransactionHashesSize != null) { // NOSONAR
if (txPoolOptionGroup.pooledTransactionHashesSize != null) {
logger.warn(DEPRECATED_AND_USELESS_WARNING_MSG, "--tx-pool-hashes-max-size");
}
}
@ -2136,7 +2136,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
engineConfig.setAuthenticationEnabled(true);
engineConfig.setAuthenticationAlgorithm(JwtAlgorithm.HS256);
if (Objects.nonNull(engineRPCOptionGroup.engineJwtKeyFile)
&& java.nio.file.Files.exists(engineRPCOptionGroup.engineJwtKeyFile)) { // NOSONAR
&& java.nio.file.Files.exists(engineRPCOptionGroup.engineJwtKeyFile)) {
engineConfig.setAuthenticationPublicKeyFile(engineRPCOptionGroup.engineJwtKeyFile.toFile());
} else {
logger.info(

@ -28,21 +28,8 @@ plugins {
id 'me.champeau.jmh' version '0.6.6' apply false
id 'net.ltgt.errorprone' version '2.0.2'
id 'maven-publish'
id 'org.sonarqube' version '3.4.0.2513'
}
sonarqube {
properties {
property "sonar.projectKey", "hyperledger_besu"
property "sonar.organization", "hyperledger"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
property "sonar.coverage.exclusions", "acceptance-tests/**/*"
}
}
project.tasks["sonarqube"].dependsOn "jacocoRootReport"
if (!JavaVersion.current().java11Compatible) {
throw new GradleException("Java 11 or later is required to build Besu.\n" +
" Detected version ${JavaVersion.current()}")

@ -25,7 +25,6 @@ import org.slf4j.Logger;
*/
public class Slf4jLambdaHelper {
// sonar code smell
private Slf4jLambdaHelper() {}
public static void warnLambda(

Loading…
Cancel
Save