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

fix can't push git notes bug #16689

Closed
wants to merge 2 commits into from

Conversation

a1012112796
Copy link
Member

@a1012112796 a1012112796 commented Aug 14, 2021

Not sure can f-i-x #16688, Because this nit will't cause crash bug.

Signed-off-by: a1012112796 <1012112796@qq.com>
@a1012112796 a1012112796 added type/bug skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Aug 14, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #16689 (71b3384) into main (23a87a0) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #16689   +/-   ##
=======================================
  Coverage   45.39%   45.40%           
=======================================
  Files         758      758           
  Lines       85306    85308    +2     
=======================================
+ Hits        38727    38735    +8     
+ Misses      40298    40294    -4     
+ Partials     6281     6279    -2     
Impacted Files Coverage Δ
routers/private/hook.go 34.31% <0.00%> (-0.14%) ⬇️
modules/queue/workerpool.go 55.34% <0.00%> (+0.38%) ⬆️
models/repo_list.go 78.43% <0.00%> (+0.78%) ⬆️
modules/process/manager.go 75.30% <0.00%> (+2.46%) ⬆️
modules/util/timer.go 85.71% <0.00%> (+42.85%) ⬆️

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 bbf9f41...71b3384. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 14, 2021
@zeripath
Copy link
Contributor

Whilst I agree that this would fix the problem, the function HookPreReceive is a total mess right now.

Adding yet another else if block to that sprawling if else inside a for loop isn't going to improve things.

It needs a more substantial refactor. The code inside the if blocks needs to be farmed out to functions and the duplication related to the proc receive needs to be refactored away.

The internal server error return is incorrect as it should be a forbidden. But we need to think more carefully about which refs we're disallowing e.g. this code will now prevent any number of extensions to git and I'm not certain that that is intended. It's probably the case that this forbidden should be dropped or at least switchable.

Copy link
Member

@lafriks lafriks left a comment

Choose a reason for hiding this comment

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

While I agree this needs to be refactored but as hotfix this seems to be good enough for now

@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 Aug 16, 2021
@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 Aug 17, 2021
@lafriks
Copy link
Member

lafriks commented Aug 17, 2021

Closing in favor of #16706

@lafriks lafriks closed this Aug 17, 2021
@a1012112796 a1012112796 deleted the agit_fix_notes branch August 17, 2021 09:45
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants