Improve dependency export API usability
What does this MR do and why?
Improve dependency export API usability
By making the following changes:
- Return 404 if the record does not exist
- Present export data regardless of status
- Do not return 202 if the export failed (implies polling should continue)
- Expose status field so that user can understand the status
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Acquire a project with the dependency list set up.
- Create a personal access token
- Test the API using these commands:
curl -X POST -H "Private-Token: ${GITLAB_TOKEN}" http://gdk.local:3000/api/v4/projects/45/dependency_list_exports | jq
curl -i -H "Private-Token: ${GITLAB_TOKEN}" http://gdk.local:3000/api/v4/dependency_list_exports/62
curl -o export.json -H "Private-Token: ${GITLAB_TOKEN}" http://gdk.local:3000/api/v4/dependency_list_exports/62/download
jq . < export.json | head
Edited by Brian Williams