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
Screenshots or screen recordings
FOSS
Licensed EE instance: no changes expected
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
- Pull this MR
- Make sure you have a license on your GDK
- Visit http://localhost:3000/admin/application_settings/general, scroll down, and make sure there is
Code Suggestions
section (last one, afterGitLab 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
- Pull this MR
- Create an env.runit file in the root of your GDK with the line:
export FOSS_ONLY=1
- Then restart the GDK:
gdk restart rails && gdk restart webpack
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #419273 (closed)