Skip to content

Remove GraphQL `feature_flag` property

About

We currently have 2 methods of using feature flags in GraphQL:

  • feature_flag property (doc).
  • Toggle the value/behaviour with a feature flag (doc).

We also have a related alpha property (doc) that marks the item as @deprecated and appends the description with a notice that it should not be used.

Problem

feature_flag has always had a problem where when the flag is toggled on, the field is "released", even though the flag can be toggled off again.

We currently advise not to use feature_flag when following our frontend best-practice.

It's been raised that having 2 methods of feature flagging items, plus a new related alpha property, is confusing.

Proposal

There's an opportunity to remove feature_flag, and consolidate these items to:

  • Toggle the value/behaviour with a feature flag.
  • alpha

These two allow for these scenarios:

Scenario header
New volatile schema item with a flag Toggle + alpha
New volatile schema item with no flag alpha
New stable schema item with a flag Toggle
New stable schema item with no flag -

We would replace all current usage of feature_flag with a value/behaviour toggle behind a flag + mark the field as alpha if the flag is disabled by default.

We will need to update RuboCop::Cop::Gitlab::MarkUsedFeatureFlags #369202 (comment 1047189351).

Edited by Luke Duncalfe