diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index c9ed59d625d..e7071716ac2 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -103,21 +103,6 @@ steps: build.env('BUILDKITE_PULL_REQUEST') != "false" && build.env('BUILDKITE_PIPELINE_SLUG') == "integrations" - - label: ":sonarqube: Continuous Code Inspection" - soft_fail: true # FIXME: Coverage is failing, remove this after solving the issue - timeout_in_minutes: 120 - env: - VAULT_SONAR_TOKEN_PATH: "kv/ci-shared/platform-ingest/elastic/integrations/sonar-analyze-token" - agents: - image: "docker.elastic.co/cloud-ci/sonarqube/buildkite-scanner:latest" - cpu: "8" - memory: "4G" - command: ".buildkite/scripts/run_sonar_scanner.sh" - artifact_paths: - - build/test-coverage/coverage_merged.xml - if: | - build.env('BUILDKITE_PIPELINE_SLUG') == "integrations" - - label: ":junit: Junit annotate" agents: # requires at least "bash", "curl" and "git" diff --git a/.buildkite/scripts/run_sonar_scanner.sh b/.buildkite/scripts/run_sonar_scanner.sh deleted file mode 100755 index e64a966c8c1..00000000000 --- a/.buildkite/scripts/run_sonar_scanner.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -source .buildkite/scripts/common.sh - -set -euo pipefail - -add_bin_path -with_mage - -run_sonar_scanner() { - local message="" - echo "--- Download coverage reports and merge them" - if ! buildkite-agent artifact download build/test-coverage/coverage-*.xml . ; then - message="Could not download XML artifacts. Skip coverage." - echo "--- :boom: ${message}" - buildkite-agent annotate \ - "[Code inspection] ${message}" \ - --context "ctx-sonarqube-no-files" \ - --style "warning" - exit 0 - fi - - echo "Merge all coverage reports" - mage mergeCoverage - - echo "--- Execute sonar scanner CLI" - /scan-source-code.sh -} - -if [[ "${PUBLISH_COVERAGE_REPORTS:-"false"}" == "true" ]]; then - echo "Enabled sonnar scanner by PUBLISH_COVERAGE_REPORTS variable (Pipeline ${BUILDKITE_PIPELINE_SLUG})" - run_sonar_scanner - exit 0 -fi - -if [[ "${BUILDKITE_PULL_REQUEST}" != "false" ]]; then - echo "Run sonar scanner from Pull Request (Pipeline ${BUILDKITE_PIPELINE_SLUG})" - run_sonar_scanner - exit 0 -fi - -echo "Skip coverage report" diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index 67e57b1fdaf..00000000000 --- a/sonar-project.properties +++ /dev/null @@ -1,15 +0,0 @@ -sonar.projectKey=elastic_integrations_AYu5LCaKQZlFqhqWIrk_ -sonar.host.url=https://sonar.elastic.dev -sonar.sources=packages - -sonar.log.level=INFO -sonar.sourceEncoding=UTF-8 - -# Coverage report created by elastic-package just reference to *.yml files -# Remove all these extensions to try to keep just *.yml files -sonar.exclusions=**/*.java,**/Dockerfile,**/*.tf,**/*.go,**/*.yaml,**/*.xml,**/*.md,**/*.jsp - -# Generic test coverage report format -# https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/test-coverage/generic-test-data/#generic-test-coverage -sonar.coverageReportPaths=build/test-coverage/coverage_merged.xml -