Skip to content

Add logging to DeleteTagsService

🤔 What does this MR do?

DeleteTagsService is the service interacting with the container registry to mark tags for destruction.

This MR is providing some logs for #208193 (closed) where we will refactor several workers and this service. As such, we need more visibility on:

  • were the delete requests to the container successful?
  • how many tags were deleted by the #execute calls?

While adding the rspec examples to the spec file I took the liberty to clean it up a bit:

  • Several stub_request were really similar and I centralized those in two helper functions.

Screenshots

From the application_json.log (samples of what logs we can expect):

{"severity":"INFO","time":"2020-06-30T13:10:09.939Z","correlation_id":"69d0b96680efa10ee2e670b2ff44bd5b","service_class":"Projects::ContainerRepository::DeleteTagsService","container_repository_id":3,"message":"deleted tags","deleted_tags_count":2}
{"severity":"ERROR","time":"2020-06-30T13:10:10.233Z","correlation_id":"01b503bcdfb44e52cff011bcb4b6b162","service_class":"Projects::ContainerRepository::DeleteTagsService","container_repository_id":3,"message":"could not generate manifest"}
{"severity":"ERROR","time":"2020-06-30T13:10:10.371Z","correlation_id":"5d4d62ef147f3813ac3f7e51f4f59a4b","service_class":"Projects::ContainerRepository::DeleteTagsService","container_repository_id":3,"message":"could not delete tags"}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Ethan Urie

Merge request reports

Loading