Merge request draft notes API does not perform necessary validation
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=579609) </details> <!--IssueSummary end--> ### Summary Creating a draft note on an otherwise "uncommentable" file (too large or a no-change rename) via [REST API](https://docs.gitlab.com/api/draft_notes/) returns a success and saves the note server-side. An API call to [publish](https://docs.gitlab.com/api/draft_notes/#publish-a-draft-note) the new note also succeeds, but the note just silently disappears. ### Steps to reproduce 1. Create a merge request containing a file change, that is too large according to set [limits](https://docs.gitlab.com/development/merge_request_concepts/diffs/#diff-limits) 2. Call the REST API [endpoint](https://docs.gitlab.com/api/draft_notes/#create-a-draft-note) to create a new draft note 3. Observe that the draft note was created and is returned by the draft notes REST API [query](https://docs.gitlab.com/api/draft_notes/#list-all-merge-request-draft-notes) 4. Publish the note with REST API call to either a [single note publisher](https://docs.gitlab.com/api/draft_notes/#publish-a-draft-note) or [bulk publisher](https://docs.gitlab.com/api/draft_notes/#publish-all-pending-draft-notes) 5. Observe that the note is no longer returned by neither draft notes list API, nor any other note APIs ### Example Project Example of the merge request with a large file (`huge_lorem.txt`) and a renamed file (`README_RENAMED.MD`): https://gitlab.com/iasemenov/mr-test/-/merge_requests/1 ### What is the current *bug* behavior? Every call succeeds while being incorrect ### What is the expected *correct* behavior? The call to create a draft note on an "uncommentable" file must return a 40* HTTP code error and a proper error message ### Output of checks This bug happens on GitLab.com
issue