Skip to content

Add ability to select multiple users for bulk action

Vamsi Vempati requested to merge 442370-multi-select-users into master

What does this MR do and why?

Add ability to select multiple users for bulk action

  • Add a new column for the user selection checkbox
  • Show a summary of number of users selected
  • Add new tests for changes made

This is one of the first MRs that collectively implement add-on bulk assignment feature. Please see below the breakdown.

MR Status
Add ability select multiple users 👈 👈 👈 You are here
Show confirmation modal with selected users 🚧
API integration to assign add-on to selected users 🚧

Related to #442370

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Scenario Screenshot

SaaS - gitlab_com_duo_pro_bulk_user_assignment feature flag disabled

[No change]

Screenshot 2024-02-29 at 4.32.08 PM.png

SaaS - gitlab_com_duo_pro_bulk_user_assignment feature flag enabled

Screen_Recording_2024-03-01_at_11.06.22_AM

Self Managed

[No change]

Screenshot_2024-02-29_at_4.36.03_PM

How to set up and validate locally

SaaS

SaaS steps

Application setup

  1. Customers Dot needs to be setup in order to view the billing page for a group
  2. Start GDK in SaaS mode GITLAB_SIMULATE_SAAS=1 gdk start

Group setup

  1. Create a Group
  2. Buy a Subscription for your group from Settings > Billing

Feature flag

Run the following in your rails console

Feature.enable(:hamilton_seat_management, Namespace.find(your-group-id))
Feature.enable(:gitlab_com_duo_pro_bulk_user_assignment, Namespace.find(your-group-id))

Add-on purchase

Purchase an add-on for the subscription purchased above in Group setup step by following the instructions here (under Add Code Suggestions Add-On to a subscription section).

Code Suggestions tab

  1. Visit /groups/<your-namespace-name>/-/usage_quotas#code-suggestions-usage-tab

SM

SM steps

Application setup

  1. Customers Dot needs to be setup
  2. Start GDK in SM mode GITLAB_SIMULATE_SAAS=0 gdk start

Feature flag

Run the following in your rails console using GITLAB_SIMULATE_SAAS=0 rails c

Feature.enable(:self_managed_code_suggestions)

Subscription setup

  1. Buy Self-Managed Ultimate 1 Year subscription on Zuora Sandbox
  2. Copy the license key from the subscription details page on local Customers Dot instance
  3. Paste the license key on your SM instance at Admin Area > Settings > General > Add license
  4. Refresh the page to see the Code Suggestions Menu item appear under Admin Area

Add-on purchase

Purchase add-on seats by running the following on rails console GITLAB_SIMULATE_SAAS=0 rails c

# create an add_on record if not already created
add_on = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test"}
# create add_on_purchase record without the namespace, mimicking SM instance
add_on_purchase = GitlabSubscriptions::AddOnPurchase.create!(add_on: add_on, expires_on: 1.year.from_now, quantity: 10, purchase_xid: 'A-12345')

Code Suggestions menu item

  1. Log in to the SM instance as an admin, eg. root
  2. Visit Code Suggestions Seat management page by clicking on Code Suggestions menu item under Admin Area
Edited by Vamsi Vempati

Merge request reports