Commit status API - Status cannot transition via "enqueue"
Summary
Setting the status of a pending build to pending via the commit status API results in the error.
{"message":"Cannot transition status via :enqueue from :pending (Reason(s): Status cannot transition via \"enqueue\")"}
Steps to reproduce
- Set a commit state to
pending
curl --request POST --header "PRIVATE-TOKEN: $TOKEN" "https://gitlab.com/api/v3/projects/1120561/statuses/87edbf3a8ccd7da5c5d3dcaf683de9a8675d5acd?state=pending"
{"id":7608320,"sha":"87edbf3a8ccd7da5c5d3dcaf683de9a8675d5acd","ref":
"test-build","status":"pending","name":"default","target_url":null,"description":null,"created_at":"REMOVED",
"started_at":null,"finished_at":null,"allow_failure":false,"author"REMOVED"}}
- Set the commit to
pendingstate again
curl --request POST --header "PRIVATE-TOKEN: $TOKEN" "https://gitlab.com/api/v3/projects/1120561/statuses/87edbf3a8ccd7da5c5d3dcaf683de9a8675d5acd?state=pending"
{"message":"Cannot transition status via :enqueue from :pending (Reason(s): Status cannot transition via \"enqueue\")"}
Expected behavior
Build is set to state pending again
Actual behavior
Failure to set build state