Skip to content

Code Suggestions users table: allow filtering by project

Angelo Gulina requested to merge ag/425231-cs-filter-project into master

What does this MR do and why?

Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/425231. This MR introduces project filtering capabilities for Code Suggestions in Usage Quotas. Note that this only introduces the frontend parts, as the backend is not ready yet (https://gitlab.com/gitlab-org/gitlab/-/issues/425234).

Screenshots or screen recordings

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

Project filtering
https://www.loom.com/share/28151325951e4ca994a4a133c971ffb9?sid=6c280a54-c441-4d8c-be5b-6318d464ba66

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Example below:

  1. Needs both gdk and CustomersDot running
  2. In Rails console, enable Code Suggestions Feature.enable(:hamilton_seat_management)
  3. In Rails console, enable the filtering capabilities Feature.enable(:enable_add_on_users_filtering)

To assign Code Suggestions seats to your group:

  1. In Rails console, add_on = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test"}

  2. In Rails console, GitlabSubscriptions::AddOnPurchase.create!(add_on: add_on, namespace: Namespace.find(<you-name-space-id>), expires_on: 21.month.from_now, quantity: 5, purchase_xid: 'A-S0002')

  3. Visit any group or project member pages such as http://127.0.0.1:3000/groups/flightjs/-/usage_quotas#code-suggestions-usage-tab

  4. Try using the filters

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 Angelo Gulina

Merge request reports