forgejo/services/pull
Earl Warren b173a0ccee
[GITEA] POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments
Refs: https://codeberg.org/forgejo/forgejo/issues/2109
(cherry picked from commit 8b4ba3dce7)
(cherry picked from commit 196edea0f9)

[GITEA] POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments (squash) do not implicitly create a review

If a comment already exists in a review, the comment is added. If it
is the first comment added to a review, it will implicitly create a
new review instead of adding to the existing one.

The pull_service.CreateCodeComment function is responsibe for this
behavior and it will defer to createCodeComment once the review is
determined, either because it was found or because it was created.

Rename createCodeComment into CreateCodeCommentKnownReviewID to expose
it and change the API endpoint to use it instead. Since the review is
provided by the user and verified to exist already, there is no need
for the logic implemented by CreateCodeComment.

The tests are modified to remove the initial comment from the fixture
because it was creating the false positive. I was verified to fail
without this fix.

(cherry picked from commit 6a555996dc)
2024-01-22 18:13:42 +00:00
..
check.go Abstract hash function usage (#28138) 2023-12-13 21:02:00 +00:00
check_test.go Replace assert.Fail with assert.FailNow (#27578) 2023-10-11 11:02:24 +00:00
comment.go Delete issue_service.CreateComment (#26298) 2023-08-04 13:34:34 +00:00
commit_status.go [GITEA] Use existing error functionality 2024-01-22 18:13:40 +00: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 make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
merge.go Abstract hash function usage (#28138) 2023-12-13 21:02:00 +00:00
merge_merge.go
merge_prepare.go
merge_rebase.go
merge_squash.go
merge_test.go
patch.go Improve ObjectFormat interface (#28496) 2023-12-19 07:20:47 +00:00
patch_unmerged.go
pull.go Retarget depending pulls when the parent branch is deleted (#28686) 2024-01-17 01:44:56 +01:00
pull_test.go
review.go [GITEA] POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments 2024-01-22 18:13:42 +00:00
temp_repo.go Adjust object format interface (#28469) 2023-12-17 11:56:08 +00:00
update.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
update_rebase.go