Web hook does not wait for completion of "mergeable" check
Description
Sometimes a webhook is triggered while the UI still displays
Merge conflict checking is in progress. Try again in few moments.
after some action. This means that the content of the mergeable field is stale, so the receiver (in my case buildbot) ignores the PR event with
Received event 'pull_request' from gitea Gitea Pull Request ignored because it is not mergeable. (payload: action reopened, mergeable false)
A couple of seconds after the action, merge checking is completed and shows the PR as mergeable.
I have observed this on
- a
reopenedaction, and on - a
synchronizedaction when the previous PR state had merge conflicts
which led me to the conclusion that the previous mergeable status is put in the payload.
I have observed this on a self-hosted Gitea 1.15, 1.16.something and now under 1.16.8.
Expected behaviour
The webhook firing should be delayed until the merge conflict checking has completed. Otherwise, wrong mergeable status is reported in the payload.
The instance is not under my control, so I unfortunately cannot provide most of the debugging info below. :-(
Details
Gitea Version
1.16.8
Can you reproduce the bug on the Gitea demo site?
did not attempt yet
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
Self-hosted instance not under my control, details unknown.
Database
No response
Source: go-gitea/gitea