Skip to content

Extend extensions gallery metadata with enterprise group check

Issue: Update extensions marketplace metadata logic to... (#474154)

MR Chain:

  1. Add field enterprise_users_extensions_marketpla... (!161728)
  2. Extend extensions gallery metadata with enterpr... (!161740)
  3. Add UI for enterprise user Extension Marketplac... (!161819)

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
Screenshot_2024-08-05_at_11.04.34_AM Screenshot_2024-08-05_at_11.03.30_AM

Please note, the disabled message will be improved in Show extensions marketplace disabled message wh... (gitlab-web-ide#382)

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.

  1. In terminal in GitLab directory, run:

    gdk stop
    
    export GITLAB_SIMULATE_SAAS=1
    
    gdk start
  2. Create a new group (or you can use an existing one). In a rails console (rails c) set it's plan to Ultimate:

    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:

  1. Visit top-level group's homepage on GDK.

  2. (Optional) if a project doesn't exist for the group, go ahead and create one.

  3. Go to Settings > Domain Verification.

  4. Click Add Domain.

  5. For Domain enter example.com and use whatever Project.

  6. Click Add Domain.

  7. 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:

  1. Click Register now.
  2. Enter anything for the fields, except the email must have @example.com (or the verified domain you created in previous step).
  3. Click Register.
  4. 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:

  1. Go to Manage > Members in the sidebar.
  2. Click Invite members.
  3. For Username, search for the new user you just registered.
  4. For Select a role, select Developer.
  5. Click Invite.
  6. The user should show up in the list of members with an Enterprise User badge

Screenshot_2024-08-05_at_11.26.08_AM

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:

  1. Go to user preferences at /-/profile/preferences.
  2. Find the Integrations section and select Enable extension marketplace under Web IDE.
  3. 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:

  1. Visit any project with code.
  2. Click Edit > Web IDE.
  3. In the WebIDE sidebar, click the top hamburger menu, then View > Extensions.
  4. 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

Edited by Paul Slaughter

Merge request reports