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 in DiffNote using #diff_refs_match_commit?

    We could consider moving that method to DiffPositionableNote, which is included by both DiffNote and DraftNote.

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 Jul 29, 2019 by Nick Thomas
Assignee Loading
Time tracking Loading