forgejo/services/pull
Earl Warren 036f1eddc5
[GITEA] avoid superfluous synchronized pull_request run when opening a PR (#2236)
* Split TestPullRequest out of AddTestPullRequestTask
* Before scheduling the task, AddTestPullRequestTask stores the max
  index of the repository
* When the task runs, it does not take into account pull requests that
  have an index higher than the recorded max index

When AddTestPullRequestTask is called with isSync == true, it is the
direct consequence of a new commit being pushed. Forgejo knows nothing
of this new commit yet. If a PR is created later and its head
references the new commit, it will have an index that is higher and
must not be taken into account. It would be acting and triggering a
notification for a PR based on an event that happened before it
existed.

Refs: https://codeberg.org/forgejo/forgejo/issues/2009
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2236
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
(cherry picked from commit b3be895a30b32bfae4acfa32db54406e1dd1dc21)
2024-02-05 16:57:58 +01:00
..
check.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
check_test.go Replace assert.Fail with assert.FailNow (#27578) 2023-10-11 11:02:24 +00:00
comment.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
commit_status.go [GITEA] Use existing error functionality 2024-02-05 16:09:40 +01:00
edits.go
lfs.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
main_test.go
merge.go [GITEA] avoid superfluous synchronized pull_request run when opening a PR (#2236) 2024-02-05 16:57:58 +01:00
merge_merge.go
merge_prepare.go
merge_rebase.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
merge_squash.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
merge_test.go
patch.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
patch_unmerged.go
pull.go [GITEA] avoid superfluous synchronized pull_request run when opening a PR (#2236) 2024-02-05 16:57:58 +01:00
pull_test.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
review.go [GITEA] POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments 2024-02-05 16:09:42 +01:00
temp_repo.go Adjust object format interface (#28469) 2023-12-17 11:56:08 +00:00
update.go [GITEA] avoid superfluous synchronized pull_request run when opening a PR (#2236) 2024-02-05 16:57:58 +01:00
update_rebase.go