Skip to content

Ensure no seat workers run after FF disabled

Josianne Hyson requested to merge jh/change_seat_assignment_worker_ff into master

What does this MR do and why?

Helps address https://gitlab.com/gitlab-org/gitlab/-/issues/427034+

Control the add-on assignment bulk refresh seats workers with a different FF. The original FF is being updated to accept the group as the actor. As the workers all act in bulk, we don't have access to the group, so create a separate FF for this.

Rollout issue for new FF: https://gitlab.com/gitlab-org/gitlab/-/issues/428258+.

How to set up and validate locally

  1. Create an add-on purchase:
    GitlabSubscriptions::AddOnPurchase.create!(add_on: GitlabSubscriptions::AddOn.find_or_create_by!(name: :code_suggestions), namespace: Group.roots.last, expires_on: 1.year.from_now, quantity: 10, purchase_xid: 'A-1234')
  2. Trigger the refresh worker
    • Tail the sidekiq logs gdk tail -F rails-background-jobs
    • Sign in to the GDK as an admin
    • Navigate to http://localhost:3000/admin/sidekiq/cron
    • Enqueue the gitlab_subscriptions_add_on_purchases_schedule_bulk_refresh_user_assignments_worker
    • View that only the ScheduleBulkRefreshUserAssignmentsWorker is enqueued, once
    • Note that add_on_purchase.last_assigned_users_refreshed_at has not been updated
  3. Enable the FF Feature.enable(:bulk_add_on_assignment_refresh_worker)
  4. Trigger the refresh worker
    • Enqueue the gitlab_subscriptions_add_on_purchases_schedule_bulk_refresh_user_assignments_worker
    • View that only the ScheduleBulkRefreshUserAssignmentsWorker is enqueued
    • View that the BulkRefreshUserAssignmentsWorker is enqueue
    • Note that add_on_purchase.last_assigned_users_refreshed_at has been updated

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 Josianne Hyson

Merge request reports