Skip to content

Do not track `list_repositories` twice

What does this MR do?

Inspecting the index action of the container repository controllers at the project and group level, I noticed that they follow the same pattern:

  1. ask rails for the html page of the index action
  2. the index html will initialize a vue component.
  3. the vue component requests to the rails index action again but with the json format to get the images to display

The tracking event list_repositories is created on both 1. and 3. which effectively duplicates the number of events per page visit.

This MR does the following:

  • create the tracking event list_repositories for the index / json format action (3. above) only where the repositories list is actually pulled from the registry.
  • on the controller at the project level, move the @images assignment so that it's only done for the json format where it is actually used.

Screenshots

n/a

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 David Fernandez

Merge request reports