From d6dff64e5cfd062aeda8c767062aae58179d390e Mon Sep 17 00:00:00 2001 From: Paul Slaughter Date: Mon, 5 Aug 2024 13:14:13 -0500 Subject: [PATCH 1/3] Add UI for enterprise user extension marketplace availability - This is default to off so that groups must opt-in - This updates `enterprise_users_extensions_marketplace_enabled?` to take into account the license and feature checks - This helps resolve [this epic][1] [1]: https://gitlab.com/groups/gitlab-org/-/epics/14604 --- .../groups/settings/_permissions.html.haml | 1 + doc/user/enterprise_user/index.md | 17 +++++++ doc/user/profile/preferences.md | 2 +- doc/user/project/web_ide/index.md | 3 +- .../controllers/concerns/ee/groups/params.rb | 8 +++- ee/app/models/ee/group.rb | 14 +++++- .../models/gitlab_subscriptions/features.rb | 1 + .../_extensions_marketplace.html.haml | 13 ++++++ .../ee/web_ide/extensions_marketplace_spec.rb | 10 ++-- ee/spec/models/ee/group_spec.rb | 46 ++++++++++++++++++- ee/spec/requests/groups_controller_spec.rb | 28 +++++++++++ .../settings/_permissions.html.haml_spec.rb | 29 ++++++++++++ lib/web_ide/extensions_marketplace.rb | 34 +++++++++++--- locale/gitlab.pot | 9 ++++ .../web_ide/extensions_marketplace_spec.rb | 31 +++++++------ 15 files changed, 217 insertions(+), 29 deletions(-) create mode 100644 ee/app/views/groups/settings/_extensions_marketplace.html.haml diff --git a/app/views/groups/settings/_permissions.html.haml b/app/views/groups/settings/_permissions.html.haml index 3374a74dccbdd6..a52592095b8e4f 100644 --- a/app/views/groups/settings/_permissions.html.haml +++ b/app/views/groups/settings/_permissions.html.haml @@ -46,6 +46,7 @@ = render 'groups/settings/membership', f: f, group: @group = render 'groups/settings/remove_dormant_members', f: f, group: @group = render_if_exists 'groups/settings/personal_access_tokens', f: f, group: @group + = render_if_exists 'groups/settings/extensions_marketplace', f: f, group: @group %h5= _('Customer relations') .form-group.gl-mb-3 diff --git a/doc/user/enterprise_user/index.md b/doc/user/enterprise_user/index.md index d9a68ba8e0ee01..f2eb6e694c1799 100644 --- a/doc/user/enterprise_user/index.md +++ b/doc/user/enterprise_user/index.md @@ -191,6 +191,23 @@ To disable 2FA: 1. Find a user with the **Enterprise** and **2FA** badges. 1. Select **More actions** (**{ellipsis_v}**) and select **Disable two-factor authentication**. +### Enable extension marketplace for Web IDE and workspaces + +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/161819) in GitLab 17.4 [with flags](../../administration/feature_flags.md) named `web_ide_oauth` and `web_ide_extensions_marketplace`. Disabled by default. + +FLAG: +The availability of this feature is controlled by feature flags. +For more information, see the history. + +Top-level group Owners can enable/disable the extension marketplace feature in the Web IDE and workspaces for +enterprise users owned by the group: + +1. On the left sidebar, select **Search or go to** and find your group. +1. Select **Settings > General**. +1. Find the **Web IDE and workspaces** section under **Permissions and group features**. +1. Check/uncheck **Enable extension marketplace**. +1. Click **Save changes**. + ### Prevent enterprise users from creating groups and projects outside the corporate group A SAML identity administrator can configure the SAML response to set: diff --git a/doc/user/profile/preferences.md b/doc/user/profile/preferences.md index b423f219b06d20..ccc1ef66e1b666 100644 --- a/doc/user/profile/preferences.md +++ b/doc/user/profile/preferences.md @@ -401,7 +401,7 @@ You must be the administrator of the GitLab instance to configure GitLab with So ### Integrate with the extension marketplace > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151352) in GitLab 17.0 [with flags](../../administration/feature_flags.md) named `web_ide_oauth` and `web_ide_extensions_marketplace`. Disabled by default. -> - [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/459028) in GitLab 17.0. +> - [Partially enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/459028) in GitLab 17.0. FLAG: The availability of this feature is controlled by feature flags. diff --git a/doc/user/project/web_ide/index.md b/doc/user/project/web_ide/index.md index 8df8d04b0751ba..41df369cb38b6d 100644 --- a/doc/user/project/web_ide/index.md +++ b/doc/user/project/web_ide/index.md @@ -227,7 +227,7 @@ DETAILS: **Status**: Beta > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151352) in GitLab 17.0 [with flags](../../../administration/feature_flags.md) named `web_ide_oauth` and `web_ide_extensions_marketplace`. Disabled by default. -> - [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/459028) in GitLab 17.0. +> - [Partially enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/459028) in GitLab 17.0. FLAG: The availability of this feature is controlled by feature flags. @@ -236,6 +236,7 @@ For more information, see the history. Prerequisites: - You must [enable the extension marketplace](../../profile/preferences.md#integrate-with-the-extension-marketplace) in user preferences. +- For enterprise users, an Owner of the enterprise group must [enable the extension marketplace](../../enterprise_user/index.md#enable-extension-marketplace-for-web-ide-and-workspaces) in the group settings. You can use the extension marketplace to download and run VS Code extensions in the Web IDE. diff --git a/ee/app/controllers/concerns/ee/groups/params.rb b/ee/app/controllers/concerns/ee/groups/params.rb index 3a3e2cf21596c1..52bd5c47e66f0d 100644 --- a/ee/app/controllers/concerns/ee/groups/params.rb +++ b/ee/app/controllers/concerns/ee/groups/params.rb @@ -22,7 +22,7 @@ def group_feature_attributes private - # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity -- The .tap block + # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize -- The .tap block # requires many necessary checks for each parameter. def group_params_ee [ @@ -73,9 +73,13 @@ def group_params_ee params_ee << :disable_personal_access_tokens params_ee << :enable_auto_assign_gitlab_duo_pro_seats if allow_update_enable_auto_assign_gitlab_duo_pro_seats? + + if current_group&.can_manage_extensions_marketplace_for_enterprise_users? + params_ee << :enterprise_users_extensions_marketplace_enabled + end end end - # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity + # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize def allow_update_enable_auto_assign_gitlab_duo_pro_seats? ::Feature.enabled?(:auto_assign_gitlab_duo_pro_seats, current_group) && diff --git a/ee/app/models/ee/group.rb b/ee/app/models/ee/group.rb index 9f872e09060a90..159cc54f95e67b 100644 --- a/ee/app/models/ee/group.rb +++ b/ee/app/models/ee/group.rb @@ -99,7 +99,7 @@ module Group delegate :user_cap_enabled?, to: :namespace_settings delegate :disable_personal_access_tokens=, to: :namespace_settings - delegate :enterprise_users_extensions_marketplace_enabled?, :enterprise_users_extensions_marketplace_enabled=, to: :namespace_settings + delegate :enterprise_users_extensions_marketplace_enabled=, to: :namespace_settings delegate :wiki_access_level, :wiki_access_level=, to: :group_feature, allow_nil: true delegate :enable_auto_assign_gitlab_duo_pro_seats, :enable_auto_assign_gitlab_duo_pro_seats=, :enable_auto_assign_gitlab_duo_pro_seats_human_readable, :enable_auto_assign_gitlab_duo_pro_seats_human_readable=, to: :namespace_settings, allow_nil: true @@ -1020,6 +1020,18 @@ def code_suggestions_purchased? ::CloudConnector::AvailableServices.find_by_name(:code_suggestions).purchased?(self) end + def can_manage_extensions_marketplace_for_enterprise_users? + root? && + licensed_feature_available?(:disable_extensions_marketplace_for_enterprise_users) && + ::WebIde::ExtensionsMarketplace.feature_enabled_for_any_user? + end + + def enterprise_users_extensions_marketplace_enabled? + return true unless can_manage_extensions_marketplace_for_enterprise_users? + + namespace_settings.enterprise_users_extensions_marketplace_enabled? + end + # Disable personal access tokens for enterprise users of this group def disable_personal_access_tokens? root? && diff --git a/ee/app/models/gitlab_subscriptions/features.rb b/ee/app/models/gitlab_subscriptions/features.rb index 61d3eeefb5cd8d..bb7d0e67b460a9 100644 --- a/ee/app/models/gitlab_subscriptions/features.rb +++ b/ee/app/models/gitlab_subscriptions/features.rb @@ -105,6 +105,7 @@ class Features default_project_deletion_protection delete_unconfirmed_users dependency_proxy_for_packages + disable_extensions_marketplace_for_enterprise_users disable_name_update_for_users disable_personal_access_tokens domain_verification diff --git a/ee/app/views/groups/settings/_extensions_marketplace.html.haml b/ee/app/views/groups/settings/_extensions_marketplace.html.haml new file mode 100644 index 00000000000000..a83439b5a27faa --- /dev/null +++ b/ee/app/views/groups/settings/_extensions_marketplace.html.haml @@ -0,0 +1,13 @@ +- f = local_assigns.fetch(:f) +- group = local_assigns.fetch(:group) + +- return unless group.can_manage_extensions_marketplace_for_enterprise_users? + +%h5= _('Web IDE and workspaces') + +.form-group.gl-mb-3 + = f.gitlab_ui_checkbox_component :enterprise_users_extensions_marketplace_enabled, checkbox_options: { checked: group.enterprise_users_extensions_marketplace_enabled? } do |c| + - c.with_label do + = s_('GroupSettings|Enable extension marketplace') + - c.with_help_text do + = s_("GroupSettings|Enterprise user accounts can use the extension marketplace in the Web IDE and workspaces.") diff --git a/ee/spec/lib/ee/web_ide/extensions_marketplace_spec.rb b/ee/spec/lib/ee/web_ide/extensions_marketplace_spec.rb index 9630687ec895f8..9b867eb15307cd 100644 --- a/ee/spec/lib/ee/web_ide/extensions_marketplace_spec.rb +++ b/ee/spec/lib/ee/web_ide/extensions_marketplace_spec.rb @@ -5,7 +5,7 @@ RSpec.describe WebIde::ExtensionsMarketplace, feature_category: :web_ide do using RSpec::Parameterized::TableSyntax - let_it_be_with_reload(:group) { create(:group) } + let_it_be(:group) { create(:group) } let_it_be_with_reload(:current_user) { create(:user) } describe '#webide_extensions_gallery_settings' do @@ -35,11 +35,15 @@ web_ide_oauth: current_user, vscode_web_ide: current_user ) - current_user.update!(extensions_marketplace_opt_in_status: :enabled, enterprise_group: enterprise_group) - group.update!(enterprise_users_extensions_marketplace_enabled: extensions_enabled) + + current_user.update!(enterprise_group: enterprise_group, extensions_marketplace_opt_in_status: :enabled) end it 'returns expected settings' do + if enterprise_group + expect(group).to receive(:enterprise_users_extensions_marketplace_enabled?).and_return(extensions_enabled) + end + expect(webide_settings).to match(expectation) end end diff --git a/ee/spec/models/ee/group_spec.rb b/ee/spec/models/ee/group_spec.rb index d8751c36c3556d..ce4bd0ba64781b 100644 --- a/ee/spec/models/ee/group_spec.rb +++ b/ee/spec/models/ee/group_spec.rb @@ -344,7 +344,6 @@ it { is_expected.to delegate_method(:duo_availability=).to(:namespace_settings).with_arguments(:args) } it { is_expected.to delegate_method(:experiment_settings_allowed?).to(:namespace_settings) } it { is_expected.to delegate_method(:user_cap_enabled?).to(:namespace_settings) } - it { is_expected.to delegate_method(:enterprise_users_extensions_marketplace_enabled?).to(:namespace_settings) } it { is_expected.to delegate_method(:enterprise_users_extensions_marketplace_enabled=).to(:namespace_settings).with_arguments(:args) } end @@ -3978,4 +3977,49 @@ def webhook_headers it { is_expected.to be false } end end + + describe '#can_manage_extensions_marketplace_for_enterprise_users?' do + let_it_be(:root_group) { create(:group) } + let_it_be(:child_group) { create(:group, parent: root_group) } + + subject(:can_manage_extensions_marketplace_for_enterprise_users?) { group.can_manage_extensions_marketplace_for_enterprise_users? } + + where(:group, :licensed_feature_available, :feature_flags_enabled, :expected) do + ref(:root_group) | true | true | true + ref(:child_group) | true | true | false + ref(:root_group) | false | true | false + ref(:root_group) | true | false | false + end + + with_them do + before do + allow(::WebIde::ExtensionsMarketplace).to receive(:feature_enabled_for_any_user?).and_return(feature_flags_enabled) + stub_licensed_features(disable_extensions_marketplace_for_enterprise_users: licensed_feature_available) + end + + it { is_expected.to eq(expected) } + end + end + + describe '#enterprise_users_extensions_marketplace_enabled?' do + let_it_be(:group) { create(:group) } + + subject(:enterprise_users_extensions_marketplace_enabled?) { group.enterprise_users_extensions_marketplace_enabled? } + + where(:value, :licensed_feature_available, :expected) do + true | true | true + false | true | false + false | false | true + end + + with_them do + before do + group.update!(enterprise_users_extensions_marketplace_enabled: value) + allow(::WebIde::ExtensionsMarketplace).to receive(:feature_enabled_for_any_user?).and_return(true) + stub_licensed_features(disable_extensions_marketplace_for_enterprise_users: licensed_feature_available) + end + + it { is_expected.to eq(expected) } + end + end end diff --git a/ee/spec/requests/groups_controller_spec.rb b/ee/spec/requests/groups_controller_spec.rb index 7783a45cf6b1bd..2e74f43cbfe852 100644 --- a/ee/spec/requests/groups_controller_spec.rb +++ b/ee/spec/requests/groups_controller_spec.rb @@ -363,6 +363,34 @@ end end + context 'settings enterprise_users_extensions_marketplace_enabled' do + let(:params) { { group: { enterprise_users_extensions_marketplace_enabled: true } } } + + before do + stub_feature_flags( + vscode_web_ide: true, + web_ide_oauth: true, + web_ide_extensions_marketplace: true + ) + end + + it 'does not change the column' do + expect { subject }.not_to change { group.reload.enterprise_users_extensions_marketplace_enabled? } + expect(response).to have_gitlab_http_status(:found) + end + + context 'when disable_extensions_marketplace_for_enterprise_users feature is available' do + before do + stub_licensed_features(disable_extensions_marketplace_for_enterprise_users: true) + end + + it 'successfully changes the column' do + expect { subject }.to change { group.reload.enterprise_users_extensions_marketplace_enabled? } + expect(response).to have_gitlab_http_status(:found) + end + end + end + context 'setting enable_auto_assign_gitlab_duo_pro_seats' do let(:params) { { group: { enable_auto_assign_gitlab_duo_pro_seats: true } } } diff --git a/ee/spec/views/groups/settings/_permissions.html.haml_spec.rb b/ee/spec/views/groups/settings/_permissions.html.haml_spec.rb index c0304831736949..6e8b869d18b904 100644 --- a/ee/spec/views/groups/settings/_permissions.html.haml_spec.rb +++ b/ee/spec/views/groups/settings/_permissions.html.haml_spec.rb @@ -131,4 +131,33 @@ end end end + + context 'for extensions marketplace settings' do + let_it_be(:section_title) { _('Web IDE and workspaces') } + let_it_be(:checkbox_label) { s_('GroupSettings|Enable extension marketplace') } + + context 'when cannot manage extensions marketplace for enterprise users' do + it 'renders nothing', :aggregate_failures do + allow(group).to receive(:can_manage_extensions_marketplace_for_enterprise_users?).and_return(false) + + render + + expect(rendered).to render_template('groups/settings/_extensions_marketplace') + expect(rendered).not_to have_content(section_title) + expect(rendered).not_to have_field(checkbox_label, type: 'checkbox') + end + end + + context 'when can manage extensions marketplace for enterprise users' do + it 'renders checkbox', :aggregate_failures do + allow(group).to receive(:can_manage_extensions_marketplace_for_enterprise_users?).and_return(true) + + render + + expect(rendered).to render_template('groups/settings/_extensions_marketplace') + expect(rendered).to have_content(section_title) + expect(rendered).to have_unchecked_field(checkbox_label, type: 'checkbox') + end + end + end end diff --git a/lib/web_ide/extensions_marketplace.rb b/lib/web_ide/extensions_marketplace.rb index 94a6797572f720..74aeb1b038a2e2 100644 --- a/lib/web_ide/extensions_marketplace.rb +++ b/lib/web_ide/extensions_marketplace.rb @@ -2,13 +2,23 @@ module WebIde module ExtensionsMarketplace - def self.feature_enabled?(user:) - return false unless Feature.enabled?(:web_ide_extensions_marketplace, user) - - # TODO: Add instance-level setting for this https://gitlab.com/gitlab-org/gitlab/-/issues/451871 + # This returns true if the extensions marketplace feature is available to any users + # + # @return [Boolean] + def self.feature_enabled_for_any_user? + feature_flag_enabled_for_any_actor?(:web_ide_extensions_marketplace) && + feature_flag_enabled_for_any_actor?(:vscode_web_ide) && + feature_flag_enabled_for_any_actor?(:web_ide_oauth) + end - # note: OAuth **must** be enabled for us to use the extension marketplace - ::WebIde::DefaultOauthApplication.feature_enabled?(user) + # This returns true if the extensions marketplace feature is available to the given user + # + # @param user [User] + # @return [Boolean] + def self.feature_enabled?(user:) + Feature.enabled?(:web_ide_extensions_marketplace, user) && + Feature.enabled?(:vscode_web_ide, user) && + Feature.enabled?(:web_ide_oauth, user) end # This value is used when the end-user is accepting the third-party extension marketplace integration. @@ -74,7 +84,17 @@ def self.user_preferences_url ::Gitlab::Routing.url_helpers.profile_preferences_url(anchor: 'integrations') end - private_class_method :help_url, :user_preferences_url + def self.feature_flag_enabled_for_any_actor?(flag) + # Short circuit if we're globally enabled + return true if Feature.enabled?(flag, nil) + + # The feature could be conditionally applied, so check if `!off?` + # We also can't *just* check `!off?` because the ActiveRecord might not exist and be default enabled + feature = Feature.get(flag) # rubocop:disable Gitlab/AvoidFeatureGet -- See above + feature && !feature.off? + end + + private_class_method :help_url, :user_preferences_url, :feature_flag_enabled_for_any_actor? end end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index be43146f8bfb69..d1dcd434843d3e 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -26029,6 +26029,9 @@ msgstr "" msgid "GroupSettings|Enable email notifications" msgstr "" +msgid "GroupSettings|Enable extension marketplace" +msgstr "" + msgid "GroupSettings|Enable overview background aggregation for Value Streams Dashboard" msgstr "" @@ -26041,6 +26044,9 @@ msgstr "" msgid "GroupSettings|Enforce SSH Certificates" msgstr "" +msgid "GroupSettings|Enterprise user accounts can use the extension marketplace in the Web IDE and workspaces." +msgstr "" + msgid "GroupSettings|Experiment" msgstr "" @@ -59995,6 +60001,9 @@ msgstr "" msgid "Web IDE" msgstr "" +msgid "Web IDE and workspaces" +msgstr "" + msgid "Web Terminal" msgstr "" diff --git a/spec/lib/web_ide/extensions_marketplace_spec.rb b/spec/lib/web_ide/extensions_marketplace_spec.rb index b93fab3312f425..fbfcedfcc375aa 100644 --- a/spec/lib/web_ide/extensions_marketplace_spec.rb +++ b/spec/lib/web_ide/extensions_marketplace_spec.rb @@ -18,24 +18,29 @@ } end - describe '#feature_enabled?' do - where(:web_ide_extensions_marketplace, :web_ide_oauth, :expectation) do - ref(:current_user) | false | false - ref(:current_user) | true | true - false | false | false - false | true | false + describe 'feature enabled methods' do + where(:vscode_web_ide, :web_ide_extensions_marketplace, :web_ide_oauth, :expectation) do + ref(:current_user) | ref(:current_user) | ref(:current_user) | true + ref(:current_user) | false | ref(:current_user) | false + ref(:current_user) | ref(:current_user) | false | false + false | ref(:current_user) | false | false end with_them do - it 'returns the expected value' do - stub_feature_flags(web_ide_extensions_marketplace: web_ide_extensions_marketplace) + before do + stub_feature_flags( + vscode_web_ide: vscode_web_ide, + web_ide_extensions_marketplace: web_ide_extensions_marketplace, + web_ide_oauth: web_ide_oauth + ) + end - if web_ide_extensions_marketplace - expect(::WebIde::DefaultOauthApplication) - .to receive(:feature_enabled?).with(current_user).and_return(web_ide_oauth) - end + describe '#feature_enabled?' do + it { expect(described_class.feature_enabled?(user: current_user)).to be(expectation) } + end - expect(described_class.feature_enabled?(user: current_user)).to be(expectation) + describe '#feature_enabled_for_any_user?' do + it { expect(described_class.feature_enabled_for_any_user?).to be(expectation) } end end end -- GitLab From 97f0e899cf2431a908e6ef71a4b098d71e51ab86 Mon Sep 17 00:00:00 2001 From: Paul Slaughter Date: Thu, 22 Aug 2024 11:34:25 -0500 Subject: [PATCH 2/3] Apply doc suggestions based on review - Remove note on flag enablement because it actually wasn't enabled fully --- doc/user/enterprise_user/index.md | 14 ++++++++------ doc/user/profile/preferences.md | 1 - doc/user/project/web_ide/index.md | 9 +++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/doc/user/enterprise_user/index.md b/doc/user/enterprise_user/index.md index f2eb6e694c1799..95a53d8e65d55b 100644 --- a/doc/user/enterprise_user/index.md +++ b/doc/user/enterprise_user/index.md @@ -191,7 +191,7 @@ To disable 2FA: 1. Find a user with the **Enterprise** and **2FA** badges. 1. Select **More actions** (**{ellipsis_v}**) and select **Disable two-factor authentication**. -### Enable extension marketplace for Web IDE and workspaces +### Enable the extension marketplace for the Web IDE and workspaces > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/161819) in GitLab 17.4 [with flags](../../administration/feature_flags.md) named `web_ide_oauth` and `web_ide_extensions_marketplace`. Disabled by default. @@ -199,14 +199,16 @@ FLAG: The availability of this feature is controlled by feature flags. For more information, see the history. -Top-level group Owners can enable/disable the extension marketplace feature in the Web IDE and workspaces for -enterprise users owned by the group: +If you have the Owner role for a top-level group, you can +enable the extension marketplace for enterprise users. + +To enable the extension marketplace for the Web IDE and workspaces: 1. On the left sidebar, select **Search or go to** and find your group. 1. Select **Settings > General**. -1. Find the **Web IDE and workspaces** section under **Permissions and group features**. -1. Check/uncheck **Enable extension marketplace**. -1. Click **Save changes**. +1. Expand the **Permissions and group features** section. +1. Under **Web IDE and workspaces**, select the **Enable extension marketplace** checkbox. +1. Select **Save changes**. ### Prevent enterprise users from creating groups and projects outside the corporate group diff --git a/doc/user/profile/preferences.md b/doc/user/profile/preferences.md index ccc1ef66e1b666..0a471b1cbdac7e 100644 --- a/doc/user/profile/preferences.md +++ b/doc/user/profile/preferences.md @@ -401,7 +401,6 @@ You must be the administrator of the GitLab instance to configure GitLab with So ### Integrate with the extension marketplace > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151352) in GitLab 17.0 [with flags](../../administration/feature_flags.md) named `web_ide_oauth` and `web_ide_extensions_marketplace`. Disabled by default. -> - [Partially enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/459028) in GitLab 17.0. FLAG: The availability of this feature is controlled by feature flags. diff --git a/doc/user/project/web_ide/index.md b/doc/user/project/web_ide/index.md index 41df369cb38b6d..a65a16f9cf325e 100644 --- a/doc/user/project/web_ide/index.md +++ b/doc/user/project/web_ide/index.md @@ -226,8 +226,7 @@ For more information, see [Remote development](../remote_development/index.md). DETAILS: **Status**: Beta -> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151352) in GitLab 17.0 [with flags](../../../administration/feature_flags.md) named `web_ide_oauth` and `web_ide_extensions_marketplace`. Disabled by default. -> - [Partially enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/459028) in GitLab 17.0. +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151352) as a [beta](../../../policy/experiment-beta-support.md#beta) in GitLab 17.0 [with flags](../../../administration/feature_flags.md) named `web_ide_oauth` and `web_ide_extensions_marketplace`. Disabled by default. FLAG: The availability of this feature is controlled by feature flags. @@ -235,8 +234,10 @@ For more information, see the history. Prerequisites: -- You must [enable the extension marketplace](../../profile/preferences.md#integrate-with-the-extension-marketplace) in user preferences. -- For enterprise users, an Owner of the enterprise group must [enable the extension marketplace](../../enterprise_user/index.md#enable-extension-marketplace-for-web-ide-and-workspaces) in the group settings. +- In user preferences, you must + [enable the extension marketplace](../../profile/preferences.md#integrate-with-the-extension-marketplace). +- In group settings, users with the Owner role must + [enable the extension marketplace](../../enterprise_user/index.md#enable-the-extension-marketplace-for-the-web-ide-and-workspaces) for enterprise users. You can use the extension marketplace to download and run VS Code extensions in the Web IDE. -- GitLab From 9d1bbd81db7bfe6086c9802a89c74a5de8dd69ff Mon Sep 17 00:00:00 2001 From: Paul Slaughter Date: Thu, 22 Aug 2024 15:05:31 -0500 Subject: [PATCH 3/3] Fix integration spec - This requires licensed features, feature flags and a root group in order for the `enterprise_group_disabled` to be triggered --- ee/spec/lib/web_ide/settings/settings_integration_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ee/spec/lib/web_ide/settings/settings_integration_spec.rb b/ee/spec/lib/web_ide/settings/settings_integration_spec.rb index bd06b704da04bd..a319b4b3085f50 100644 --- a/ee/spec/lib/web_ide/settings/settings_integration_spec.rb +++ b/ee/spec/lib/web_ide/settings/settings_integration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe ::WebIde::Settings, feature_category: :web_ide do # rubocop:disable RSpec/FilePath -- This cop fails because the spec is named 'settings_integration_spec.rb' but describes ::WebIde::Settings class. But we want it that way, because it's an integration spec, not a unit spec, but we still want to be able to use `described_class` - let_it_be_with_reload(:group) { create(:group, :private, :nested) } + let_it_be_with_reload(:group) { create(:group, :private) } let_it_be_with_reload(:user) { create(:enterprise_user, enterprise_group: group) } let_it_be(:options) do { @@ -15,6 +15,8 @@ subject(:settings) { described_class.get([:vscode_extensions_gallery_metadata], options) } before do + stub_feature_flags(vscode_web_ide: true, web_ide_oauth: true, web_ide_extensions_marketplace: true) + stub_licensed_features(disable_extensions_marketplace_for_enterprise_users: true) user.update!(extensions_marketplace_enabled: true) end -- GitLab