Skip to content

Conversation

@PhilippeVienne
Copy link
Contributor

Pull request to resolve: #367

  • Implement Container Registry API following documentation
  • Add Documentation about API on readme
  • Implement Testing for the API

/*
This function is not implemented because we need the library to support FormData on DELETE requests.
See: https://docs.gitlab.com/ee/api/container_registry.html#delete-repository-tags-in-bulk
*/
Copy link
Collaborator

@gmessner gmessner Jun 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PhilippeVienne
It is highly unusual to have form data with the DELETE method. Have you tried this with query params?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just following the curl request set as example on the GitLab documentation. I will have a try with params.

Copy link
Collaborator

@gmessner gmessner Jun 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PhilippeVienne
Let me know how it goes. If it requires form data, I'll add a delete() method that accepts form data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My local test have correctly a 202 Accepted response but the bulk DELETE seems to fail in all situation, as stated by documentation and also as you suggested with Query Params

@gmessner
Copy link
Collaborator

gmessner commented Jun 6, 2019

@PhilippeVienne
I forgot to thank you for your contribution, so thank you.

I am going to go ahead and merge this PR. Once merged, I'll look into and implement the bulk delete functionality. I will also create the TestContainerRegistryApi test class but would like to work with you to fully implement the integration tests for this. Will provide more information later today.

@gmessner gmessner merged commit 7eb08e7 into gitlab4j:master Jun 6, 2019
gmessner added a commit that referenced this pull request Jun 7, 2019
gmessner added a commit that referenced this pull request Jun 7, 2019
gmessner added a commit that referenced this pull request Jun 7, 2019
gmessner added a commit that referenced this pull request Jun 7, 2019
@gmessner
Copy link
Collaborator

gmessner commented Jun 7, 2019

@PhilippeVienne
The bulk tag delete is working correctly using query parameters, what I did find out is that if you call the bulk delete API endpoint more than once in an hour, the GitLab server simply responds with a 202 status and does absolutely nothing. It does work on the first use though or done less than once an hour. The “at most once an hour” is mentioned in the GitLab documentation (https://docs.gitlab.com/ee/api/container_registry.html#delete-repository-tags-in-bulk)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Container Registry API is not implemented

2 participants