Skip to content

fix: Use metadata.featureFlags gql field for instance feature flags

Paul Slaughter requested to merge ps-update-gql-for-feature-flag-service into main

Issue: `featureFlagEnabled` GraphQL query fails on FOS... (gitlab#480888 - closed)

Description

This MR intends to unblock the @gitlab/web-ide version updates (see relevant MR) by resolving `featureFlagEnabled` GraphQL query fails on FOS... (gitlab#480888 - closed). The featureFlagEnabled GraphQL field blows up in Dev/Test environments when a flag isn't found (which caused FOSS jobs to fail).

We've added a new metadata.featureFlags GraphQL field which can support querying multiple flags at once and will nicely noop if a flag isn't recognized.

Related Issues

How has this been tested?

Prerequisites:

Before testing out this MR changes, you'll want to connect your local GitLab Workflow Extension to the GDK where you an easily change feature flags:

Steps
  1. Open the gitlab-vscode-extension project in VSCode with the relevant MR changes checked out.

  2. Build the gitlab-vscode-extension with yarn run build:desktop.

  3. Make sure the "gitlab.debug": true, setting is added to your User VSCode settings.

  4. Run the VSCode task Run Extensions (without build).

  5. In the new [Extension Development Host] VSCode window, open a folder that has a remote pointing to your local GDK instance.

  6. (Optional) If needed, sign out of your existing gitlab-vscode-extension account:

    Screenshot_2024-09-06_at_9.33.13_AM

  7. (Optional) In the GitLab Workflow tab, follow the steps to authenticate to the GDK instance.

To test:

The following steps assumed you've followed the prerequisites which opened [Extension Development Host] VSCode window after running the Run Extensions (without build) task.

To test Feature Flag OFF state:

Steps
  1. In your GDK, make sure the duo_workflow feature flag is disabled. You can use the rails console or Feature Flag UI at /rails/features/.
  2. In the [Extension Development Host] VSCode window, refresh the window with CMD+R.
  3. Search for the Show Duo Workflow command. It shouldn't show up.
  4. Run the GitLab: Show Extensions Logs command and search for [error]. There shouldn't be any network errors.

To test Feature Flag ON state:

Steps
  1. In your GDK, make sure the duo_workflow feature flag is enabled. You can use the rails console or Feature Flag UI at /rails/features/.
  2. In the [Extension Development Host] VSCode window, refresh the window with CMD+R.
  3. Search for the Show Duo Workflow command. It should show up. If it doesn't, the feature flag value might still be cached. Try waiting a few seconds and refreshing the VSCode window again.
  4. Run the GitLab: Show Extensions Logs command and search for [error]. There shouldn't be any network errors.

Screenshots (if appropriate)

With project connected to local https://gdk.test:3443 and relevant GDK account authenticated:

duo_workflow on duo_workflow off
Screenshot_2024-09-06_at_9.29.25_AM Screenshot_2024-09-06_at_9.28.46_AM

Please note, the single ExtensionState error in the console is unrelated

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes
Edited by Paul Slaughter

Merge request reports

Loading