sonarqube-community-branch-plugin icon indicating copy to clipboard operation
sonarqube-community-branch-plugin copied to clipboard

[Gitlab] Switch to turn off failing of pipeline

Open bmaehr opened this issue 4 years ago • 9 comments

Describe the Enhancement Switch to turn off failing of pipeline

Additional context If quality gate is not reached it is not possible to merge, which is to hard for us

bmaehr avatar Mar 22 '20 16:03 bmaehr

You could reconfigure your quality gate, that it only fails if your code get's worse than it was before. But keeping it as "bad" as it was in the target branch would not fail the gate.

Would that be an option?

EDIT: But anyway it would be a good option to have a switch ;)

matthiasbalke avatar May 05 '20 10:05 matthiasbalke

No, that's not a option.

For example if you have a MR with only configuration changes, then the test coverage is zero. So you would have to change the code coverage for new code to 0% at the quality gate to accept the the MR. Or an other case: Sometime it happens that it is necessary to merge a MR even if the quality gate fails. And usually such things happen when you are under extreme time pressure.

'Must' conditions in software development sounds good until you face the real world. That's why usually all quality solutions have the possibility to allow exceptions (@Ignore at tests, //NOSONAR, /* NOFORMAT , mark as false positive in Sonar, ...). And I think the approval of the MR is a good person to decide if a MR should be merged even if the quality gate fails.

bmaehr avatar May 13 '20 20:05 bmaehr

I have reimplemented the change based on master if someone is interested ...

bmaehr avatar Mar 08 '21 16:03 bmaehr

I also face a problem that with enabled quality gate, for the interim period, I would like to have the external job created from SonarQube to do not fail the pipeline in MRs and it should be controlled from the job that triggers Sonar (e.g. with allow_failure: true). Is there currently any built-in way to achieve that (even by disabling a pipeline decoration with that "external jobs")?

@bmaehr 1. Am I right that your changes in https://github.com/bmaehr/sonarqube-community-branch-plugin/commits/canFailPipeline cover that? 2. Have you created a PR to have it included in the upstream version (I wasn't able to find any)?

szpak avatar Apr 25 '22 14:04 szpak

@mc1arke Is there currently any way to disable failing the whole pipeline in GitLab (e.g. when waiting for quality gate is done within the job with allow_failure: true) or even disable "changing the GitLab pipeline status" (submitPipelineStatus) at all?

If not, do you have any better idea how to achieve that?

szpak avatar May 09 '22 07:05 szpak

@szpak No, there isn't a way within the plugin. You're free to deploy your own copy of the plugin with alterations to the submission handling though.

mc1arke avatar May 09 '22 08:05 mc1arke

Thanks for your reply @mc1arke . Assuming it would be done in my "copy" of the plugin (a possibility to disable submitting the pipeline status update), were you open to accept that contribution back?

szpak avatar May 09 '22 09:05 szpak

Thanks for your reply @mc1arke . Assuming it would be done in my "copy" of the plugin (a possibility to disable submitting the pipeline status update), were you open to accept that contribution back?

@mc1arke Would you like to have that feature merged into your upstream version?

If yes, what solution would be best for you? The one proposed by @bmaehr or something else?

szpak avatar May 31 '22 16:05 szpak

@mc1arke I've created a PR: #637.

szpak avatar Jul 03 '22 05:07 szpak