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

Clean-up HookPreReceive and restore functionality for pushing non-standard refs #16705

Merged
merged 12 commits into from
Sep 16, 2021

Conversation

zeripath
Copy link
Contributor

There was an inadvertent breaking change in #15629 meaning that notes refs and other
git extension refs will be automatically rejected.

Further following #14295 and #15629 the pre-recieve hook code is untenably long and
too complex.

This PR refactors the hook code and removes the incorrect forced rejection of
non-standard refs.

Fix #16688

Signed-off-by: Andrew Thornton art27@cantab.net

@zeripath zeripath added type/bug type/refactoring Existing code has been cleaned up. There should be no new functionality. labels Aug 16, 2021
@zeripath zeripath added this to the 1.16.0 milestone Aug 16, 2021
zeripath added a commit to zeripath/gitea that referenced this pull request Aug 16, 2021
…#16705)

Partial Backport go-gitea#16705

There was an inadvertent breaking change in go-gitea#15629 meaning that notes refs and other
git extension refs will be automatically rejected.

This PR removes this incorrect forced rejection of non-standard refs.

Fix go-gitea#16688

Signed-off-by: Andrew Thornton <art27@cantab.net>
…ndard refs

There was an inadvertent breaking change in go-gitea#15629 meaning that notes refs and other
git extension refs will be automatically rejected.

Further following go-gitea#14295 and go-gitea#15629 the pre-recieve hook code is untenably long and
too complex.

This PR refactors the hook code and removes the incorrect forced rejection of
non-standard refs.

Fix go-gitea#16688

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath force-pushed the fix-16688-clean-up-pre-receive branch from 521fdfb to cbe8dbe Compare August 16, 2021 19:25
@lafriks
Copy link
Member

lafriks commented Aug 16, 2021

Tests fail

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 16, 2021
@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 17, 2021
@lafriks
Copy link
Member

lafriks commented Aug 17, 2021

Code looks good but tests fail:

panic: Unsupported handler type: (func(*context.PrivateContext) context.CancelFunc)(0x1f84ec0)

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath force-pushed the fix-16688-clean-up-pre-receive branch from 5ba2382 to f14b465 Compare August 17, 2021 08:14
6543 pushed a commit that referenced this pull request Aug 17, 2021
…16706)

Partial Backport #16705

There was an inadvertent breaking change in #15629 meaning that notes refs and other
git extension refs will be automatically rejected.

This PR removes this incorrect forced rejection of non-standard refs.

Fix #16688

Signed-off-by: Andrew Thornton <art27@cantab.net>
// internal routes

// RepoAssignment assigns the repository and gitrepository to the private context
func RepoAssignment(ctx *gitea_context.PrivateContext) context.CancelFunc {
Copy link
Member

Choose a reason for hiding this comment

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

Note: #16455 will remove Repo from PrivateContext.
/cc @lunny

Copy link
Member

Choose a reason for hiding this comment

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

I will rebase my PR if this merged at first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can always change Lunny's PR to make the PrivateContext have a less complicated and simpler Repo context.

@codecov-commenter

This comment has been minimized.

Codeberg-org pushed a commit to Codeberg-org/gitea that referenced this pull request Aug 24, 2021
…#16705) (go-gitea#16706)

Partial Backport go-gitea#16705

There was an inadvertent breaking change in go-gitea#15629 meaning that notes refs and other
git extension refs will be automatically rejected.

This PR removes this incorrect forced rejection of non-standard refs.

Fix go-gitea#16688

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath
Copy link
Contributor Author

zeripath commented Sep 4, 2021

Peeps this needs to be merged to restore functionality for git notes and others

@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 Sep 16, 2021
@6543 6543 merged commit 8de44d1 into go-gitea:main Sep 16, 2021
@zeripath zeripath deleted the fix-16688-clean-up-pre-receive branch September 16, 2021 13:36
@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor

thanks for the great work, I confirm the notes functionality is back for me 🚀

@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. type/bug type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refs/notes/* refused by pre-receive hook at the remote
8 participants