-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Skip push update when tag reference to blob/tree #23214
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
Skip push update when tag reference to blob/tree #23214
Conversation
0c23ade
to
80ebe2a
Compare
Could we have a test for that? |
modules/git/repo_commit_nogogit.go
Outdated
case "blob": | ||
fallthrough | ||
case "tree": | ||
log.Debug("Special typ: %s", typ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this log debug line will be useful. I think it can be dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're going to need to add this/handle this in the gogit variant code too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. I will remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're going to need to add this/handle this in the gogit variant code too
Well, you are right. I do a refactor for the getCommit() of gogit variant code in the latest patch.
06157d5
to
ddc3f9f
Compare
Because git ref may reference to blob/tree, but push update logic will treate the object as a commit. Therefore, an error occurred when parsing the commit object, resulting in the loss of the webhook notification of this ref and other refs. So we ignore the wrong type error here to let other common refs can do webhook normally. Hope to fix go-gitea#23213. Signed-off-by: ZheNing Hu <[email protected]>
ddc3f9f
to
ebc77a5
Compare
Is here any good place to test this "push update"(webhook, post-receive)? |
You can add an integration test for that. |
-> Ignore trivial errors when updating push data #33864 A tag could point to anything, even a non-existing commit or non-blob. So to be simple, I think we could have 2 choices:
|
#33864 is simple enough and I think we do not need to test it now (actually it's difficult to test it because we need to manually construct a bad git repo) |
Thank you for the PR, 🙏 I think the problem should have been addressed by #33864 , feel free to reopen if there would be new improvements. |
Because git ref may reference to blob/tree, but
push update logic will treate the object as a commit.
Therefore, an error occurred when parsing the commit object, resulting in the loss of the webhook notification of this ref and other refs.
So we ignore the wrong type error here to let other common refs can do webhook normally.
Hope to fix #23213.