Does the incremental scan work with the bitbucket pipe?

This is just a general question

I am wondering if this

works with the bitbucket pipelines sonarcloud pipe?
https://bitbucket.org/sonarsource/sonarcloud-scan/src/master/

as we use this pipe in all our pipelines to scan our repos and unfortunately none of the scans are faster since this update even though the cache is enabled

Hello,

It’s expected to work whatever the CI, or DevOps platforms you are using but only for PR analyses.

Can you share more details about your projects (languages, sizes), the execution times you are observing, and the logs of a PR analysis so we can start to understand what’s going wrong?

Thanks
Alex

Hi @Alexandre_Gigleux,

Thanks for the reply. These are the logs for our sonar scan step of our bitbucket pipeline we run for pull requests.
sonar_pipeline_step.txt (37.4 KB)

The project is a large JS/TS project that takes around 10mins to scan.

This is the sonar step part of out bitbucket-pipelines.yaml file that runs on pull requests below

    - step: &Sonar
        name: 🛰️ Sonar 0️⃣0️⃣0️⃣
        size: 2x
        clone:
          lfs: true
          depth: full
        services:
          - docker-huge-ram
        caches:
          - sonar
          - docker
        script:
          - npx lcov-result-merger 'coverage/lcov_*.info' 'coverage/lcov.info'
          # - sonar-scanner -Dsonar.login=$SONAR_TOKEN doesnt work with qualitygate pipe
          - pipe: sonarsource/sonarcloud-scan:1.4.0
            variables:
              SONAR_TOKEN: $SONAR_TOKEN # Optional
          # looking for EXTRA_ARGS ? go to sonar-project.properties
          - pipe: sonarsource/sonarcloud-quality-gate:0.1.6
          # To use this pipe you must have the SonarCloud Scan pipe earlier in the pipeline.

Thanks for the details.

The good news is that I can see in the logs some entries related to the cache mechanism.
The bad news is that there is this log:

INFO: Load sensor cache
INFO: Load sensor cache (404) | time=489ms

… that I interpret as: the cache can’t be downloaded, is not available. This explains why you have these logs and you don’t see any performance improvements:

Hit the cache for 0 out of 4447
Miss the cache for 4447 out of 4447: FILE_CHANGED

Can you confirm your main branch was scanned recently?

Thanks @Alexandre_Gigleux - this could 100% it. I don’t think the main branch has been scanned in a long time. I will give it a go and then get back to you.

Scanning our main (development) branch resolved the issue @Alexandre_Gigleux! It just hadn’t been scanned directly in forever so there was no cache to compare against. Thanks for the help :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.