[go: up one dir, main page]

Skip to content

Commits API returns a 400 Bad Request when a quick action is only supplied

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

This is related to #346557 (closed), but specifically refers to the commits REST API (https://docs.gitlab.com/ee/api/commits.html).

If I attempt to do something like the following where the quick action is the note:

curl -v -X POST -H "PRIVATE-TOKEN: <PAT>" "https://gitlab.exmaple.com/api/v4/projects/1/repository/commits/b819d7d9e6b9e8ec4b2501ec935645b09b67f22a/comments" --form 'note=/tag my-test-commit test' --form 'path=README.md' --form "line=23" --form "line_type=new"

I get a 400 Bad Request with the response:

{"message":"Failed to save note {:note=>[\"can't be blank\"]}"}

Behind the scenes, the quick action actually succeeded.

Edited by 🤖 GitLab Bot 🤖