mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-14 11:56:41 -05:00
When pushing only the first branch/tag gets PR/Release marked #3367
Closed
opened 2025-11-02 05:10:18 -06:00 by GiteaMirror
·
22 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
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1.4.0-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#3367
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mixman68 on GitHub (May 22, 2019).
[x]):Description
If i push a commit in master and a tag with --all options, the front is desynchronised with my repo.
https://try.gitea.io/djgreg13/bugtag is the example, i push master and tag with --all
If i clone the repo, i see the tag, but on front no tags is shown in Releases page
If i push only a new tag, an automatic entry will be created on Releases page
I except to see in this page tag 1.0.0 (pushed with --all) and tag 1.0.1 (pushed with --tags) or i see only 1.0.1
Screenshots
you can see on https://try.gitea.io/djgreg13/bugtag
@zeripath commented on GitHub (May 23, 2019):
This is due to the
breaks in:54bd63cd5c/cmd/hook.go (L193-L217)@zeripath commented on GitHub (May 23, 2019):
Most of these should probably be
continue@zeripath commented on GitHub (May 23, 2019):
However this problem is fixed in my #6993
@mrsdizzie commented on GitHub (May 24, 2019):
Wouldn't this be happening in:
181b7c99ed/models/update.go (L187-L282)Calling pushUpdateAddTag() etc...?
181b7c99ed/models/update.go (L111)I suspect what happens is that for whatever reason sometimes when a tag gets pushed that pushUpdateAddTag() fails or isn't called, and then the tag is present on the remote and never run through pushUpdateAddTag() again. There are several places pushUpdateTag() could error, and several more even before that call, but you would have already needed error logging turned on to see I think.
Migrating or mirroring these example repos like the one above shows the proper releases (both 1.0.0 and 1.0.1) because it runs SyncReleasesWithTags (which then runs pushUpdateAddTag() for each tag )which does see that tag and create a proper release:
https://try.gitea.io/mrsdizzie/bugtag
FWIW the initial comment says "I except to see in this page tag 1.0.0 (pushed with --all) "
but
git push --alldoesn't push tags. However, it should have then pushed both tags on the nextgit push --tags(which it does in my testing, and I've yet to be able to reproduce pushing a tag, or several tags at once, that doesn't generate a release for each tag).I want to find the cause of this and fix in case of a bug, but I also wonder if it would be helpful to add a button in the repo settings that can run SyncReleasesWithTags in case of any errors like this, which would at least provide a way to recover.
@zeripath commented on GitHub (May 24, 2019):
That never gets called.
Look again at hook post-receive.
If you are pushing multiple things the breaks will stop the processing of everything after them.
To reproduce this just clone his repo and git push --tags to a local Gitea - only the first tag received will get a release made.
@zeripath commented on GitHub (May 24, 2019):
#6993 fixes this because the private.HookPostReceive is called for every line in the push - but if you wanted to fix it without that just change those breaks to continue and it's fixed, however I'm not doing that as I'm certain that #6993 is a better way of doing hooks.
@mrsdizzie commented on GitHub (May 24, 2019):
Hm when I clone the test repo and push it to a local repo then do
git push --tagsit shows both of the tags as releases.In addition, I can do something like this:
and it will create a release for test1, test2, test3 so I don't quite understand the only first tag gets processed part. Those hooks are running but they aren't stopping pushing multiple tags.
Are you not seeing that?
@zeripath commented on GitHub (May 24, 2019):
Weird I don't get that on master. Did you push --all before pushing --tags?
@zeripath commented on GitHub (May 24, 2019):
Yeah you're right the breaks shouldn't affect tag only pushing as they should only due for branch pushing.
I was definitely able to reproduce the problem on master with:
@mrsdizzie commented on GitHub (May 24, 2019):
Interesting, if I do the same thing it shows the release fine. Just so we're on the same page, I'm creating a new empty repo locally ("reproduce") and then doing this:
And then I can see both releases in Gitea. Tried via SSH too just to rule out any possible difference. Do you get any logging from the pushUpdate function on your end? Or maybe you see something obvious that I'm missing in the way I am testing it?
@zeripath commented on GitHub (May 24, 2019):
Yeah that's what I did.
Hmm. I'll have to try it again.
Maybe it's an intermittent locking Heisenbug?
@zeripath commented on GitHub (May 24, 2019):
Just realised that in post-receive we probably shouldn't stop on error because it's too late as the commits are in the repo - so we have to complete.
It's almost like we need a transaction log or some way of getting Gitea to just refresh the whole repo - as you suggested. (This would also be useful for allowing gitea to just take over repos.)
@mrsdizzie commented on GitHub (May 24, 2019):
I'd be curious if you have error logging on to see if there is anything coming from the pushUpdate or pushUpdateAddTag functions (as there are places it could exit before creating the release but after pushing the tag). Or just anywhere I guess! I was hoping to be able to reproduce it as you are to see whats actually happening but I can't :(
And yea perhaps SyncReleasesWithTags should be made available to the user in some way, because as of now even if you found why the release wasn't made and fixed it (or explained why it was a valid error) there is no way to make it try again.
@mixman68 commented on GitHub (May 24, 2019):
Since git 2.4 there is an option for push tags with commits but it is disabled by default
git config --global push.followTags true
So if I do push --all as i tell, the follow-tags is by default to true ;)
i tested git push --mirror, this commang bugs too with tags, there are missing into release tab. Only commits are shown in timeline.
I tested with gitea 1.5, it's works fine, our previous version. So it is a regression with newer version
@mrsdizzie commented on GitHub (May 24, 2019):
Ah, ok that is a very helpful detail! I can reproduce this now with specific steps.
The git config --global push.followTags true / --follow-tags option only works for annotated tags:
https://git-scm.com/docs/git-push#Documentation/git-push.txt---follow-tags
Assuming your tag was annotated. In testing, if I create an annotated tag and push it with the --follow-tags option then gitea doesn't create a release (but the tag is pushed to the server successfully). If I create an annotated tag and push it with git push --tags then it does see it.
This appears to be because of this check:
181b7c99ed/models/update.go (L222-L223)When using
git push --tagstheopts.RefFullName:isrefs/tags/tagnamewhich passes that check. When usinggit push --allit isrefs/heads/branchnameand doesn't pass that test so it never runs pushUpdateAddTag.Not sure the best way to check for tags in the git push --all situation (there doesn't appear to be enough info in opts for that currently), but that seems to be the likely cause here.
@zeripath commented on GitHub (May 24, 2019):
So when I first looked at this I thought this might be an annotated Vs unannotated issue but looking at the repo on try I'm not convinced either of those tags are annotated.
@mrsdizzie commented on GitHub (May 24, 2019):
It isn't about annotate as much as it is about the RefFullName not starting with /refs/tags.
git push --all just seems to only push annotated tags (but you can push them fine with git push --tags). There are maybe other situations where you can push a tag and that RefFullName value might not start with /refs/tags also (I'm not that familiar)
@mixman68 commented on GitHub (May 24, 2019):
@mrsdizzie ,
with the --mirror option of git, i have the same issue,
In the git documentation, they tell :
So in the mirror push, the tag is not show in Releases tab as follow-tags behaviour, so in mirror push, /refs/tags is pushed
@zeripath commented on GitHub (May 24, 2019):
@djgreg13 would you be able to build #6993 and confirm that it solves this issue?
@mrsdizzie commented on GitHub (May 24, 2019):
@zeripath I built that PR and it does fix the test case that I was able to reproduce as those tags are now seen by pushUpdate
@mixman68 commented on GitHub (May 25, 2019):
@mrsdizzie, thanks you for the test
My connection is too bad
I need to wait Monday for build :/
@mixman68 commented on GitHub (Aug 11, 2019):
Hello, how can resync missed tags from version 1.8.1 to new 1.9.0 ?