Closed morph027 closed 4 years ago
Created a new org repo, forked into my user and pushed a branch and the beloved magic link is there...will check the repo hook settings...
When deleting a fork of a non-working repo and creating a new fork, the link also appears after pushing a new branch.
From admin settings run Resynchronize pre-receive, update and post-receive hooks of all repositories.
task:
Nothing changed. Looking at the filesystem, all projects got the same hooks (the initial bash script which loops over all hooks in .d directory and the gitea hook call in .d directory).
Not sure where the hook gets lost. Will try to enable more debug output and see, if i can find something related.
Also weird, we still got repos which are working without re-fork (in another organisation).
comparing a fresh fork (user1
, where it's working) against a non-working fork (user2
):
gitea:/srv/gitea/repositories# diff -Naur user1/repo.git/hooks/post-receive.d/ user2/repo.git/hooks/post-receive.d/gitea
gitea:/srv/gitea/repositories# diff -Naur user1/repo.git/hooks/post-receive.d/gitea user2/repo.git/hooks/post-receive.d/gitea
No difference.
Perhaps some users are using VS2019? In my VS2019 I'm not getting the remote messages in the Source Control - Git
log, but I do get them if I use git from bash.
Nayh, just using command line ;)
@guillep2k the push link is more efficient than VS2019 I think. You can just click that link and create a PR in seconds.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
@morph027 are you sure that the hooks are even running? If your SSH key isn't managed by Gitea i.e. you can log in to the server to a shell then the hooks won't run because the environment won't get set because gitea serv won't get run.
As part of 1.11 I might pop a PR on that enforces pushes to Gitea repos have to be done in such a way that the hooks will run properly.
The SSH key is managed through Gitea Webinterface.
Yeah sorry just reading your logs - I can see that the hooks are running.
OK, so does your test repository have another branch or is that the first commit - because if it is the first commit and you have no other branches it will get set as the default branch after you push it - hence no pr message.
This happens on all existing projects which did have the PR message before the update...
OK let's look at the logic.
The create a PR logic is in the post-receive hook and is determined by gitea hook post-receive
here:
I.e the result from the pushing of a branch is res["create"] = true.
That's determined by here:
The important parts are:
I.e. you're pushing the creation of a branch not deleting it.
I.e. the user is allowed to create PRs
i.e. the branch being pushed to is not the default branch - this is the problem with your testcase.
i.e. There is not already a PR for this branch
In 1.8 the logic was determined by:
The important parts are:
https://github.com/go-gitea/gitea/blob/11f6ed4f8349119c8f9a5d57c43a0312365883d1/cmd/hook.go#L210
https://github.com/go-gitea/gitea/blob/11f6ed4f8349119c8f9a5d57c43a0312365883d1/cmd/hook.go#L217
https://github.com/go-gitea/gitea/blob/11f6ed4f8349119c8f9a5d57c43a0312365883d1/cmd/hook.go#L226
https://github.com/go-gitea/gitea/blob/11f6ed4f8349119c8f9a5d57c43a0312365883d1/cmd/hook.go#L237
The only difference I can see between 1.8 and 1.9 is that your testcase will "work" in 1.8 because 1.8 will not set the default branch to be the first thing that is pushed.
Are there definitely no errors in your logs? That's the only other way there could be a difference.
Any logs in particular? Should i set loglevel to trace?
If you look at the code I've put up above for 1.9, all the points that would cause no output log.Error
except for the case that you are pushing to the defaultBranch of a non-fork which doesn't log.
If you are pushing a non-default branch that you should either get a create the branch or visit the branch message. Compare the code between 1.8 and 1.9 I can't see how there could be a difference.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Huh, already forgot about ;)
We've upgraded to 1.10.2 recently and the behaviour still exists.
Maybe it's the determination of isPullRequest allowed? As I wrote above the hook change I don't think can be the cause
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Now running 1.11.3, even with PULL_REQUEST_PUSH_MESSAGE = true
there's no consistent behaviour. Some forks are working, some not.
OK can you tell me anything about the cases where this doesn't work? I'm gonna put a guess out here:
Another question are the original forked repos are using an external issue tracker?
Hi!
Yes, both is true, all of our repos are forks of an organisation upstream and the upstreams are limited. Creating a PR through the webinterface works without problems.
At least in my case, i'm in the owners groups of the orgs.
And there are repos within the same organisation, where everything works.
None of the repos is using an external issue tracker.
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
This issue has been automatically closed because of inactivity. You can re-open it if needed.
[x]
):This is the server side log when pushing a branch:
My local shell just gives:
Description
Today i've managed to update Gitea from 1.8.2 to 1.9.2 and after pushing a new branch, i'm missing the remote message to create a new PR introduced in #4716