Anyway to fail build/block pipelines from running if SonarCloud is not implemented

Hello,

I am looking for my whole organization to implement Sonar Cloud, and I wanted to know if there is a way in the pipelines where I can scan to see if SonarCloud steps were implemented and block the pipeline from running, or just fail if the tasks are not there.

Thank you!

Hey there.

To ensure SonarCloud analysis is part of your pipeline, you could consider implementing a pre-build step that checks for the presence of the necessary SonarCloud tasks. If these tasks are not found, the pre-build step could either block the pipeline from running or cause it to fail as per your requirements.

However, the exact method of implementation would depend on the CI/CD tool you are using.

How many repositories are in play here? Typically, developers are more likely to use SonarCloud if they have some role to play in setting it up on their repositories, and not suddenly having their pipelines fail.

Hey, about 300 different repos that we are trying to get this set up for. We want to have SonarCloud implemented in all projects by June 1st, and if they are not we are trying to prompt people to implement it by making their pipelines fail or just block pipelines. I didnt know if there was something that I can add to the pipeline that blocks it.

At that point… you might as well add the SonarCloud tasks :smiley:

As far as I’m aware, no other users have implemented something similar.