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

Handle push rejection message in Merge & Web Editor #10373

Merged
merged 11 commits into from Feb 22, 2020

Conversation

zeripath
Copy link
Contributor

Merge push rejection due to pre-receive hook failure should not necessarily result in 500.

Fix: #10322

@zeripath zeripath added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 19, 2020
@zeripath zeripath added this to the 1.12.0 milestone Feb 19, 2020
models/error.go Outdated Show resolved Hide resolved
models/error.go Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 20, 2020
models/error.go Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 20, 2020
@codecov-io
Copy link

codecov-io commented Feb 20, 2020

Codecov Report

Merging #10373 into master will decrease coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10373      +/-   ##
==========================================
- Coverage   43.68%   43.68%   -0.01%     
==========================================
  Files         586      586              
  Lines       81199    81199              
==========================================
- Hits        35475    35471       -4     
- Misses      41333    41337       +4     
  Partials     4391     4391
Impacted Files Coverage Δ
models/user.go 49.54% <0%> (ø) ⬆️
models/user_mail.go 64.18% <100%> (ø) ⬆️
modules/indexer/stats/queue.go 62.5% <0%> (-18.75%) ⬇️
modules/indexer/stats/db.go 40.62% <0%> (-18.75%) ⬇️
modules/git/utils.go 65.67% <0%> (-4.48%) ⬇️
models/unit.go 37.03% <0%> (-2.47%) ⬇️
modules/git/repo.go 46.78% <0%> (-0.92%) ⬇️
routers/repo/view.go 39.06% <0%> (-0.85%) ⬇️
services/pull/pull.go 33.93% <0%> (+1.5%) ⬆️
services/pull/check.go 35.36% <0%> (+2.43%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bab62e5...9c2ffdf. Read the comment docs.

Copy link
Member

@guillep2k guillep2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit, if you want...

modules/repofiles/temp_repo.go Outdated Show resolved Hide resolved
@zeripath zeripath changed the title Handle push rejection message in Merge Handle push rejection message in Merge & Web Editor Feb 22, 2020
@zeripath
Copy link
Contributor Author

Because this PR fixes the sanitization of the error message in the Web editor I've marked this as backport/v1.11

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 22, 2020
@lafriks lafriks merged commit 089ccb0 into go-gitea:master Feb 22, 2020
@zeripath zeripath deleted the merge-push-rejection-message branch February 23, 2020 22:12
@6543
Copy link
Member

6543 commented Feb 25, 2020

pleace send backport

guillep2k pushed a commit to guillep2k/gitea that referenced this pull request Feb 27, 2020
* Handle push rejection message in Merge

* placate golangci-lint

* Fix sanitize, adjust message handling

* oops

* Oops

* Handle push-rejection in webeditor CRUD too

* Apply suggestions from code review

* Fixed conflicts in: modules/repofiles/temp_repo.go

Co-authored-by: Lauris BH <lauris@nix.lv>
@guillep2k guillep2k added the backport/done All backports for this PR have been created label Feb 27, 2020
zeripath added a commit to zeripath/gitea that referenced this pull request Feb 27, 2020
Backport go-gitea#10373

* Handle push rejection message in Merge

* Fix sanitize, adjust message handling

* Handle push-rejection in webeditor CRUD too

Co-authored-by: Lauris BH <lauris@nix.lv>
lafriks added a commit that referenced this pull request Feb 27, 2020
Backport #10373

* Handle push rejection message in Merge

* Fix sanitize, adjust message handling

* Handle push-rejection in webeditor CRUD too

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
@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
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

500 error if PR merge is rejected by pre-receive hook (exit 1)
7 participants