Validate DiffNote's commit when created on a merge request
The following discussion from !14520 (merged) should be addressed:
-
@DouweM started a discussion: (+4 comments) Do you think it would make sense to validate that this commit is present and matches the
position, like we do inDiffNoteusing#diff_refs_match_commit?We could consider moving that method to
DiffPositionableNote, which isincluded by bothDiffNoteandDraftNote.
We are not validating the DiffNote's commit_id when created in a merge request. We should validate it as it's possible to create a DiffNote with an invalid commit ID. We are now doing it for DraftNote once https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14520 is merged.
Edited by Nick Thomas