Template for a good new topic, formatted with Markdown:
-
ALM used: Bitbucket Cloud
-
CI system used: Bitbucket Cloud
-
Languages of the repository: Ruby
-
Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
Sonarcloud-scan pipe passes and I can see the test coverege from the developer is above the threshold configured in the sonarcloud quality gate and profiles.
I can’t see why this is not working, I’ve tried many configurations and they all fail in the quality gate pipe. We have a paid plan up to date with enough lines of code available.
pipe: sonarsource/sonarcloud-quality-gate:0.1.4
9s
+ docker container run \
--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \
--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \
--volume=/opt/atlassian/pipelines/bin/docker:/usr/local/bin/docker:ro \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/sonarsource/sonarcloud-quality-gate:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/sonarsource/sonarcloud-quality-gate \
--workdir=$(pwd) \
--label=org.bitbucket.pipelines.system=true \
--env=BITBUCKET_STEP_TRIGGERER_UUID="$BITBUCKET_STEP_TRIGGERER_UUID" \
--env=BITBUCKET_REPO_FULL_NAME="$BITBUCKET_REPO_FULL_NAME" \
--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \
--env=BITBUCKET_PROJECT_UUID="$BITBUCKET_PROJECT_UUID" \
--env=BITBUCKET_REPO_IS_PRIVATE="$BITBUCKET_REPO_IS_PRIVATE" \
--env=BITBUCKET_WORKSPACE="$BITBUCKET_WORKSPACE" \
--env=BITBUCKET_SSH_KEY_FILE="$BITBUCKET_SSH_KEY_FILE" \
--env=BITBUCKET_PR_DESTINATION_COMMIT="$BITBUCKET_PR_DESTINATION_COMMIT" \
--env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \
--env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \
--env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \
--env=BITBUCKET_PROJECT_KEY="$BITBUCKET_PROJECT_KEY" \
--env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \
--env=CI="$CI" \
--env=BITBUCKET_PR_ID="$BITBUCKET_PR_ID" \
--env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \
--env=BITBUCKET_STEP_RUN_NUMBER="$BITBUCKET_STEP_RUN_NUMBER" \
--env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \
--env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \
--env=BITBUCKET_PIPELINE_UUID="$BITBUCKET_PIPELINE_UUID" \
--env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \
--env=BITBUCKET_PR_DESTINATION_BRANCH="$BITBUCKET_PR_DESTINATION_BRANCH" \
--env=BITBUCKET_CLONE_DIR="$BITBUCKET_CLONE_DIR" \
--env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \
--env=BITBUCKET_STEP_UUID="$BITBUCKET_STEP_UUID" \
--env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \
--env=DOCKER_HOST="tcp://host.docker.internal:2375" \
--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \
--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/sonarsource/sonarcloud-quality-gate" \
--env=SONAR_TOKEN="${SONAR_TOKEN}" \
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
sonarsource/sonarcloud-quality-gate:0.1.4
Unable to find image 'sonarsource/sonarcloud-quality-gate:0.1.4' locally
0.1.4: Pulling from sonarsource/sonarcloud-quality-gate
d121f8d1c412: Pulling fs layer
ca572574cc82: Pulling fs layer
2bec6349c99d: Pulling fs layer
087ac0b72728: Pulling fs layer
6ca52d7c92b3: Pulling fs layer
f8f3658cfe37: Pulling fs layer
44dfc5bf09c4: Pulling fs layer
4cd0692f4960: Pulling fs layer
087ac0b72728: Waiting
6ca52d7c92b3: Waiting
f8f3658cfe37: Waiting
44dfc5bf09c4: Waiting
4cd0692f4960: Waiting
2bec6349c99d: Verifying Checksum
2bec6349c99d: Download complete
ca572574cc82: Verifying Checksum
ca572574cc82: Download complete
087ac0b72728: Verifying Checksum
087ac0b72728: Download complete
f8f3658cfe37: Verifying Checksum
f8f3658cfe37: Download complete
6ca52d7c92b3: Verifying Checksum
6ca52d7c92b3: Download complete
d121f8d1c412: Verifying Checksum
d121f8d1c412: Download complete
44dfc5bf09c4: Download complete
4cd0692f4960: Verifying Checksum
4cd0692f4960: Download complete
d121f8d1c412: Pull complete
ca572574cc82: Pull complete
2bec6349c99d: Pull complete
087ac0b72728: Pull complete
6ca52d7c92b3: Pull complete
f8f3658cfe37: Pull complete
44dfc5bf09c4: Pull complete
4cd0692f4960: Pull complete
Digest: sha256:fefdf81312845d1773ec5dbb285f1628025f1496bda7a92e1d9f5f9994999a96
Status: Downloaded newer image for sonarsource/sonarcloud-quality-gate:0.1.4
✖ Quality Gate failed
- Coverage on New Code: 0.0 (is less than 60)
* Steps to reproduce
- step: &sonarcloud
name: Analyze on SonarCloud
caches:
- sonar
- node # Use the node cache
artifacts:
- coverage/**
- test-reports/**
script:
- pipe: sonarsource/sonarcloud-scan:2.0.0
variables:
EXTRA_ARGS: -Dproject.settings=\"./sonar-scanner.properties\" # I also tried -Dproject.settings="./sonar-scanner.properties" but that doens't fix the issue either.
SONAR_TOKEN: $SONAR_TOKEN
- pipe: sonarsource/sonarcloud-quality-gate:0.1.4
services:
- docker
# I've also added the following as a separate step but that fails with the same error message in the build logs.
- step: &check-quality-gate-sonarcloud
name: Check the Quality Gate on SonarCloud
script:
- pipe: sonarsource/sonarcloud-quality-gate:0.1.4