Can not find master branch

I’ve create a branch name 'Sonarcould-Project and it showing properly as a ‘long lived branches’.

After run the pipeline on ‘master’&‘staging’ branch, I can not find any new branch on sonarcloud. There is no error on pipeline.

when I run the pipeline on ‘staging’ branch, it update to the ‘Sonarcloud-project’ branch.

Hi,

Sorry, but I’m not understanding. Could you post a screenshot?

 
Ann

After I run the pipeline for master branch, you only can see the update still on ‘sonarcloud-project’ branch.

Hi,

According to the analysis logs, did those other branch analyses succeed? Could they have been created as new projects in your organization?

 
Ann

Yes, the pipeline on bitbucket all succeed.
You can’t find other projects.

The pipeline running on any branch , the result will always be this ‘sonarcloud-project’.

Hi,

Can you share the analysis log?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Ann

Run the pipeline on staging branch, this is the screenshot…

Hi,

Please copy/paste the text of your analysis log.

 
Ann

+ umask 000

+ GIT_LFS_SKIP_SMUDGE=1 retry 6 git clone --branch="master" https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIR
Cloning into '/opt/atlassian/pipelines/agent/build'...

+ git reset --hard f7e744941a30fdc6f46f1430e25009830d2038f1
HEAD is now at f7e74494 Merged in staging (pull request #486)

+ git config user.name bitbucket-pipelines

+ git config user.email commits-noreply@bitbucket.org

+ git config push.default current

+ git config http.${BITBUCKET_GIT_HTTP_ORIGIN}.proxy http://localhost:29418/

+ git remote set-url origin http://bitbucket.org/$BITBUCKET_REPO_FULL_NAME

+ git reflog expire --expire=all --all

+ echo ".bitbucket/pipelines/generated" >> .git/info/exclude

+ chmod 777 $BUILD_DIR


Artifact "packages/sparkcstc-aem/apps/src/main/content/jcr_root/apps/settings/wcm/designs/sparkcstc/clientlib-ui/**": Downloading
Artifact "packages/sparkcstc-aem/apps/src/main/content/jcr_root/apps/settings/wcm/designs/sparkcstc/clientlib-ui/**": Downloaded 2.1 MiB in 0 seconds
Artifact "packages/sparkcstc-aem/apps/src/main/content/jcr_root/apps/settings/wcm/designs/sparkcstc/clientlib-ui/**": Extracting
Artifact "packages/sparkcstc-aem/apps/src/main/content/jcr_root/apps/settings/wcm/designs/sparkcstc/clientlib-ui/**": Extracted in 0 seconds

Cache "node: ui.frontend/node_modules": Downloading
Cache "node: ui.frontend/node_modules": Not found
Cache "sonar: ~/.sonar/cache": Downloading
Cache "sonar: ~/.sonar/cache": Downloaded 279.1 MiB in 6 seconds
Cache "sonar: ~/.sonar/cache": Extracting
Cache "sonar: ~/.sonar/cache": Extracted in 1 seconds

Default variables:
    BITBUCKET_BRANCH
    BITBUCKET_BUILD_NUMBER
    BITBUCKET_CLONE_DIR
    BITBUCKET_COMMIT
    BITBUCKET_GIT_HTTP_ORIGIN
    BITBUCKET_GIT_SSH_ORIGIN
    BITBUCKET_PIPELINE_UUID
    BITBUCKET_PROJECT_KEY
    BITBUCKET_PROJECT_UUID
    BITBUCKET_REPO_FULL_NAME
    BITBUCKET_REPO_IS_PRIVATE
    BITBUCKET_REPO_OWNER
    BITBUCKET_REPO_OWNER_UUID
    BITBUCKET_REPO_SLUG
    BITBUCKET_REPO_UUID
    BITBUCKET_SSH_KEY_FILE
    BITBUCKET_STEP_RUN_NUMBER
    BITBUCKET_STEP_TRIGGERER_UUID
    BITBUCKET_STEP_UUID
    BITBUCKET_WORKSPACE
    DOCKER_HOST
    PIPELINES_JWT_TOKEN

Repository variables:
    CI
    GITLAB_ACCESS_TOKEN
    SONAR_TOKEN

Images used:
    build : docker.io/library/maven@sha256:2d1abfdaa00326e66f33e8378db38ded41a3f0ce3ea973a3efa77cc0118652f9
+ 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=/usr/local/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-scan:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/sonarsource/sonarcloud-scan \
   --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_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=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_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-scan" \
   --env=EXTRA_ARGS="-Dsonar.organization=\"cstdev\" -Dsonar.projectKey=\"cst-portal-frontend\"  -Dsonar.exclusions=\"packages/sparkcstc-aem/**\"" \
   --env=SONAR_TOKEN="${SONAR_TOKEN}" \
   --add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
   sonarsource/sonarcloud-scan:1.4.0
Unable to find image 'sonarsource/sonarcloud-scan:1.4.0' locally
1.4.0: Pulling from sonarsource/sonarcloud-scan
743f2d6c1f65: Pulling fs layer
5c14188d0980: Pulling fs layer
84a54a21b0f2: Pulling fs layer
d9d1bc98b287: Pulling fs layer
c99e982badff: Pulling fs layer
50c6b4dfde57: Pulling fs layer
a561eaec2f8f: Pulling fs layer
ea88b09234a3: Pulling fs layer
83613aeae58d: Pulling fs layer
5d476eee175a: Pulling fs layer
3d3951d29cc9: Pulling fs layer
c99e982badff: Waiting
50c6b4dfde57: Waiting
ea88b09234a3: Waiting
83613aeae58d: Waiting
3d3951d29cc9: Waiting
d9d1bc98b287: Waiting
5d476eee175a: Waiting
84a54a21b0f2: Verifying Checksum
84a54a21b0f2: Download complete
5c14188d0980: Download complete
d9d1bc98b287: Download complete
c99e982badff: Download complete
743f2d6c1f65: Verifying Checksum
743f2d6c1f65: Download complete
ea88b09234a3: Download complete
a561eaec2f8f: Verifying Checksum
a561eaec2f8f: Download complete
5d476eee175a: Verifying Checksum
5d476eee175a: Download complete
743f2d6c1f65: Pull complete
50c6b4dfde57: Verifying Checksum
50c6b4dfde57: Download complete
3d3951d29cc9: Verifying Checksum
3d3951d29cc9: Download complete
5c14188d0980: Pull complete
83613aeae58d: Verifying Checksum
83613aeae58d: Download complete
84a54a21b0f2: Pull complete
d9d1bc98b287: Pull complete
c99e982badff: Pull complete
50c6b4dfde57: Pull complete
a561eaec2f8f: Pull complete
ea88b09234a3: Pull complete
83613aeae58d: Pull complete
5d476eee175a: Pull complete
3d3951d29cc9: Pull complete
Digest: sha256:8b3690666e34b17bbab84370e569151742f06f21575fbe05e5c066c160b7c968
Status: Downloaded newer image for sonarsource/sonarcloud-scan:1.4.0
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.3 Oracle Corporation (64-bit)
INFO: Linux 5.15.0-1028-aws amd64
INFO: Bitbucket Cloud Pipelines detected, no host variable set. Defaulting to sonarcloud.io.
INFO: User cache: /root/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 8.0.0.38480
INFO: Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=527ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: User cache: /root/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=530ms
INFO: Load/download plugins (done) | time=3782ms
INFO: Loaded core extensions: developer-scanner
INFO: Load project settings for component key: 'cst-portal-frontend'
INFO: Load project settings for component key: 'cst-portal-frontend' (done) | time=498ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=1ms
INFO: Project key: cst-portal-frontend
INFO: Base dir: /opt/atlassian/pipelines/agent/build
INFO: Working dir: /opt/atlassian/pipelines/agent/build/.scannerwork
INFO: Load project branches
INFO: Load project branches (done) | time=576ms
INFO: Check ALM binding of project 'cst-portal-frontend'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project 'cst-portal-frontend' (done) | time=484ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=481ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=2ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=580ms
INFO: Load active rules
INFO: Load active rules (done) | time=6303ms
INFO: Organization key: cstdev
INFO: Load project repositories
INFO: Load project repositories (done) | time=593ms
INFO: Indexing files...
INFO: Project configuration:
INFO:   Excluded sources: **/build-wrapper-dump.json, packages/sparkcstc-aem/**
INFO: 322 files indexed
INFO: 684 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for css: Sonar way
INFO: Quality profile for js: Sonar way
INFO: Quality profile for json: Sonar way
INFO: Quality profile for web: Sonar way
INFO: Quality profile for yaml: Sonar way
INFO: ------------- Run sensors on module cst-portal-frontend
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=497ms
INFO: Sensor cache enabled
INFO: Load sensor cache
INFO: Load sensor cache (716 KB) | time=1496ms
INFO: Sensor IaC CloudFormation Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=37ms
INFO: Sensor IaC Kubernetes Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Kubernetes Sensor [iac] (done) | time=17ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=3ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=16ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=88ms
INFO: Sensor TextAndSecretsSensor [text]
INFO: 314 source files to be analyzed
INFO: 314/314 source files have been analyzed
INFO: Sensor TextAndSecretsSensor [text] (done) | time=601ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=2ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=21ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=5ms
INFO: Sensor JavaScript analysis [javascript]
INFO: 173 source files to be analyzed
INFO: 95/173 files analyzed, current file: /opt/atlassian/pipelines/agent/build/packages/sparkcstc-ui/src/hocs/withBreakpoints.jsx
INFO: 173/173 source files have been analyzed
INFO: Hit the cache for 0 out of 173
INFO: Miss the cache for 173 out of 173: ANALYSIS_MODE_INELIGIBLE [173/173]
INFO: Sensor JavaScript analysis [javascript] (done) | time=19123ms
INFO: Sensor TypeScript analysis [javascript]
INFO: No input files found for analysis
INFO: Hit the cache for 0 out of 0
INFO: Miss the cache for 0 out of 0
INFO: Sensor TypeScript analysis [javascript] (done) | time=1ms
INFO: Sensor JavaScript inside YAML analysis [javascript]
INFO: No input files found for analysis
INFO: Hit the cache for 0 out of 0
INFO: Miss the cache for 0 out of 0
INFO: Sensor JavaScript inside YAML analysis [javascript] (done) | time=4ms
INFO: Sensor JavaScript inside HTML analysis [javascript]
INFO: 1 source file to be analyzed
INFO: 1/1 source file has been analyzed
INFO: Hit the cache for 0 out of 1
INFO: Miss the cache for 1 out of 1: ANALYSIS_MODE_INELIGIBLE [1/1]
INFO: Sensor JavaScript inside HTML analysis [javascript] (done) | time=23ms
INFO: Sensor CSS Rules [javascript]
INFO: 81 source files to be analyzed
INFO: 81/81 source files have been analyzed
INFO: Hit the cache for 0 out of 0
INFO: Miss the cache for 0 out of 0
INFO: Sensor CSS Rules [javascript] (done) | time=958ms
INFO: Sensor CSS Metrics [javascript]
INFO: Sensor CSS Metrics [javascript] (done) | time=119ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=17ms
INFO: Sensor IaC Docker Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=101ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 0 Serverless function entries were found in the project
INFO: 0 Serverless function handlers were kept as entrypoints
INFO: Sensor Serverless configuration file sensor [security] (done) | time=4ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=2ms
INFO: Sensor AWS SAM Inline template file sensor [security]
INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=2ms
INFO: Sensor javabugs [dbd]
INFO: Reading IR files from: /opt/atlassian/pipelines/agent/build/.scannerwork/ir/java
INFO: No IR files have been included for analysis.
INFO: Sensor javabugs [dbd] (done) | time=2ms
INFO: Sensor pythonbugs [dbd]
INFO: Reading IR files from: /opt/atlassian/pipelines/agent/build/.scannerwork/ir/python
INFO: No IR files have been included for analysis.
INFO: Sensor pythonbugs [dbd] (done) | time=1ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading type hierarchy from: /opt/atlassian/pipelines/agent/build/.scannerwork/ucfg2/java
INFO: Read 0 type definitions
INFO: No UCFGs have been included for analysis.
INFO: Sensor JavaSecuritySensor [security] (done) | time=3ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading type hierarchy from: /opt/atlassian/pipelines/agent/build/ucfg_cs2
INFO: Read 0 type definitions
INFO: No UCFGs have been included for analysis.
INFO: Sensor CSharpSecuritySensor [security] (done) | time=1ms
INFO: Sensor PhpSecuritySensor [security]
INFO: Reading type hierarchy from: /opt/atlassian/pipelines/agent/build/.scannerwork/ucfg2/php
INFO: Read 0 type definitions
INFO: No UCFGs have been included for analysis.
INFO: Sensor PhpSecuritySensor [security] (done) | time=0ms
INFO: Sensor PythonSecuritySensor [security]
INFO: Reading type hierarchy from: /opt/atlassian/pipelines/agent/build/.scannerwork/ucfg2/python
INFO: Read 0 type definitions
INFO: No UCFGs have been included for analysis.
INFO: Sensor PythonSecuritySensor [security] (done) | time=1ms
INFO: Sensor JsSecuritySensor [security]
INFO: Reading type hierarchy from: /opt/atlassian/pipelines/agent/build/.scannerwork/ucfg2/js
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /opt/atlassian/pipelines/agent/build/.scannerwork/ucfg2/js
INFO: 16:45:25.16237 Building Runtime Type propagation graph
INFO: 16:45:25.247485 Running Tarjan on 7487 nodes
INFO: 16:45:25.279762 Tarjan found 7484 components
INFO: 16:45:25.316672 Variable type analysis: done
INFO: 16:45:25.319087 Building Runtime Type propagation graph
INFO: 16:45:25.453858 Running Tarjan on 7487 nodes
INFO: 16:45:25.468064 Tarjan found 7484 components
INFO: 16:45:25.496551 Variable type analysis: done
INFO: Analyzing 840 ucfgs to detect vulnerabilities.
INFO: Taint analysis starting. Entrypoints: 174
INFO: Running symbolic analysis for 'JS'
INFO: Taint analysis: done.
INFO: Sensor JsSecuritySensor [security] (done) | time=3457ms
INFO: ------------- Run sensors on project
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=1ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=32ms
INFO: CPD Executor 28 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 146 files
INFO: CPD Executor CPD calculation finished (done) | time=55ms
INFO: Analysis report generated in 156ms, dir size=1 MB
INFO: Analysis report compressed in 585ms, zip size=654 KB
INFO: Analysis report uploaded in 1224ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=cst-portal-frontend
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 https://sonarcloud.io/api/ce/task?id=AYaoXURgGI6FVSOuc2xz
INFO: Sensor cache published successfully
INFO: Time spent writing ucfgs 478ms
INFO: Analysis total time: 50.614 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:01.112s
INFO: Final Memory: 102M/368M
INFO: ------------------------------------------------------------------------
e[32m✔ SonarCloud analysis was successful.e[0m

+ 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=/usr/local/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_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=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_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.6
Unable to find image 'sonarsource/sonarcloud-quality-gate:0.1.6' locally
0.1.6: Pulling from sonarsource/sonarcloud-quality-gate
7d63c13d9b9b: Pulling fs layer
7c9d54bd144b: Pulling fs layer
a7f085de2052: Pulling fs layer
9027970cef28: Pulling fs layer
97a32a5a9483: Pulling fs layer
64c7eb061745: Pulling fs layer
3a5b08312a6b: Pulling fs layer
54698e5bc8b2: Pulling fs layer
9027970cef28: Waiting
97a32a5a9483: Waiting
64c7eb061745: Waiting
3a5b08312a6b: Waiting
54698e5bc8b2: Waiting
a7f085de2052: Verifying Checksum
a7f085de2052: Download complete
7c9d54bd144b: Verifying Checksum
7c9d54bd144b: Download complete
9027970cef28: Verifying Checksum
9027970cef28: Download complete
7d63c13d9b9b: Verifying Checksum
7d63c13d9b9b: Download complete
64c7eb061745: Verifying Checksum
64c7eb061745: Download complete
97a32a5a9483: Download complete
3a5b08312a6b: Verifying Checksum
3a5b08312a6b: Download complete
54698e5bc8b2: Verifying Checksum
54698e5bc8b2: Download complete
7d63c13d9b9b: Pull complete
7c9d54bd144b: Pull complete
a7f085de2052: Pull complete
9027970cef28: Pull complete
97a32a5a9483: Pull complete
64c7eb061745: Pull complete
3a5b08312a6b: Pull complete
54698e5bc8b2: Pull complete
Digest: sha256:3d2b48985ba09eb96efeb3bca06fd1b23cccf5d4ee792d532177d55ec15b1032
Status: Downloaded newer image for sonarsource/sonarcloud-quality-gate:0.1.6
e[32m✔ Quality Gate passede[0m

Assembling contents of new cache 'node'
You already have a 'sonar' cache so we won't create it again
Searching for files matching artifact pattern .bitbucket/pipelines/generated/pipeline/pipes/**
Artifact pattern .bitbucket/pipelines/generated/pipeline/pipes/** matched 1 files with a total size of 10.4 KiB
Compressed files matching artifact pattern .bitbucket/pipelines/generate

Hi,

Thanks for this.

Can you help me understand what’s going on in your checkout?

I see that you’re checking out master and then you reset to a specific commit hash (in master?). And then you analyze.

Since you’re not checking out a branch, it’s not surprising that you wouldn’t see a branch analysis in SonarCloud.

Analysis picks up branch and PR data from the env, but there’s nothing to pick up here, as far as I can tell.

 
Ann

This is a merge from staging to master branch, we’ve the pipeline to run the build,then do the snoarscan.
The merge will trigger the sonarscan.

There are two Monorepos projects connect with one bitbucket project, which token should setup in bitbucket?

After re-setup Sonarcloud, one of the project still only showing ‘master’ branch.

Hi,

Please create a new thread for a new question.

 
Ann

It’s the same question.

Hi,

You have a monorepo with two projects. One of the projects only shows master branch. According to the thread above, that’s all you ever analyze, so I still don’t understand the question.

What do tokens have to do with it?

 
Ann

  1. We used ‘monorepo’ and setup 2 projects : xxx-frontend & xxx-backend.
    one token for ‘xxx-fontend’ and another token is for ‘xxx-backend’
  2. We setup the ‘xxx-fontend’ token on bitbucket.
  3. We did pull request from ‘one dev’ branch to ‘staging’ branch, but only showing ‘master’ branch on SonarCloud for ‘xxx-fontend’
  4. ‘xxx-backend’ showing the branch with long-live, short-live branch properly.

Hi,

Please share the full job log including the analysis log.

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Ann

We’ve found the solution, add ‘-Dsonar.branch.name=$BITBUCKET_BRANCH’ to pipeline command to force the branch name. I thought the reason is we set the bitbucket with ‘CI=false’.