Skip to content

Code Suggestions settings visible only on EE Premium/Ultimate

What does this MR do and why?

Fixes a bug, when we showed Code Suggestions application settings block for CE instance (original MR).
CE is not allowed to use Code Suggestions, so we shouldn't render these settings.
EE Free tier equals CE (https://docs.gitlab.com/ee/development/ee_features.html#simulate-a-ce-instance-when-unlicensed), so we shouldn't show Code Suggestions settings for EE Free (unlicensed) either.

I followed https://docs.gitlab.com/ee/development/ee_features.html#implement-a-new-ee-feature

I needed to introduce :code_suggestions PREMIUM feature to the list; without guarding the partial with - return unless License.feature_available?(:code_suggestions), we would still show the settings to EE Free, but it is not desired, as EE free is expected to be equal to CE.

Slack discussion regarding implementation and introducing a new Premium feature: https://gitlab.slack.com/archives/C048Z2DHWGP/p1690368542429369

Slack confirmation from PM that we are dropping CS support for GitLab EE Free from 16.3: https://gitlab.slack.com/archives/C04KWTK3GFJ/p1690493214691099?thread_ts=1690471296.130199&cid=C04KWTK3GFJ

👀 Note for the reviewers: this is my first CE -> EE conversion. Although I tested everything manually on licensed GDK and GDK imitating FOSS, I'd ask you to raise all potential concerns in case I missed something.

Screenshots or screen recordings

FOSS

Screenshot_2023-07-26_at_16.25.37

Licensed EE instance: no changes expected

Screenshot_2023-07-26_at_16.16.04

How to set up and validate locally

We need to check that 1) the Licensed EE instance would still show the settings and 2) that on FOSS, the settings are now hidden.

Check as licensed EE instance

  1. Pull this MR
  2. Make sure you have a license on your GDK
  3. Visit http://localhost:3000/admin/application_settings/general, scroll down, and make sure there is Code Suggestions section (last one, after GitLab for Slack app)

Check as CE

Refer to https://docs.gitlab.com/ee/development/ee_features.html#simulate-a-ce-instance-with-a-licensed-gdk

  1. Pull this MR
  2. Create an env.runit file in the root of your GDK with the line: export FOSS_ONLY=1
  3. Then restart the GDK: gdk restart rails && gdk restart webpack
  4. Visit http://localhost:3000/admin/application_settings/general, scroll down, and make sure there is no Code Suggestions section (GitLab for Slack app is the last)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #419273 (closed)

Edited by Aleksei Lipniagov

Merge request reports