-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
This pull request is broken due to missing fork information. #18802
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
Yeah, I think there is a bug of update with rebase. |
This just happened to me over at https://gitea.com/gitea/go-sdk/pulls/580 as well. |
This is a serious bug in my opinion, as it happens all the time we're updating our PRs by rebasing them. It should be included in the next bugfix- or at least the major 1.17 release. |
this issue still exists in the latest try.gitea.io w/ 1.17 dev, is there any plan to fix it? |
I am using the released version 1.16.7 and have the same symptom. |
@lihanglin are you using the Gitea image provided in Docker? If you do, can you please show the output of
|
@singuliere |
@FrankCui-FengqiaoCui - please check your docker version. 1.17 is running alpine > 3.13 #18500 and docker versions less than 20.10.6 will break with hooks not running. @lihanglin - I need to know more about your situation. I would guess that in all of these cases hooks are not running. If that is the case the PR head ref will not be being updated at the time of updates to the PR branch head. You can check this, and the simplest way to do this would be to go to a repository that is affected and look at /graph Look at the head branch of PR and where the associated label of the PR is e.g. https://try.gitea.io/arandomer/pathological/pulls/25 has the head branch So the commit graph would be: and you can see that these are at the same position. (as they should be.) If you have the heads at different places then my first suspicion is that you don't have hooks running and we need to go back down the rabbit hole of looking at that. The biggest causes for this are:
If the heads are the same - well then we're gonna need logs, a reproducing testcase, and more information than "this is a serious bug" etc. |
@zeripath |
Could this be related to #18189 ? |
Hello. We have stumbled upon this issue after migrating to 1.17.0. We have been using 1.16.8 before that and there was no such error. Any PR that is opened in Gitea is moving to the state 'This pull request is broken due to missing fork information.' after the new commits are added to the tracking branch. This may be related with the fact that new commits are no longer displayed in the feed on the starting screen. Docker version 19.03.2, build 6a30dfca03 Currently the host machine is Debian Stretch and I am currently stuck with 19.03 engine. |
I think that the issue is definitely in heads not being updated. I got to the testing repository:
The gitea is storing data directly on the host machine:
|
I could reproduce 👍
Now that I can reproduce, I will debug it |
In our situation every PR is broken when a new commit is pushed to the tracking branch. The default policy for broken repositories is to make a rebase when accepting changes from the request. Is it worth to try to use the binary directly instead of the Docker? |
the docker is made from the official binary, this won't change. Could you please confirm that your PR that are failing came from a fork ? As the bug I was able to reproduce ?? |
No. For the test purposes I have created a test a brand new repository. The whole commit tree is here:
After the first commit, I have created a After grepping the logs of gitea I do not see the message with the
The change would be the removal of the Docker layer. The idea is from this comment:
I also carefully reread the original issue and in my case the issue is not the same, but resulting state is the same. |
I have set up the temporary instance of gitea 1.17.0 running inside the docker container. The issue was reproduced in this environment too. Therefore there is minor chance that the issue came alongside with the migration. Then in this additional installation I have swapped the docker image with the native binary. In this setup the issue is gone. Therefore the source of my issue is the old version of docker runtime. |
Back to the fork problem I dug up this https://github.com/go-gitea/gitea/blob/release/v1.17/routers/web/repo/pull.go#L563
Conditions I have is that headBranchSha != sha because the fork was made with signed commits "Updating by rebase" will then rebase the commits on top of master, but as it is a Gitea commits side operation, commits are not signed anymore, thus they have not the same SHA. @lunny / @zeripath I would like to help work on a PR for this issue, could you please tell me your opinion ? |
Any update on this? It's not working for me as well with Docker version 20.10.18 and Gitea 1.17.2. Can i help out with any more information or logs? |
I worked out the way to update the fork without broking the PR. Problem is still that the PR gets different commit sha's than the fork, then it fails the merging (security checking the checksums are identical) => I was not able to workaround this (no time) My first idea would be to flash a message "Gitea cannot rebase on signed commits, please rebase manually your fork" (the Github way to do it) If we are to allow rebasing by gitea, this would mean gitea should be able to force push to fork to make the checksums corresponds. |
Upgrading Docker Engine version from 19 to 20.10.18 fixed the issue for me. |
@99rgosse I don't understand your comment or how it's being reproduced. |
related #16125 |
No it's in the pushing environment! |
The update by rebase code reuses the merge code but shortcircuits and pushes back up to the head. However, it doesn't set the correct pushing environment - and just uses the same environment as the base repo. This leads to the push update failing and thence the PR becomes out-of-sync with the head. This PR fixes this and adjusts the trace logging elsewhere to help make this clearer. Fix go-gitea#18802 Signed-off-by: Andrew Thornton <[email protected]>
…o-gitea#22535) Backport go-gitea#22535 The update by rebase code reuses the merge code but shortcircuits and pushes back up to the head. However, it doesn't set the correct pushing environment - and just uses the same environment as the base repo. This leads to the push update failing and thence the PR becomes out-of-sync with the head. This PR fixes this and adjusts the trace logging elsewhere to help make this clearer. Fix go-gitea#18802 Signed-off-by: Andrew Thornton <[email protected]>
…22535) (#22536) Backport #22535 The update by rebase code reuses the merge code but shortcircuits and pushes back up to the head. However, it doesn't set the correct pushing environment - and just uses the same environment as the base repo. This leads to the push update failing and thence the PR becomes out-of-sync with the head. This PR fixes this and adjusts the trace logging elsewhere to help make this clearer. Fix #18802 Signed-off-by: Andrew Thornton <[email protected]> Signed-off-by: Andrew Thornton <[email protected]>
…22535) The update by rebase code reuses the merge code but shortcircuits and pushes back up to the head. However, it doesn't set the correct pushing environment - and just uses the same environment as the base repo. This leads to the push update failing and thence the PR becomes out-of-sync with the head. This PR fixes this and adjusts the trace logging elsewhere to help make this clearer. Fix #18802 Signed-off-by: Andrew Thornton <[email protected]> Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: John Olheiser <[email protected]>
@Vylpes please could you explain how you reproduce the error, because I cannot reproduce on main or on 1.18.2. |
Hmm, I just noticed that the fix can only be part of the solution: |
In my case the repository is definitely not a fork, yet I'm still having
this issue
delvh ***@***.***> schrieb am Sa., 21. Jan. 2023, 14:33:
… Hmm, I just noticed that the fix can only be part of the solution:
The solution works for repos that have forks that send PRs.
I think I've seen this message on PRs in a repo that doesn't have forks.
So, perhaps, there is a part two to this problem?
—
Reply to this email directly, view it on GitHub
<#18802 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACIMCHVKL7D6MSZJL457WLWTPQUPANCNFSM5OXEDGAA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@zeripath Pretty much all I did was:
This is on an organisation repo, no forks, just from a |
@Vylpes I cannot reproduce that on 1.18.2 or on try. (see https://try.gitea.io/testOrf/test-18802/pulls/1, https://try.gitea.io/testOrf/test-18802/pulls/2, https://try.gitea.io/testOrf/test-18802/pulls/3, https://try.gitea.io/testOrf/test-18802/pulls/4) If your PR was broken already it will remain broken - just push an empty commit and it should resync. |
@zeripath Then I have no clue why my instance is still doing it - I've pushed an empty commit and it doesn't fix it (nor does it show in the commits list in the PR). Is there anything I can give you other than that to help? Or is there a way I can "reset" my instance without losing repo data? |
It sounds like your hooks aren't running. How are you pushing? SSH or Https? What are you running on Linux, windows, docker etc? Are your repos mounted on an executable partition? Have you resynchronized your hooks? |
That might actually be it - As drone isn't picking up on anything either which is also webhook related.
Https
Docker running on a Linux host. The repos are in a volume formatted with ext4, which I and all users have execute permissions on.
I've clicked on "Resynchronize pre-receive, update and post-receive hooks of all repositories." in the admin dashboard but no fix |
I think I fixed it, I moved my data into a different partition and its working now. Must have not liked where it was. Thanks for the support :) |
It was likely mounted noexec |
After upgrade 1.18.3 still have this issues, should I disable some option like "PR rebase"? |
@alluLinger explain how you make the break happen. Make sure that pushes in general are working - that is your dashboard gets updates when you push. I need details for how to make the bug occur and information about your system. I need logs. I'm not a mind reader. |
@zeripath |
Ah. We don't use pre-push so something may have put that there that wasn't Gitea. If a broken pre-push was causing this issue then I'm afraid it's not due to Gitea and whilst there is potentially a way we can avoid this - we can't consider this a bug in Gitea. |
Gitea Version
1.16.1
Git Version
whatever is packaged in docker
Operating System
Linux
How are you running Gitea?
Docker
Database
PostgreSQL
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Description
The PR branch was not up to date, so I tried to update it using rebase on the web UI. This resulted in "This pull request is broken due to missing fork information. "
Screenshots
The text was updated successfully, but these errors were encountered: