NOTE: At the rate symbol not accepting, so I am replace that at the rate symbol with underscore(_)
ALM used
Azure DevOps Services
CI system used
Azure Pipelines (YAML)
Scanner command used
Using the standard SonarCloudPrepare_4 execution task running via manual configuration (scannerMode: CLI).
Languages of the repository
Python, YAML, JavaScript
Error observed
When our team utilizes the standard major-version syntax for the official SonarCloudPrepare_4 task, the analyzer generates a security hotspot warning / error: Use complete version number for the task instead of “4”
There is a strange logical contradiction in how the text parser evaluates compliance for this specific rule:
The _4 Syntax: The pipeline compiles successfully and runs to completion, ensuring we receive stable minor and patch updates automatically. However, SonarCloud flags this line as a risk.
The 4.0.0 Loophole: If we change the code text line specifically to SonarCloudPrepare_4.0.0, the pipeline executes perfectly and SonarCloud completely drops the security report. The scanner accepts it without any errors.
Steps to reproduce
Insert the official task structure into an Azure DevOps YAML pipeline using major version notation:
YAML
- task: SonarCloudPrepare_4
displayName: ‘Prepare analysis on SonarCloud’
inputs:
SonarCloud: DataSonarcloud
organization: ‘livestockinformation’
cliProjectKey: ‘LivestockInformation_DataInsights’
configMode: manual
scannerMode: CLI
Execute a SonarCloud analysis scan. Observe the active rule warning demanding a full patch version.
Update the line text precisely to SonarCloudPrepare_4.0.0 and run the pipeline again.
Note that the scanner completely clears the warning and reports 0 issues on the step.
Potential workaround applied
To move past our quality gates without hardcoding inline suppression properties, our team is choosing to explicitly declare the version as _4.0.0 for now. The pipeline runs without issue and the Sonar warning is cleared.
Request for Technical Guidance & Recommendation
We are looking for clarity regarding the design intent of this rule evaluation:
Why does an arbitrary regex pattern clear a security rule? The static scanner drops the alert when it evaluates a 3-part semantic string layout like _4.0.0. Why is a text-matching pattern favored over active security validation, since pinning to a generic .0.0 baseline actively cuts the pipeline off from minor security patches?
What is the true recommended best practice? If we want to design this properly, should we be setting a base fallback version like _4.0.0, or should we be looking for the exact, latest stable patch available in the extension ecosystem (e.g., _4.2.5)? What does SonarCloud consider the intended configuration?
Auto-Exempt Valid Marketplace Patterns: Please consider updating the analysis logic to recognize that major version tags (_4) are the platform-intended delivery mechanism for trusted marketplace extensions, rather than clearing the issue for an arbitrary .0.0 text suffix.