Hi SonarCloud team,
I’m facing an issue with Pull Request analysis in SonarCloud using Azure DevOps pipelines.
Even though the PR exists in Azure DevOps and the pipeline is triggered correctly, SonarCloud fails with:
ERROR Could not find the pullrequest with key ‘27369’
Environment
-
CI: Azure DevOps Pipelines
-
Repository: Azure Repos (Git)
-
Sonar: SonarCloud
-
Scanner: SonarCloudPrepare@4 / SonarCloudAnalyze@4 (CLI mode)
-
Project Type: React / TypeScript
-
Java Version: JDK 21
-
OS: ubuntu-latest agent
Azure DevOps PR Variables (verified in logs)
system.pullRequest.pullRequestId : 27369
system.pullRequest.sourceBranch : refs/heads/xxxxxxx/feature-pipeline
system.pullRequest.targetBranch : refs/heads/xxxxxx
system.pullRequest.targetBranchName : <xxxxx>
What I have tried
-
Switching between
configMode: fileandconfigMode: manual -
Removing all
sonar.pullrequest.*properties -
Verifying PR exists and pipeline is triggered in PR context
-
Enabling
system.debug=true -
Confirmed SonarCloud project key matches pipeline config
Expected Behavior
SonarCloud should:
-
Automatically detect PR metadata from Azure DevOps
-
Analyze the PR
-
Decorate the PR with analysis results
Actual Behavior
SonarCloud attempts to fetch the PR via alm_integration/show_pullrequest API and returns 404, causing the pipeline to fail.