e658a6a9cd
Instead of repeating the tests that verify the ID of a comment is related to the repository of the API endpoint, add the middleware function commentAssignment() to assign ctx.Comment if the ID of the comment is verified to be related to the repository. There already are integration tests for cases of potential unrelated comment IDs that cover some of the modified endpoints which covers the commentAssignment() function logic. * TestAPICommentReactions - GetIssueCommentReactions * TestAPICommentReactions - PostIssueCommentReaction * TestAPICommentReactions - DeleteIssueCommentReaction * TestAPIEditComment - EditIssueComment * TestAPIDeleteComment - DeleteIssueComment * TestAPIGetCommentAttachment - GetIssueCommentAttachment The other modified endpoints do not have tests to verify cases of potential unrelated comment IDs. They no longer need to because they no longer implement the logic to enforce this. They however all have integration tests that verify the commentAssignment() they now rely on does not introduce a regression. * TestAPIGetComment - GetIssueComment * TestAPIListCommentAttachments - ListIssueCommentAttachments * TestAPICreateCommentAttachment - CreateIssueCommentAttachment * TestAPIEditCommentAttachment - EditIssueCommentAttachment * TestAPIDeleteCommentAttachment - DeleteIssueCommentAttachment (cherry picked from commit d414376d749041da1be288c02fdaa24fddeafd5c) (cherry picked from commit 09db07aeaed167edc66cb832b0aa54b31d14f0d8) (cherry picked from commit f44830c3cba0b9416505a2b0b560cfa096ffeb7c) Conflicts: modules/context/api.go https://codeberg.org/forgejo/forgejo/pulls/2249 (cherry picked from commit 9d1bf7be15420ce4ca6e92a8bd048d483172de3b) |
||
---|---|---|
.. | ||
action.go | ||
avatar.go | ||
blob.go | ||
branch.go | ||
collaborators.go | ||
commits.go | ||
file.go | ||
flags.go | ||
fork.go | ||
git_hook.go | ||
git_ref.go | ||
hook.go | ||
hook_test.go | ||
issue.go | ||
issue_attachment.go | ||
issue_comment.go | ||
issue_comment_attachment.go | ||
issue_dependency.go | ||
issue_label.go | ||
issue_pin.go | ||
issue_reaction.go | ||
issue_stopwatch.go | ||
issue_subscription.go | ||
issue_tracked_time.go | ||
key.go | ||
label.go | ||
language.go | ||
main_test.go | ||
migrate.go | ||
milestone.go | ||
mirror.go | ||
notes.go | ||
patch.go | ||
pull.go | ||
pull_review.go | ||
release.go | ||
release_attachment.go | ||
release_tags.go | ||
repo.go | ||
repo_test.go | ||
runners.go | ||
star.go | ||
status.go | ||
subscriber.go | ||
tag.go | ||
teams.go | ||
topic.go | ||
transfer.go | ||
tree.go | ||
wiki.go |