Open xoxys opened 10 months ago
These are two different webhooks, was something changed at gitea's side?
Nope. Both events were triggered in the exact same second and for the same commit.
But one event is pull_request_sync
, the other pull_request
(of course we can still ignore the later one)
Wondering a bit why this occurs now and if something in WP or Gitea has changed.
We’ve recently started seeing the same issue and our forge is GitHub. Our use case is slightly different though. We are syncing branches which are chained/stacked together so we see 1 run for every branch in the chain
I can't reproduce with gitea 1.21.1. PR is only triggered once in woodpecker. Also, there's just one webhooks in gitea's list. This looks like an issue with gitea to me.
Might be 2 webhooks being registered?
No only one webhook in gitea. A duplicate webhook would also not explain a pr and pr sync event.
I can't reproduce with gitea 1.21.1. PR is only triggered once in woodpecker. Also, there's just one webhooks in gitea's list. This looks like an issue with gitea to me.
That might be, Ill try to debug this further.
No only one webhook in gitea. A duplicate webhook would also not explain a pr and pr sync event.
true
What I noticed that Gitea now sends not only push
but also create
event that is for new branch creation when pushing new branch and woodpecker converts create
also to push so there is duplicate pipeline created
For me, this issue is gone with current Woodpecker next
and Gitea 1.21.2
.
Then I guess we can close this?
Not sure about the comment from @lafriks
Nope, the issue still exists -.-
Still happens on current next release:
I have just created a fresh repo and executed renovate to get the onboarding PR. I will try to create a reproducible procedure for a local dev setup tomorrow.
Looks like this is not only exclusive to GH. The PR for Release 2.2.0
seems to be triggered twice for the same commit.
No, this is expected because AFAIK the not pushes two commits to the PR.
Two commits with the same hash?
Oh, didn't see this.
Then you're right, I just thought one is the merge from main
and one the changelog update.
We were also facing this issue while using Graphite to submit our PR stacks. It seems the way Graphite works is that it would update tracking branches/PR metadata whenever a change was submitted. This would fire off a GH pull_request_synchronize event as well as a push, resulting in a double trigger of our CI. We noticed the commit hashes were the same (also shown in @xoxys screenshot a few comments above). Ultimately, we made some modifications to our workflow config:
Instead of using event: [pull_request]
, we replaced this with evaluate: 'CI_PIPELINE_EVENT == "pull_request" && CI_COMMIT_SHA != CI_PREV_COMMIT_SHA'
. Everything seems fine and dandy for now.
I also experience this behavior and it annoy me a lot.
In Gitea (original description) can be easily corrected by editing webhook: Gitea by default enable all the events for hook. So, in edit webhook dialog one can switch "Trigger on" to "Custom Events..." and choose one of "Push" or "Pull request synchronized". Looks like first one fires on actual git push and second one see changes in PR (i.e. - new commit added to it) but as Gitea works very fast it feels like two runs on same time.
P.S. I just flying around, sorry if I miss something in long discussion thread.
Seems to be the case for our release PRs as well:
Component
server
Describe the bug
Two CI runs are triggered at the same time on PR creation, see the two webhook events below.
System Info
Additional context
No response
Validations
next
version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]