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 b3be895a30)
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 Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
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 make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
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 Refactor and tidy-up the merge/update branch code (#22568) 2023-03-07 15:07:35 -05:00
merge_prepare.go Refactor merge/update git command calls (#23366) 2023-03-09 09:48:52 -06:00
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 Support template for merge message description (#22248) 2022-12-29 14:40:20 +02:00
patch.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
patch_unmerged.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
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 Refactor and tidy-up the merge/update branch code (#22568) 2023-03-07 15:07:35 -05:00