Message:
Hi community,
I’m facing an issue with the SonarCloud and Azure DevOps integration for PR scanning. It was working fine before, but now SonarCloud is not detecting my PRs and returns a 404 error when trying to fetch them.
← 404 https://sonarcloud.io/api/alm_integration/show_pullrequest?project=example-key-proyect&pullrequestKey=390824
17:29:09.049 ERROR Could not find the pullrequest with key ‘390824’
Problem details:
- I use Azure DevOps with a YAML pipeline that runs Sonar analysis on PRs.
- The variables are correctly set, as
System.PullRequest.PullRequestId
retrieves the correct PR ID. - The PR does exist in Azure DevOps and is open.
- The SonarCloud token has full access permissions.
- However, the SonarCloud API returns: ← 404 https://sonarcloud.io/api/alm_integration/show_pullrequest?project=example-poroject&pullrequestKey=390824
17:29:09.049 ERROR Could not find the pullrequest with key ‘390824’
properties:
sonar.pullrequest.key=$(System.PullRequest.PullRequestId) sonar.pullrequest.branch=$(Build.Repository.Name)@$(sourceBranchName)
sonar.pullrequest.base=$(Build.Repository.Name)@$(targetBranchName) - I checked in SonarCloud → Project → Pull Requests, and the PR does not appear in the list.
What I have tried:
- Verified the Azure DevOps integration in SonarCloud, and it is properly configured.
- Checked in SonarCloud → Administration → Background Tasks, and no recent PR analysis appears.
- Ran
sonar-scanner
manually with the correct parameters, but the PR is still not detected. - Tried with a new PR, but it is also not recognized.
Questions:
- Is there any additional configuration that could be affecting PR detection?
- How can I force SonarCloud to resync with Azure DevOps to recognize PRs again?
- Has anyone else experienced a similar issue recently?
Any help or suggestions would be greatly appreciated. Thanks!