Skip to content

Added trigger for namespace_aggregation_worker

What does this MR do and why?

Adds a trigger for namespace_aggregation_worker when container_registry_size is updated in project_statistics

Ref: https://gitlab.com/gitlab-org/gitlab/-/issues/358389

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

  1. Open rails console and get Project from a namespace
  2. Update the container_registry_size for the project_statistics of the project
  3. Trigger project_statistics.refresh! or ps.refresh!(only: [:container_registry_size])
  4. Validate Namespaces::ScheduleAggregationWorker is triggered via sidekiq: gdk redis-cli monitor | grep -i ScheduleAggregationWorker
[1] pry(main)> n = Namespace.where(:path => 'suraj').first
[2] pry(main)> p = n.all_projects.first
[3] pry(main)> ps = p.statistics
[8] pry(main)> ps.refresh!
=> true
[8] pry(main)> ps.refresh!(only: [:container_registry_size])
=> true

Screenshot_2022-05-23_at_2.50.02_PM

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Suraj Tripathi

Merge request reports

Loading