mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-15 07:09:47 +01:00
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 |
||
---|---|---|
.. | ||
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 |