Improve dependency export API usability

What does this MR do and why?

Improve dependency export API usability

By making the following changes:

  1. Return 404 if the record does not exist
  2. Present export data regardless of status
  3. Do not return 202 if the export failed (implies polling should continue)
  4. 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.

asciicast

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Acquire a project with the dependency list set up.
  2. Create a personal access token
  3. 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

Merge request reports

Loading