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

Prevent merge of pull request if last multibranch pipeline indicated failure #9882

Closed
mray271 opened this issue Jan 19, 2020 · 6 comments
Closed

Comments

@mray271
Copy link

mray271 commented Jan 19, 2020

I'm using the multibranch pipeline testing with Jenkins. This is working and I get in Gitea a green check if testing has succeeded and a red X if testing has failed. But this is a bit hidden and does not appear on the PR page. Instead we just see "This pull request can be merged automatically." on that page. It would be better if there were some warning "Most recent testing has failed" or to prevent merging of the PR altogether if testing is failing.

@mray271
Copy link
Author

mray271 commented Jan 19, 2020

The only place I see in Gitea that testing pipeline failure shows up is by clicking through "<> Code" --> Select the branch of the particular PR. It would be most useful if this icon also showed up on pull request page for that branch.

@davidsvantesson
Copy link
Contributor

Are you using the Jenkins Gitea plugin?
In Gitea you will see status checks on each commit (a small symbol being yellow, red or green) as well on the Pull request page. There is an open issue that because the Gitea plugin calls the status checks with PR numbers, and it is thefore not possible to select individual status checks (https://issues.jenkins-ci.org/browse/JENKINS-59557). You can still set up a branch protection rule with required status checks but not selecting a specific check. That will take the complete status check results into account (if any failed it will not be possible to merge).
I hope this explanation helps.

@mray271
Copy link
Author

mray271 commented Jan 21, 2020

I do see the little "Red X" next to the commits.
image

But I see nothing on the pull request page itself. I think this is where there really needs to be some indication that tests are not passing. I am using Gitea Jenkins plugin (also have BlueOcean installed) with Jenkinsfile in my Git repos that specifies the pipeline. Any ideas?
I am currently just raising an error right in my Jenkinsfile by using error "Fail this". Is a post section required in the Jenkinsfile with Junit results in order to get the other indicators showing up? It seems weird that the red x would show up in one place but not the other.

image

@mray271
Copy link
Author

mray271 commented Jan 21, 2020

To be clear, I'm sort of expecting a red indicator on either the "Conversation" tab right next to the "Merge Pull Request" button and/or the message there to be different somehow from "This pull request can be merged automatically". And/Or there should be an indicator higher up near the main title (i.e. next to the "#5 ENH: Fail it" in the above figure).

@davidsvantesson
Copy link
Contributor

What version of Gitea are you running?
Have you setup branch protection for the target branch?

@mray271
Copy link
Author

mray271 commented Jan 22, 2020

Ah, there was the reason. Was still running 1.8.3 binary. Upgraded to 1.10.3 binary and all is well and behaves just as you said.

@mray271 mray271 closed this as completed Jan 22, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants