We have SonarQube Enterprise ( * Enterprise Edition* v2025.4.2 (112048)).
We want to configure PR scanning through the CI/CD pipeline. We do not have the out-of-the-box PR ID available from our CI tool if we have to re-run the pipeline for any reason.
So, we want the PR ID to be the branch name.
If we provide something like ‘feature-test’, we are getting Invalid PR Key from SonarQube.
We are ok with multiple commits coming to a branch and comparing it with the Develop branch.
Please advise.
Hey @BeBetter, there are a few things I’d like to clarify:
The constraint you have is that when the pipeline runs on your PR for the 1st time, your CI tool gives you the PR ID, but on subsequent pipeline runs, your CI doesn’t give you the PR ID? Is this correct?
When you configure your pipeline to pass the branch name as PR key to the scanner, do you get the “Invalid PR Key” the 1st time you run the pipeline? Or on subsequent runs?
At what point during the analysis do you get this error? Could you share logs? Can you set the scanner to write debug logs and try to spot which API call results in this error?
And finally: do you see any relevant messages in the server logs associated with the “Invalid PR Key” error?