Skip to content

Add title and subtitle to Code Suggestions admin page

What does this MR do and why?

Resolves https://gitlab.com/gitlab-org/gitlab/-/issues/436407. Adds a title and subtitle to the Code Suggestions Admin Page in Self-Managed instances, as per this Figma design.

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.

Case Before After
Code suggestions add-on purchased Screenshot_2024-01-04_at_13.29.42 Screenshot_2024-01-04_at_13.30.04
Code suggestions add-on not purchased Screenshot_2024-01-04_at_13.29.01 No change

How to set up and validate locally

Pre-testing setup

  1. Start GDK in Self-Managed mode using GITLAB_SIMULATE_SAAS=0 gdk start (this is the default mode).
  2. Enable the following feature flags in the Rails console (bundle exec rails c):
Feature.enable(:code_suggestions)
Feature.enable(:code_suggestions_tokens_api)
Feature.enable(:purchase_code_suggestions)
Feature.enable(:self_managed_code_suggestions)
  1. Log into GDK using your root user.
  2. Ensure you have a valid paid license (Premium or Ultimate) through Admin Area > Subscriptions.

Testing without Code Suggestions add-on

  1. Navigate to gdk.test:3000/admin/code_suggestions.
  2. Verify that there is no change to the UI (see screenshots).

Testing with Code Suggestions add-on

  1. Purchase a "Self-Managed - Duo Pro" add-on from the Zuora API Sandbox, or spoof one using the following commands in the Rails console:
# Feel free to delete these objects after testing
add_on = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test"}
add_on_purchase = GitlabSubscriptions::AddOnPurchase.create!(
  add_on: add_on, expires_on: 1.month.from_now, quantity: 5, purchase_xid: 'A-S0001'
)
add_on_purchase.update(expires_on: 1.month.from_now)
  1. Navigate to gdk.test:3000/admin/code_suggestions.
  2. Verify that the Code Suggestion page full UI has a title and subtitle present.
Edited by Mohamed Moustafa

Merge request reports