-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
When pushing only the first branch/tag gets PR/Release marked #7019
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
Comments
This is due to the Lines 193 to 217 in 54bd63c
|
Most of these should probably be |
However this problem is fixed in my #6993 |
Wouldn't this be happening in: Lines 187 to 282 in 181b7c9
Calling pushUpdateAddTag() etc...? Line 111 in 181b7c9
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) " 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. |
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. |
Hm when I clone the test repo and push it to a local repo then do In addition, I can do something like this: $ git tag test1
$ git tag test2
$ git tag test3
$ git push --tags 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? |
Weird I don't get that on master. Did you push --all before pushing --tags? |
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:
|
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: [mrsdizzie@mbp ~/Documents/source/github ] > git clone https://try.gitea.io/djgreg13/bugtag.git
Cloning into 'bugtag'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
[mrsdizzie@mbp ~/Documents/source/github ] > cd bugtag/
[mrsdizzie@mbp ~/Documents/source/github/bugtag (master) ] > git remote add local http://localhost:3000/mrsdizzie/reproduce.git
[mrsdizzie@mbp ~/Documents/source/github/bugtag (master) ] > git push local --all
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 212 bytes | 212.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To http://localhost:3000/mrsdizzie/reproduce.git
* [new branch] master -> master
[mrsdizzie@mbp ~/Documents/source/github/bugtag (master) ] > git push local --tags
Total 0 (delta 0), reused 0 (delta 0)
To http://localhost:3000/mrsdizzie/reproduce.git
* [new tag] 1.0.0 -> 1.0.0
* [new tag] 1.0.1 -> 1.0.1 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? |
Yeah that's what I did. Hmm. I'll have to try it again. Maybe it's an intermittent locking Heisenbug? |
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.) |
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. |
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
|
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: Lines 222 to 223 in 181b7c9
When using 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. |
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. |
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) |
@mrsdizzie , 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 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 |
@mrsdizzie, thanks you for the test
My connection is too bad
I need to wait Monday for build :/
… Le 24 mai 2019 à 17:48, mrsdizzie ***@***.***> a écrit :
@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
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hello, how can resync missed tags from version 1.8.1 to new 1.9.0 ? |
Uh oh!
There was an error while loading. Please reload this page.
[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
The text was updated successfully, but these errors were encountered: