Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gitlab] Switch to turn off failing of pipeline #137

Open
bmaehr opened this issue Mar 22, 2020 · 9 comments
Open

[Gitlab] Switch to turn off failing of pipeline #137

bmaehr opened this issue Mar 22, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@bmaehr
Copy link

bmaehr commented Mar 22, 2020

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 bmaehr added the bug Something isn't working label Mar 22, 2020
bmaehr added a commit to bmaehr/sonarqube-community-branch-plugin that referenced this issue Mar 22, 2020
Switch to turn off failing of pipeline
@mc1arke mc1arke added enhancement New feature or request and removed bug Something isn't working labels Apr 27, 2020
@matthiasbalke
Copy link

matthiasbalke commented May 5, 2020

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 ;)

@bmaehr
Copy link
Author

bmaehr commented May 13, 2020

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
Copy link
Author

bmaehr commented Mar 8, 2021

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

@szpak
Copy link

szpak commented Apr 25, 2022

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
Copy link

szpak commented May 9, 2022

@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?

@mc1arke
Copy link
Owner

mc1arke commented May 9, 2022

@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.

@szpak
Copy link

szpak commented May 9, 2022

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
Copy link

szpak commented May 31, 2022

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 added a commit to szpak-forks/sonarqube-community-branch-plugin that referenced this issue Jul 1, 2022
…ailed analysis

Could be useful in the interim period, especially for the analysis using
"-Dsonar.qualitygate.wait=true" with "allow_failure: true" in GitLab.
szpak added a commit to szpak-forks/sonarqube-community-branch-plugin that referenced this issue Jul 1, 2022
GitlabMergeRequestDecoratorTest migrated to JUnit Jupiter API
szpak added a commit to szpak-forks/sonarqube-community-branch-plugin that referenced this issue Jul 1, 2022
@szpak
Copy link

szpak commented Jul 3, 2022

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

szpak added a commit to szpak-forks/sonarqube-community-branch-plugin that referenced this issue Jul 3, 2022
Only properties starting with "sonar.analysis." are available from the analysis context:
https://docs.sonarqube.org/latest/analysis/analysis-parameters/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants