forgejo/services
Earl Warren 7b4dba3aa0 [ACTIONS] skip superflous pull request synchronized event (#2314)
Skip a HookEventPullRequestSync event if it has the same CommitSHA as an existing HookEventPullRequest event in the ActionRun table. A HookEventPullRequestSync event must only create an ActionRun if the CommitSHA is different from what it was when the PR was open.

This guards against a race that can happen when the following is done in parallel:

* A commit C is pushed to a repo on branch B
* A pull request with head on branch B

it is then possible that the pull request is created first, successfully. The commit that was just pushed is not known yet but the PR only references the repository and the B branch so it is fine.

A HookEventPullRequest event is sent to the notification queue but not processed immediately.

The commit C is pushed and processed successfully. Since the PR already exists and has a head that matches the branch, the head of the PR is updated with the commit C and a HookEventPullRequestSync event is sent to the notification queue.

The HookEventPullRequest event is processed and since the head of the PR was updated to be commit C, an ActionRun with CommitSHA C is created.

The HookEventPullRequestSync event is then processed and also has a CommitSHA equal to C.

Refs: https://codeberg.org/forgejo/forgejo/issues/2009
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2314
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2024-02-11 13:06:54 +00:00
..
actions [ACTIONS] skip superflous pull request synchronized event (#2314) 2024-02-11 13:06:54 +00:00
agit
asymkey Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
attachment [FEAT] allow setting the update date on issues and comments 2024-02-05 14:44:33 +01:00
auth [BRANDING] X-Forgejo-OTP can be used instead of X-Gitea-OTP 2024-02-05 16:05:01 +01:00
automerge Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
context
convert Merge branch 'rebase-forgejo-dependency' into wip-forgejo 2024-02-05 18:58:23 +01:00
cron [PRIVACY] Add a DNS method to fetch new updates 2024-02-05 15:38:36 +01:00
doctor [GITEA] new doctor check: fix-push-mirrors-without-git-remote (#1853) 2024-02-05 16:09:41 +01:00
externalaccount
feed
forgejo [UPGRADE] run sanity checks before the database is upgraded 2024-02-05 14:44:33 +01:00
forms Merge branch 'rebase-forgejo-dependency' into wip-forgejo 2024-02-05 18:58:23 +01:00
gitdiff
indexer
issue Merge remote-tracking branch 'forgejo/forgejo-dependency' into wip-forgejo 2024-02-09 19:00:54 +01:00
lfs [GITEA] Drop sha256-simd in favor of stdlib 2024-02-05 16:09:40 +01:00
mailer [gitea] Fix missing link on outgoing new release notifications (#29079) 2024-02-10 10:53:43 +01:00
markup
migrations Merge branch 'rebase-forgejo-dependency' into wip-forgejo 2024-02-05 18:58:23 +01:00
mirror Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
notify [GITEA] notifies admins on new user registration 2024-02-05 16:09:28 +01:00
org
packages Propagate install_if and provider_priority to APKINDEX (#28899) 2024-02-05 05:52:56 +00:00
pull Merge remote-tracking branch 'forgejo/forgejo-dependency' into wip-forgejo 2024-02-09 19:00:54 +01:00
release Avoid sending update/delete release notice when it is draft (#29008) 2024-02-02 04:18:12 +00:00
repository Merge branch 'rebase-forgejo-dependency' into wip-forgejo 2024-02-05 18:58:23 +01:00
secrets
task
uinotification
user Merge branch 'rebase-forgejo-dependency' into wip-forgejo 2024-02-05 18:58:23 +01:00
webhook Merge branch 'rebase-forgejo-dependency' into wip-forgejo 2024-02-05 18:58:23 +01:00
wiki [GITEA] Allow changing the repo Wiki branch to main 2024-02-05 16:57:47 +01:00