The Wayback Machine - https://web.archive.org/web/20220315190411/https://github.com/go-gitea/gitea/pull/16705
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

@zeripath zeripath commented Aug 16, 2021

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 [email protected]

@zeripath zeripath added this to the 1.16.0 milestone Aug 16, 2021
zeripath added a commit to zeripath/gitea that referenced this issue 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 <[email protected]>
…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 <[email protected]>
@zeripath zeripath force-pushed the fix-16688-clean-up-pre-receive branch from 521fdfb to cbe8dbe Aug 16, 2021
@lafriks
Copy link
Member

@lafriks lafriks commented Aug 16, 2021

Tests fail

@lafriks
Copy link
Member

@lafriks lafriks commented Aug 17, 2021

Code looks good but tests fail:

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

@zeripath zeripath force-pushed the fix-16688-clean-up-pre-receive branch from 5ba2382 to f14b465 Aug 17, 2021
6543 pushed a commit that referenced this issue 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 <[email protected]>
// internal routes

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

@a1012112796 a1012112796 Aug 17, 2021

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

@lunny lunny Aug 17, 2021

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

@zeripath zeripath Aug 17, 2021

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

Codeberg-org pushed a commit to Codeberg-org/gitea that referenced this issue 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 <[email protected]>
@zeripath
Copy link
Contributor Author

@zeripath zeripath commented Sep 4, 2021

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

6543
6543 approved these changes Sep 16, 2021
@6543 6543 merged commit 8de44d1 into go-gitea:main Sep 16, 2021
2 checks passed
@zeripath zeripath deleted the fix-16688-clean-up-pre-receive branch Sep 16, 2021
@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf commented Sep 18, 2021

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.
Linked issues

Successfully merging this pull request may close these issues.

8 participants