We have a pipeline triggered via the creation of a pull request that then invokes a second pipeline in a separate ADO project (passing through a number of variables from the triggering pipeline)
Our project is bound within Sonar (configured as a Mono repo), and we have a valid project-level PAT token (with read and write permissions).
PR Decoration appears to be working and the pipeline job is updated with the output of the scan
We checked server logs, and there is indeed an issue while trying to set the status back to the PR.
It seems our service is unable to get the project name and repository slug to decorate. You said that the project is correctly bound. Would you mind double-checking?
Also, if you don’t have an analysis history on this project, you could try deleting it in SonarCloud and importing it again.
In case it helps at all, we have also replaced the ADO pat token and rebound, just in case that was causing an issue. Please let me know if there is anything further I can investigate to help solve the issue.
I suspect that the second pipeline does not have full information for the Quality Gate report to happen. The Azure prepare task is setting some variables, as seen here, and when you execute it on the second pipeline, which is not in the PR context, it cannot read that info.
In short, I think you might need to pass those variables to your second pipeline:
In any case, what’s the reason for having a different pipeline executed? Why not have PR decoration on the same pipeline as your repository?
I think what you could try is to execute the prepare task in your first pipeline and then pass all properties and ENV variables to the second pipeline as is and execute other tasks.
Hi Jack, thanks for getting back to me. The first pipeline acts as a trigger to the second; so the prepare, analysis and publish all happen on the second pipeline. I’d have to investigate into if its an open to add the prepare to the trigger pipeline.
I did try passing those arguments prior to raising the ticket, but let me retry. I was hoping that as the project is bound directly to the repo in ADO, passing the vtsts details would not be necessary.
Let me update the params, and retest. Thanks for the advice; watch this space.