We use Azure Pipelines and our branch policy is setup to check our SonarCloud Quality Gate via the status check (https://learn.microsoft.com/en-us/azure/devops/repos/git/pr-status-policy?view=azure-devops).
This works fine so far, as we can see the results as part of the PR:
We want to continuously improve our code, however, as we're working with an old code base there are sometimes changes that violate the Quality Gate. As an example, we'd like a certain % of code coverage via tests, but for some changes, this might not be possible due to the change being in an older part of the application (please note that I'm aware that this might not be a good reason to skip the code, but this is not what will answer my question ;-)
Due to this, we can't make the status check "required" as there are situations where we want to override it. I was wondering if we can make the status check optional, but "enabled" by default. What I mean is that it appears as failed check and will block completion by default, but allows me to make it optional in some cases.
Right now I can do this by setting the status check as optional, and then I have to manually make it "required":
Then it will be shown like this in the PR:
So essentially I'm wondering if I can somehow have the manual step from "Optional" to "Required" done automatically, without losing the choice to make it optional?
Anyone has an idea if (and how) this would be possible?