Commit Status API stage filter returning no results
Summary
Bug introduced in latest release where when trying to filter via stage using the API Commit Status it now always returning an empty array even when the stage exists.
This does not affect commits/pipelines created a few weeks ago. Running the API call against these still returns results. It only affects new pipelines/commits.
Steps to reproduce
- Create new project
- Setup a basic CI pipeline such as below:
stages:
- test
unit-test-job:
stage: test
script:
- echo "test"
- Create a new branch
- Make a modification and create a merge request.
- Create an API token
- Get the project ID and Commit SHA
- Use this to populate the below and run the API query.
curl --header "PRIVATE-TOKEN: <your_access_token>" --url "https://gitlab.com/api/v4/projects/<project_id>/repository/commits/<commit_sha>/statuses?stage=test"
- can verify if that the api call is working by filtering using
nameinstead
curl --header "PRIVATE-TOKEN: <your_access_token>" --url "https://gitlab.com/api/v4/projects/<project_id>/repository/commits/<commit_sha>/statuses?name=unit-test-job"
Example Project
https://gitlab.com/cmarais_ultimate_group/ticket_work/591871_api_endpoint_not_working/test_project
What is the current bug behavior?
unable to filter commit status by stage
What is the expected correct behavior?
should be able to filter commit status by stage
Output of checks
This bug happens on GitLab.com
Possible fixes
No workaround currently
Edited by Charl Marais