How to fail pipeline when SonarCloudAnalyze has an error on Azure DevOps

We’re using the SonarCloudAnalyze@1 task on Azure Pipelines with the CLI scanner for analyzing a TypeScript project. When during the analysis an error occurs (e.g. code uses TypeScript 5, which is currently not supported) the pipeline does not fail.

How can we fail the SonarCloudAnalyze task in case of an error in the analyzer?

Hi,

Can you share the log of the job that didn’t fail but should have?

 
Ann

Is there a way to share log in a non-public way?

Hi,

Feel free to redact as necessary.

 
Ann

Here is the redacted log:

2023-06-14T16:08:52.9565071Z ##[section]Starting: Run SonarCloud analysis
2023-06-14T16:08:52.9571641Z ==============================================================================
2023-06-14T16:08:52.9571810Z Task         : Run Code Analysis
2023-06-14T16:08:52.9571920Z Description  : Run scanner and upload the results to the SonarCloud server.
2023-06-14T16:08:52.9572025Z Version      : 1.39.0
2023-06-14T16:08:52.9572110Z Author       : sonarsource
2023-06-14T16:08:52.9572218Z Help         : Version: 1.39.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

[More Information](https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarcloud-extension-for-azure-devops/)
2023-06-14T16:08:52.9572485Z ==============================================================================
2023-06-14T16:08:54.1313878Z [command]/__w/_tasks/SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1/1.39.0/sonar-scanner/bin/sonar-scanner
2023-06-14T16:08:54.2286157Z INFO: Scanner configuration file: /__w/_tasks/SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1/1.39.0/sonar-scanner/conf/sonar-scanner.properties
2023-06-14T16:08:54.2302076Z INFO: Project root configuration file: NONE
2023-06-14T16:08:54.2723572Z INFO: SonarScanner 4.8.0.2856
2023-06-14T16:08:54.2724201Z INFO: Java 17.0.7 Eclipse Adoptium (64-bit)
2023-06-14T16:08:54.2724575Z INFO: Linux 5.15.0-1038-azure amd64
2023-06-14T16:08:54.5744795Z INFO: User cache: /home/AzDevOps_azpcontainer/.sonar/cache
2023-06-14T16:08:56.2143477Z INFO: Analyzing on SonarCloud
2023-06-14T16:08:56.2148020Z INFO: Default locale: "en_US", source code encoding: "US-ASCII" (analysis is platform dependent)
2023-06-14T16:08:56.7289012Z INFO: Load global settings
2023-06-14T16:08:56.9097146Z INFO: Load global settings (done) | time=183ms
2023-06-14T16:08:56.9138125Z INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
2023-06-14T16:08:56.9277103Z INFO: User cache: /home/AzDevOps_azpcontainer/.sonar/cache
2023-06-14T16:08:56.9348407Z INFO: Load/download plugins
2023-06-14T16:08:56.9348663Z INFO: Load plugins index
2023-06-14T16:08:57.0545565Z INFO: Load plugins index (done) | time=120ms
2023-06-14T16:09:00.7079860Z INFO: Load/download plugins (done) | time=3773ms
2023-06-14T16:09:01.2158255Z INFO: Loaded core extensions: developer-scanner
2023-06-14T16:09:01.8013975Z INFO: Found an active CI vendor: 'Azure DevOps'
2023-06-14T16:09:01.8195313Z INFO: Load project settings for component key: '***'
2023-06-14T16:09:01.9393991Z INFO: Load project settings for component key: '***' (done) | time=96ms
2023-06-14T16:09:01.9394271Z INFO: Process project properties
2023-06-14T16:09:01.9439431Z INFO: Execute project builders
2023-06-14T16:09:01.9458198Z INFO: Execute project builders (done) | time=2ms
2023-06-14T16:09:01.9509751Z INFO: Project key: ***
2023-06-14T16:09:01.9515542Z INFO: Base dir: /__w/2/s
2023-06-14T16:09:01.9521475Z INFO: Working dir: /__w/2/s/.scannerwork
2023-06-14T16:09:02.4244740Z INFO: Load project branches
2023-06-14T16:09:02.5669055Z INFO: Load project branches (done) | time=142ms
2023-06-14T16:09:02.5709055Z INFO: Check ALM binding of project '***'
2023-06-14T16:09:02.6814806Z INFO: Detected project binding: BOUND
2023-06-14T16:09:02.6819066Z INFO: Check ALM binding of project '***' (done) | time=111ms
2023-06-14T16:09:02.6936641Z INFO: Load project pull requests
2023-06-14T16:09:03.2129308Z INFO: Load project pull requests (done) | time=518ms
2023-06-14T16:09:03.2161864Z INFO: Load branch configuration
2023-06-14T16:09:04.8293639Z INFO: Load branch configuration (done) | time=1613ms
2023-06-14T16:09:04.8709338Z INFO: Load quality profiles
2023-06-14T16:09:05.0456861Z INFO: Load quality profiles (done) | time=175ms
2023-06-14T16:09:05.0548880Z INFO: Load active rules
2023-06-14T16:09:07.8454970Z INFO: Load active rules (done) | time=2790ms
2023-06-14T16:09:07.8834183Z INFO: Organization key: ***
2023-06-14T16:09:07.8842111Z INFO: Pull request *** for merge into main from ***
2023-06-14T16:09:07.8972924Z INFO: Load project repositories
2023-06-14T16:09:08.4466736Z INFO: Load project repositories (done) | time=549ms
2023-06-14T16:09:08.4511487Z INFO: SCM collecting changed files in the branch
2023-06-14T16:09:08.6629418Z INFO: SCM collecting changed files in the branch (done) | time=212ms
2023-06-14T16:09:08.6949802Z INFO: Indexing files...
2023-06-14T16:09:08.6950022Z INFO: Project configuration:
2023-06-14T16:09:08.6956967Z INFO:   Excluded sources: **/build-wrapper-dump.json
2023-06-14T16:09:10.4269690Z INFO: 777 files indexed
2023-06-14T16:09:10.4274804Z INFO: 0 files ignored because of inclusion/exclusion patterns
2023-06-14T16:09:10.4278245Z INFO: 0 files ignored because of scm ignore settings
2023-06-14T16:09:10.4292477Z INFO: Quality profile for css: ***
2023-06-14T16:09:10.4297135Z INFO: Quality profile for js: ***
2023-06-14T16:09:10.4297317Z INFO: Quality profile for json: ***
2023-06-14T16:09:10.4297489Z INFO: Quality profile for ts: ***
2023-06-14T16:09:10.4297656Z INFO: Quality profile for web: ***
2023-06-14T16:09:10.4671987Z INFO: ------------- Run sensors on module ***
2023-06-14T16:09:10.7268627Z INFO: Load metrics repository
2023-06-14T16:09:10.8087189Z INFO: Load metrics repository (done) | time=82ms
2023-06-14T16:09:10.8437579Z INFO: Sensor cache enabled
2023-06-14T16:09:10.8589844Z INFO: Load sensor cache
2023-06-14T16:09:11.2576915Z INFO: Load sensor cache (14 KB) | time=398ms
2023-06-14T16:09:14.4751522Z INFO: Sensor IaC CloudFormation Sensor [iac]
2023-06-14T16:09:14.6027163Z INFO: 0 source files to be analyzed
2023-06-14T16:09:14.6118558Z INFO: 0/0 source files have been analyzed
2023-06-14T16:09:14.6121069Z INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=137ms
2023-06-14T16:09:14.6126068Z INFO: Sensor IaC Kubernetes Sensor [iac]
2023-06-14T16:09:14.6264524Z INFO: 0 source files to be analyzed
2023-06-14T16:09:14.6267105Z INFO: 0/0 source files have been analyzed
2023-06-14T16:09:14.6269330Z INFO: Sensor IaC Kubernetes Sensor [iac] (done) | time=14ms
2023-06-14T16:09:14.6275309Z INFO: Sensor C# Project Type Information [csharp]
2023-06-14T16:09:14.6331502Z INFO: Sensor C# Project Type Information [csharp] (done) | time=5ms
2023-06-14T16:09:14.6336617Z INFO: Sensor C# Analysis Log [csharp]
2023-06-14T16:09:14.6500550Z INFO: Sensor C# Analysis Log [csharp] (done) | time=15ms
2023-06-14T16:09:14.6503062Z INFO: Sensor C# Properties [csharp]
2023-06-14T16:09:14.6506589Z INFO: Sensor C# Properties [csharp] (done) | time=0ms
2023-06-14T16:09:14.6517145Z INFO: Sensor HTML [web]
2023-06-14T16:09:14.6519780Z INFO: Sensor HTML is restricted to changed files only
2023-06-14T16:09:14.6625407Z INFO: Sensor HTML [web] (done) | time=10ms
2023-06-14T16:09:14.6640497Z INFO: Sensor TextAndSecretsSensor [text]
2023-06-14T16:09:14.6640734Z INFO: Sensor TextAndSecretsSensor is restricted to changed files only
2023-06-14T16:09:14.6866722Z INFO: 2 source files to be analyzed
2023-06-14T16:09:15.3800787Z INFO: 2/2 source files have been analyzed
2023-06-14T16:09:15.3804249Z INFO: Sensor TextAndSecretsSensor [text] (done) | time=716ms
2023-06-14T16:09:15.3811574Z INFO: Sensor VB.NET Project Type Information [vbnet]
2023-06-14T16:09:15.3825897Z INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=2ms
2023-06-14T16:09:15.3833126Z INFO: Sensor VB.NET Analysis Log [vbnet]
2023-06-14T16:09:15.3965679Z INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=14ms
2023-06-14T16:09:15.3971261Z INFO: Sensor VB.NET Properties [vbnet]
2023-06-14T16:09:15.3971442Z INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
2023-06-14T16:09:15.3973741Z INFO: Sensor JaCoCo XML Report Importer [jacoco]
2023-06-14T16:09:15.3987001Z 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
2023-06-14T16:09:15.3996295Z INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
2023-06-14T16:09:15.3997322Z INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
2023-06-14T16:09:15.4003756Z INFO: Sensor JavaScript analysis [javascript]
2023-06-14T16:09:20.4941598Z INFO: Creating TypeScript program
2023-06-14T16:09:20.4946057Z INFO: TypeScript configuration file /__w/2/s/.scannerwork/.sonartmp/8907549680215808406.tmp
2023-06-14T16:09:20.4958397Z INFO: 2 source files to be analyzed
2023-06-14T16:09:21.0489988Z INFO: Creating TypeScript program (done) | time=554ms
2023-06-14T16:09:21.0495906Z INFO: Starting analysis with current program
2023-06-14T16:09:21.1059099Z INFO: Analyzed 2 file(s) with current program
2023-06-14T16:09:21.1100334Z INFO: 2/2 source files have been analyzed
2023-06-14T16:09:21.1104795Z INFO: Hit the cache for 2 out of 2
2023-06-14T16:09:21.1130595Z INFO: Miss the cache for 0 out of 2
2023-06-14T16:09:21.1134967Z INFO: Sensor JavaScript analysis [javascript] (done) | time=5713ms
2023-06-14T16:09:21.1141771Z INFO: Sensor TypeScript analysis [javascript]
2023-06-14T16:09:21.2188866Z INFO: Found 2 tsconfig.json file(s): [***/tsconfig.json, ***/tsconfig.json]
2023-06-14T16:09:21.2203606Z INFO: Creating TypeScript program
2023-06-14T16:09:21.2203893Z INFO: TypeScript configuration file ***/tsconfig.json
2023-06-14T16:09:21.2262620Z INFO: 640 source files to be analyzed
2023-06-14T16:09:21.2895242Z ##[error]ERROR: Error: Argument for '--moduleResolution' option must be: 'node', 'classic', 'node16', 'nodenext'.; Unknown compiler option 'allowImportingTsExtensions'.
ERROR:     at createProgramOptions (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/services/program/program.js:125:15)
2023-06-14T16:09:21.2904879Z ERROR: Error: Argument for '--moduleResolution' option must be: 'node', 'classic', 'node16', 'nodenext'.; Unknown compiler option 'allowImportingTsExtensions'.
2023-06-14T16:09:21.2905462Z ERROR:     at createProgramOptions (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/services/program/program.js:125:15)
2023-06-14T16:09:21.2908031Z ##[error]ERROR:     at createProgram (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/services/program/program.js:151:28)
ERROR:     at default_1 (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/routing/on-create-program.js:10:57)
ERROR:     at Layer.handle [as handle_request] (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/layer.js:95:5)
ERROR:     at next (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/route.js:144:13)
ERROR:     at Route.dispatch (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/route.js:114:3)
ERROR:     at Layer.handle [as handle_request] (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/layer.js:95:5)
ERROR:     at /__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/index.js:284:15
ERROR:     at Function.process_params (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/index.js:346:12)
ERROR:     at next (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/index.js:280:10)
2023-06-14T16:09:21.2910150Z ERROR:     at createProgram (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/services/program/program.js:151:28)
2023-06-14T16:09:21.2910604Z ERROR:     at default_1 (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/routing/on-create-program.js:10:57)
2023-06-14T16:09:21.2911096Z ERROR:     at Layer.handle [as handle_request] (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/layer.js:95:5)
2023-06-14T16:09:21.2911714Z ERROR:     at next (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/route.js:144:13)
2023-06-14T16:09:21.2912176Z ERROR:     at Route.dispatch (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/route.js:114:3)
2023-06-14T16:09:21.2912814Z ERROR:     at Layer.handle [as handle_request] (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/layer.js:95:5)
2023-06-14T16:09:21.2913255Z ERROR:     at /__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/index.js:284:15
2023-06-14T16:09:21.2913693Z ERROR:     at Function.process_params (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/index.js:346:12)
2023-06-14T16:09:21.2914152Z ERROR:     at next (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/index.js:280:10)
2023-06-14T16:09:21.2963377Z ##[error]ERROR: Failed to create program: Argument for '--moduleResolution' option must be: 'node', 'classic', 'node16', 'nodenext'.; Unknown compiler option 'allowImportingTsExtensions'.
2023-06-14T16:09:21.2964285Z ERROR: Failed to create program: Argument for '--moduleResolution' option must be: 'node', 'classic', 'node16', 'nodenext'.; Unknown compiler option 'allowImportingTsExtensions'.
2023-06-14T16:09:21.2964576Z INFO: Creating TypeScript program (done) | time=73ms
2023-06-14T16:09:21.2964748Z INFO: Creating TypeScript program
2023-06-14T16:09:21.2964950Z INFO: TypeScript configuration file ***/tsconfig.json
2023-06-14T16:09:21.3084218Z ##[error]ERROR: Error: Argument for '--moduleResolution' option must be: 'node', 'classic', 'node16', 'nodenext'.  /***/tsconfig.json:645; Unknown compiler option 'allowImportingTsExtensions'.  ***/tsconfig.json:658
ERROR:     at createProgramOptions (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/services/program/program.js:125:15)
ERROR:     at createProgram (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/services/program/program.js:151:28)
ERROR:     at default_1 (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/routing/on-create-program.js:10:57)
ERROR:     at Layer.handle [as handle_request] (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/layer.js:95:5)
ERROR:     at next (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/route.js:144:13)
ERROR:     at Route.dispatch (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/route.js:114:3)
ERROR:     at Layer.handle [as handle_request] (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/layer.js:95:5)
ERROR:     at /__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/index.js:284:15
ERROR:     at Function.process_params (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/index.js:346:12)
ERROR:     at next (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/index.js:280:10)
2023-06-14T16:09:21.3088773Z ERROR: Error: Argument for '--moduleResolution' option must be: 'node', 'classic', 'node16', 'nodenext'.  ***/tsconfig.json:645; Unknown compiler option 'allowImportingTsExtensions'.  ***/tsconfig.json:658
2023-06-14T16:09:21.3089370Z ERROR:     at createProgramOptions (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/services/program/program.js:125:15)
2023-06-14T16:09:21.3089781Z ERROR:     at createProgram (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/services/program/program.js:151:28)
2023-06-14T16:09:21.3090418Z ERROR:     at default_1 (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/lib/routing/on-create-program.js:10:57)
2023-06-14T16:09:21.3091107Z ERROR:     at Layer.handle [as handle_request] (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/layer.js:95:5)
2023-06-14T16:09:21.3091737Z ERROR:     at next (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/route.js:144:13)
2023-06-14T16:09:21.3092561Z ERROR:     at Route.dispatch (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/route.js:114:3)
2023-06-14T16:09:21.3093090Z ERROR:     at Layer.handle [as handle_request] (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/layer.js:95:5)
2023-06-14T16:09:21.3093551Z ERROR:     at /__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/index.js:284:15
2023-06-14T16:09:21.3094066Z ERROR:     at Function.process_params (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/index.js:346:12)
2023-06-14T16:09:21.3094559Z ERROR:     at next (/__w/2/s/.scannerwork/.sonartmp/eslint-bridge-bundle/package/node_modules/express/lib/router/index.js:280:10)
2023-06-14T16:09:21.3105972Z ##[error]ERROR: Failed to create program: Argument for '--moduleResolution' option must be: 'node', 'classic', 'node16', 'nodenext'.  ***/tsconfig.json:645; Unknown compiler option 'allowImportingTsExtensions'.  ***/tsconfig.json:658
2023-06-14T16:09:21.3107653Z ERROR: Failed to create program: Argument for '--moduleResolution' option must be: 'node', 'classic', 'node16', 'nodenext'.  ***/tsconfig.json:645; Unknown compiler option 'allowImportingTsExtensions'.  ***/tsconfig.json:658
2023-06-14T16:09:21.3166040Z INFO: Creating TypeScript program (done) | time=16ms
2023-06-14T16:09:21.3166340Z INFO: Skipped 640 file(s) because they were not part of any tsconfig.json (enable debug logs to see the full list)
2023-06-14T16:09:21.3166567Z INFO: 640/640 source files have been analyzed
2023-06-14T16:09:21.3166971Z INFO: Hit the cache for 0 out of 0
2023-06-14T16:09:21.3167147Z INFO: Miss the cache for 0 out of 0
2023-06-14T16:09:21.3167328Z INFO: Sensor TypeScript analysis [javascript] (done) | time=199ms
2023-06-14T16:09:21.3167549Z INFO: Sensor JavaScript inside HTML analysis [javascript]
2023-06-14T16:09:21.3274279Z INFO: 1 source file to be analyzed
2023-06-14T16:09:21.3468470Z INFO: 1/1 source file has been analyzed
2023-06-14T16:09:21.3474893Z INFO: Hit the cache for 1 out of 1
2023-06-14T16:09:21.3475267Z INFO: Miss the cache for 0 out of 1
2023-06-14T16:09:21.3475639Z INFO: Sensor JavaScript inside HTML analysis [javascript] (done) | time=33ms
2023-06-14T16:09:21.3482898Z INFO: Sensor CSS Rules [javascript]
2023-06-14T16:09:21.3483146Z INFO: Sensor CSS Rules is restricted to changed files only
2023-06-14T16:09:21.3495457Z INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
2023-06-14T16:09:21.3503922Z INFO: Sensor CSS Rules [javascript] (done) | time=3ms
2023-06-14T16:09:21.3508888Z INFO: Sensor JavaScript/TypeScript Coverage [javascript]
2023-06-14T16:09:21.6634583Z INFO: No LCOV files were found using ./dist/coverage-frontend/lcov.info
2023-06-14T16:09:21.6641242Z WARN: No coverage information will be saved because all LCOV files cannot be found.
2023-06-14T16:09:21.6644388Z INFO: Sensor JavaScript/TypeScript Coverage [javascript] (done) | time=314ms
2023-06-14T16:09:21.6650451Z INFO: Sensor CSS Metrics [javascript]
2023-06-14T16:09:21.6653276Z INFO: Sensor CSS Metrics is restricted to changed files only
2023-06-14T16:09:21.6665156Z INFO: Sensor CSS Metrics [javascript] (done) | time=1ms
2023-06-14T16:09:21.6670452Z INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
2023-06-14T16:09:21.6701982Z INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=3ms
2023-06-14T16:09:21.6712597Z INFO: Sensor IaC Docker Sensor [iac]
2023-06-14T16:09:21.6716282Z INFO: Sensor IaC Docker Sensor is restricted to changed files only
2023-06-14T16:09:21.7187978Z INFO: 0 source files to be analyzed
2023-06-14T16:09:21.7899232Z INFO: 0/0 source files have been analyzed
2023-06-14T16:09:21.7909931Z INFO: Sensor IaC Docker Sensor [iac] (done) | time=120ms
2023-06-14T16:09:21.7916630Z INFO: Sensor Serverless configuration file sensor [security]
2023-06-14T16:09:21.7990459Z INFO: 0 Serverless function entries were found in the project
2023-06-14T16:09:21.8009620Z INFO: 0 Serverless function handlers were kept as entrypoints
2023-06-14T16:09:21.8017076Z INFO: Sensor Serverless configuration file sensor [security] (done) | time=10ms
2023-06-14T16:09:21.8067307Z INFO: Sensor AWS SAM template file sensor [security]
2023-06-14T16:09:21.8089537Z INFO: Sensor AWS SAM template file sensor [security] (done) | time=2ms
2023-06-14T16:09:21.8094391Z INFO: Sensor AWS SAM Inline template file sensor [security]
2023-06-14T16:09:21.8107578Z INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=1ms
2023-06-14T16:09:21.8112322Z INFO: Sensor javabugs [dbd]
2023-06-14T16:09:21.8133511Z INFO: Reading IR files from: /__w/2/s/.scannerwork/ir/java
2023-06-14T16:09:21.8139238Z INFO: No IR files have been included for analysis.
2023-06-14T16:09:21.8143302Z INFO: Sensor javabugs [dbd] (done) | time=3ms
2023-06-14T16:09:21.8147629Z INFO: Sensor pythonbugs [dbd]
2023-06-14T16:09:21.8152148Z INFO: Reading IR files from: /__w/2/s/.scannerwork/ir/python
2023-06-14T16:09:21.8155230Z INFO: No IR files have been included for analysis.
2023-06-14T16:09:21.8158336Z INFO: Sensor pythonbugs [dbd] (done) | time=1ms
2023-06-14T16:09:21.8169537Z INFO: Sensor JavaSecuritySensor [security]
2023-06-14T16:09:21.8195203Z INFO: Reading type hierarchy from: /__w/2/s/.scannerwork/ucfg2/java
2023-06-14T16:09:21.8198807Z INFO: Read 0 type definitions
2023-06-14T16:09:21.8219878Z INFO: No UCFGs have been included for analysis.
2023-06-14T16:09:21.8224310Z INFO: Sensor JavaSecuritySensor [security] (done) | time=5ms
2023-06-14T16:09:21.8229361Z INFO: Sensor CSharpSecuritySensor [security]
2023-06-14T16:09:21.8233437Z INFO: Reading type hierarchy from: /__w/2/s/ucfg_cs2
2023-06-14T16:09:21.8242148Z INFO: Read 0 type definitions
2023-06-14T16:09:21.8242369Z INFO: No UCFGs have been included for analysis.
2023-06-14T16:09:21.8244973Z INFO: Sensor CSharpSecuritySensor [security] (done) | time=2ms
2023-06-14T16:09:21.8249921Z INFO: Sensor PhpSecuritySensor [security]
2023-06-14T16:09:21.8253780Z INFO: Reading type hierarchy from: /__w/2/s/.scannerwork/ucfg2/php
2023-06-14T16:09:21.8257027Z INFO: Read 0 type definitions
2023-06-14T16:09:21.8260557Z INFO: No UCFGs have been included for analysis.
2023-06-14T16:09:21.8263675Z INFO: Sensor PhpSecuritySensor [security] (done) | time=1ms
2023-06-14T16:09:21.8268834Z INFO: Sensor PythonSecuritySensor [security]
2023-06-14T16:09:21.8272722Z INFO: Reading type hierarchy from: /__w/2/s/.scannerwork/ucfg2/python
2023-06-14T16:09:21.8275795Z INFO: Read 0 type definitions
2023-06-14T16:09:21.8280801Z INFO: No UCFGs have been included for analysis.
2023-06-14T16:09:21.8283937Z INFO: Sensor PythonSecuritySensor [security] (done) | time=2ms
2023-06-14T16:09:21.8288435Z INFO: Sensor JsSecuritySensor [security]
2023-06-14T16:09:21.8292784Z INFO: Reading type hierarchy from: /__w/2/s/.scannerwork/ucfg2/js
2023-06-14T16:09:21.8303482Z INFO: Read 0 type definitions
2023-06-14T16:09:21.8307163Z INFO: Reading UCFGs from: /__w/2/s/.scannerwork/ucfg2/js
2023-06-14T16:09:21.9812228Z INFO: Cache loaded: SecuritySensorCache{ucfgsHashes.count=24, typeDefinitionsHashes.count=0}
2023-06-14T16:09:21.9812746Z INFO: No relevant changes detected, skipping analysis.
2023-06-14T16:09:21.9813360Z INFO: Sensor JsSecuritySensor [security] (done) | time=152ms
2023-06-14T16:09:21.9844403Z INFO: ------------- Run sensors on project
2023-06-14T16:09:22.0336874Z INFO: Sensor Analysis Warnings import [csharp]
2023-06-14T16:09:22.0348602Z INFO: Sensor Analysis Warnings import [csharp] (done) | time=2ms
2023-06-14T16:09:22.0357683Z INFO: Sensor Zero Coverage Sensor
2023-06-14T16:09:22.0532614Z INFO: Sensor Zero Coverage Sensor (done) | time=17ms
2023-06-14T16:09:22.0607988Z INFO: SCM Publisher SCM provider for this project is: git
2023-06-14T16:09:22.0622450Z INFO: SCM Publisher 2 source files to be analyzed
2023-06-14T16:09:30.9970863Z INFO: SCM Publisher 2/2 source files have been analyzed (done) | time=8933ms
2023-06-14T16:09:31.0057154Z INFO: CPD Executor Calculating CPD for 2 files
2023-06-14T16:09:31.0296098Z INFO: CPD Executor CPD calculation finished (done) | time=22ms
2023-06-14T16:09:31.2329510Z INFO: SCM writing changed lines
2023-06-14T16:09:31.4273631Z INFO: SCM writing changed lines (done) | time=194ms
2023-06-14T16:09:31.5335226Z INFO: Analysis report generated in 493ms, dir size=1 MB
2023-06-14T16:09:31.8087221Z INFO: Analysis report compressed in 274ms, zip size=520 KB
2023-06-14T16:09:32.1210173Z INFO: Analysis report uploaded in 311ms
2023-06-14T16:09:32.1240069Z INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=***&pullRequest=***
2023-06-14T16:09:32.1246964Z INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
2023-06-14T16:09:32.1252624Z INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=***
2023-06-14T16:09:37.1601220Z INFO: Time spent writing ucfgs 0ms
2023-06-14T16:09:37.7040442Z INFO: Analysis total time: 36.487 s
2023-06-14T16:09:37.7059099Z INFO: ------------------------------------------------------------------------
2023-06-14T16:09:37.7063999Z INFO: EXECUTION SUCCESS
2023-06-14T16:09:37.7064962Z INFO: ------------------------------------------------------------------------
2023-06-14T16:09:37.8065694Z INFO: Total time: 43.490s
2023-06-14T16:09:37.8066008Z INFO: Final Memory: 40M/140M
2023-06-14T16:09:37.8067060Z INFO: ------------------------------------------------------------------------
2023-06-14T16:09:38.1637037Z ##[section]Finishing: Run SonarCloud analysis

Hi,

Thanks for the log.

What I see failing here is the Node.js invocation rather than the analysis as a whole. On the analysis side we made the conscious decision to not fail analysis when there’s a problem starting Node.js. So unfortunately, there’s not much you can do to fail analysis & thus fail the pipeline.

And I will make sure the folks involved in the decision are aware of this.

 
Ann

That seems like a weird decision to me. We’re using Sonarcloud as a quality gate for merging code. With current implementation if something breaks that analysis run, this won’t be reported back to the PR and code will be merged. As long as nobody looks at the PR build details or details when last analysis result was published on Sonarcloud it won’t be noticed that quality gate is no longer checked. So what’s the point of having a quality gate at all with this implementation?

2 Likes

Hi,

Yeah, I don’t disagree. On the other hand, Node.js is also invoked to analyze CSS and we didn’t want to fail the analysis for people whose projects included CSS but who hadn’t installed Node.js. Those folks have other priorities and would prefer to see the analysis of their main languages rather than “benefit” from fail-fast behavior when CSS analysis fails.

And I’ve heard rumbles of bundling Node.js with the scanners so that a) you don’t have to install it and b) maybe we can revert to fail-fast behavior.

And I’ve pinged the relevant folks.

 
Ann

1 Like

Thanks for bringing this up.

Indeed we have been tracking the issue where a failing analysis goes unnoticed for a while because of the current behavior.

If you don’t mind sharing, did this happen to you or are you just anticipating? If it did, how much time did it spent unnoticed? Has this happened multiple times? Any other context?

To add a bit of nuance here, there is also the case when developers that are doing the Pull Request, hence depending on the Quality Gate, don’t have access to the pipeline configuration to fix any error. For example, when that is handled by an ops team. Failing hard would block developers from merging code.

Ideally we could warn operators with the least disturbance for developers. One idea could be to soft-fail the Quality Gate when analysis is not available. Although, this might be nuanced too, since we scan multiple languages at a time and there can be single or multiple failures. Feel free to share your views!

Finally, TypeScript 5 support has been merged and will be available in the following days in SonarCloud, and in the next versions of SonarLint and SonarQube.

Yes, this is an actual issue for us. We updated to TypeScript 5 and PR was merged, because quality gate reported success, even though it was not even run. The issue was detected by accident about 2 weeks later because someone was on SonarCloud for other reasons and noticed that test coverage has dropped to 0%.

Our sole reason to use SonarCloud is to enforce code quality as defined on the quality gate, which unfortunately is something SonarCloud currently on multiple levels is not capable to (e.g. it’s also not possible to enforce quality across whole code base and not only on changed code). It’s a nice reporting tool, but not more. Since we need to implement additional tooling to fill the gaps SonarCloud is not capable of and to enforce code quality, SonarCloud actually does no longer provide any added value.

This is something which I definitely wan’t to solve on my pull request system and not something which I want to have tools try to solve it for me through some magic. If I check for a quality gate in a pipeline, I expect the tool to check for the quality gate. If I want to enforce this strictly I configure a policy in my pull request system on the check. If I want developers to be able to bypass this policy I configure possibility to bypass rule in my pull request system. If my pull request system does not provide this level of configuration I’m looking for another pull request system which matches my requirements.

Current implementation tries to solve an issue for some people on the wrong level, and because of that renders the product useless for other customers.

Thanks for sharing more details and for your honest feedback.

Regarding your comment:

(e.g. it’s also not possible to enforce quality across whole code base and not only on changed code).

You can add Quality Gate conditions on Overall code for long-lived branches. You can do this by updating your organisation’s Quality Gate or creating a custom one with your own conditions.

Here’s a screenshot:

Does this mean that this has been fixed in the last year and this answer is no longer valid: Ensure 0 issues across all code - #9 by ganncamp ?