Skip to content

Create new route for Code Suggestions page in Admin Area

What does this MR do and why?

Context: https://gitlab.com/gitlab-org/gitlab/-/issues/432411.

This MR creates a Code Suggestions page in the Admin Area for Self-Managed instances, where the Code Suggestions UI would be added later (https://gitlab.com/gitlab-org/gitlab/-/issues/432440).

  • Add the /admin/code_suggestions route
  • Add a "Code Suggestions" entry in the sidebar for SM instances to access the page

Changes are behind the self_managed_code_suggestions feature flag.

Screenshots or screen recordings

Self-managed instance with the self_managed_code_suggestions feature flag enabled

Case Before After
Admin route (/admin/code_suggestions) Screenshot_2023-11-29_at_16.09.57 Screenshot_2023-11-30_at_14.57.53
Sidebar entry Screenshot_2023-11-29_at_16.09.44 Screenshot_2023-11-30_at_14.58.09

SaaS instance, or the self_managed_code_suggestions feature flag is disabled

Case Before After
Admin route (/admin/code_suggestions) Screenshot_2023-11-29_at_16.09.57 No change
Sidebar entry Screenshot_2023-11-29_at_16.09.44 No change

How to set up and validate locally

  1. Start GDK in SaaS / SM instance mode by setting the GITLAB_SIMULATE_SAAS environment variable to 1 / 0, respectively. (One way to do it is to add export GITLAB_SIMULATE_SAAS=0 to env.runit in your GDK root folder, for SM mode.)
  2. Start GDK.
  3. Set the self_managed_code_suggestions feature flag to true / false as needed. (You can do this by going into the Rails console using bundle exec rails console, then running Feature.enable(:self_managed_code_suggestions) or Feature.disable(:self_managed_code_suggestions), then exiting the console for the change to take effect.)
  4. Test that the /admin/code_suggestions path is available only for SM instances with the feature flag enabled.
  5. Test that the "Code Suggestions" sidebar nav menu is available only for SM instances with the feature flag enabled.

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 Mohamed Moustafa

Merge request reports