We are using SonarQubeCloud with Azure DevOps and have been running into some issues with excluding some of our folders. This used to work well and the only other thing that changedd is the OS (ubuntu-latest now).
Yes there is a reason as this is part of a template which manages our SonarCloud calls centrally and is only a task (not a job where you would be able to have variables). This is because we have quite a few services which have special need in the CIs, however the SonarCloud steps are the same. It basically wraps around the restore, build, test and a few extra steps depending on the service.
I technically could keep it as an external variable, however this would come with major drawbacks.
The thing is that it interpolates correctly in the logs: Excluded sources: **/build-wrapper-dump.json, **/Migrations/**,
It just doesn’t do anything and I can’t understand why.
I have to wonder if it’s interpolated at log output (i.e by Azure).
I’ll flag this for more expert eyes.
In the meantime, for i-dotting, can you provide the full analysis log?
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
I think this should not be possible. Another thing is that **/Migrations/** should be excluded even if the interpolation doesn’t occur before. However it is still counted towards coverage and analysis. I am just really confused about this behavior.
I have done some more research on this and it really is the adding of the parameter which breaks the entire exclusion. As soon as I remove it, it works. However I need it for some of our services to be extendable like this.
yes I am, however it’s almost always empty as Sonar does quite a good job at detecting generated files. As soon as I add something in the parameter it shows in the log. However even if the string is just sonar.exclusions="**/Migrations/**,"the migrations folder should be excluded, however it is not! Only if I remove the call of the parameter it excludes it, however the logs about the exclusion is 1:1 the same.
I could theoretically force it into a variable with some Powershell, however this should not be necessary as every other Task I use doesn’t break this way.
nope, still the same issue. What I am starting to notice is that as soon as I add the comma it breaks. It’s actually not the parameter, but the comma. As soon as I have a trailing comma or two values seperated by a comma it breaks.
As the old one works fine which runs on windows-latest I can only imagine it is some issue with ubuntu-latest. I guess the Task itself isn’t open-source, right?