Extend extensions gallery metadata with enterprise group check
Issue: Update extensions marketplace metadata logic to... (#474154 - closed)
MR Chain:
- Add field enterprise_users_extensions_marketpla... (!161728 - merged)
- Extend extensions gallery metadata with enterpr... (!161740 - merged)
- Add UI for enterprise user Extension Marketplac... (!161819 - merged)
What does this MR do and why?
Extend extensions gallery metadata with enterprise group check
- This also required adding EE overrides to some existing settings classes
- This is to support this epic
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
After following the validation steps below, the availability of the extensions marketplace should now be controllable for enterprise users:
Before | After |
---|---|
Please note, the disabled message will be improved in Show extensions marketplace disabled message wh... (gitlab-web-ide#382 - closed)
How to set up and validate locally
First, make sure that the following feature flags are enabled either through the rails console or /rails/features
:
vscode_web_ide
web_ide_oauth
web_ide_extensions_marketplace
Prerequisite: You must start GDK as SaaS with an Ultimate
licensed group. See docs for simulating a SaaS instance.
Ultimate
licensed group. See docs for simulating a SaaS instance.-
In terminal in GitLab directory, run:
gdk stop export GITLAB_SIMULATE_SAAS=1 gdk start
-
Create a new group (or you can use an existing one). In a rails console (
rails c
) set it's plan toUltimate
:Group.last.gitlab_subscription.update(hosted_plan: Plan.find_by(name: 'ultimate'))
Prerequisite: The group used in the last step ☝ must have a verified domain:
-
Visit top-level group's homepage on GDK.
-
(Optional) if a project doesn't exist for the group, go ahead and create one.
-
Go to Settings > Domain Verification.
-
Click Add Domain.
-
For Domain enter
example.com
and use whatever Project. -
Click Add Domain.
-
In the rails console (
rails c
), make the domain verified with:group = Group.find(<ID_OF_GROUP>) # <------- Change this line domain = Group.last.all_projects_pages_domains[0] domain.assign_attributes(verified_at: Time.current, enabled_until: 100.days.from_now, remove_at: nil) domain.save!(validate: false)
Prerequisite: Create a new user with an email of the verified domain in the last step and invite to group ☝
Open an Incognito Window of your browser and visit /users/sign_in
of the GDK:
- Click Register now.
- Enter anything for the fields, except the email must have
@example.com
(or the verified domain you created in previous step). - Click Register.
- Enter Username and Password and click Sign in.
In the other browser window that's signed into the group owner on the group settings page:
- Go to Manage > Members in the sidebar.
- Click Invite members.
- For Username, search for the new user you just registered.
- For Select a role, select
Developer
. - Click Invite.
- The user should show up in the list of members with an Enterprise User badge
Now, we need to enable the extension marketplace in our User's preferences. In the browser window that's signed into the new Enterprise User account:
- Go to user preferences at
/-/profile/preferences
. - Find the Integrations section and select Enable extension marketplace under Web IDE.
- Click Save changes*.
Open Web IDE and verify disabled/enabled marketplace:
The Enterprise Group has not opted into the extensions marketplace, so even though it's enabled on the user's preferences, it should still be disabled.
In the browser window that is signed into the Enterprise User account:
- Visit any project with code.
- Click Edit > Web IDE.
- In the WebIDE sidebar, click the top hamburger menu, then View > Extensions.
- The extensions marketplace should not be enabled and should show a message
The extension marketplace has been disabled
.
To enable the marketplace, in a rails console, find the group and enable enterprise_users_extensions_marketplace_enabled
:
group = Group.find(<ID_OF_GROUP>) # <--- Change this line
group.update!(enterprise_users_extensions_marketplace_enabled: true)
Related to #474154 (closed)