Skip to content

Handle undefined feature flag case in `featureFlagEnabled` query

Cindy Halim requested to merge ch-featureflagenabled-gql-foss-only-bug into master

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

What does this MR do and why?

The GitLab Workflow extension performs the featureFlagEnabled query for an EE only feature flag, duo_workflow. This causes Web IDE feature specs to fail in FOSS_ONLY mode, where ee code is not available, since the Feature.enabled? method called within the query resolver raises an exception when attempting to check the status of a feature flag that doesn't exist.

This MR attempts to resolve this by catching InvalidFeatureFlagError and passing the error message as a GQL error response.

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

Returns GQL error if flag is not defined Otherwise, returns feature flag value:
undefined.png defined.png
  • We'll also want to make sure the GitLab FOSS pipeline passes
Edited by Cindy Halim

Merge request reports

Loading