fix: Use metadata.featureFlags gql field for instance feature flags
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
-
Open the
gitlab-vscode-extension
project in VSCode with the relevant MR changes checked out. -
Build the
gitlab-vscode-extension
withyarn run build:desktop
. -
Make sure the
"gitlab.debug": true,
setting is added to your User VSCode settings. -
Run the VSCode task
Run Extensions (without build)
. -
In the new
[Extension Development Host]
VSCode window, open a folder that has a remote pointing to your local GDK instance. -
(Optional) If needed, sign out of your existing
gitlab-vscode-extension
account: -
(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 [Extension Development Host]
VSCode window after running the Run Extensions (without build)
task.
To test Feature Flag OFF state:
Steps
- 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/
. - In the
[Extension Development Host]
VSCode window, refresh the window with CMD+R. -
✅ Search for theShow Duo Workflow
command. It shouldn't show up. -
✅ Run theGitLab: Show Extensions Logs
command and search for[error]
. There shouldn't be any network errors.
To test Feature Flag ON state:
Steps
- 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/
. - In the
[Extension Development Host]
VSCode window, refresh the window with CMD+R. - 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. - 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 |
---|---|
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