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:
- ask rails for the html page of the index action
- the index html will initialize a vue component.
- 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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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