Feature flag is a tech debt
Problem to solve
Each feature flag that we add to codebase is a ~"technical debt" as it adds a matrix of configurations.
We sometimes forget what setting is configured and why we haven't yet removed the feature flag. Thus we grow in the amount of feature flags in our codebase where it should be a short-living thing to use, and if the feature should be configurable it should be migrated to project/group/instance setting instead.
Today, we add a new feature flag, but we lack:
- A place where we have all feature flags listed with documentation and intended usage,
- A place that would keep track of when we want to remove the feature flag.
Reason
The YAML definition could help with the following goals:
- we have over 500 different feature flags today
- this is part of the effort to actively work on keeping amount of our feature flags as minimal as possible
- we have hard time tracking their usage
- we have ambiguous usage of feature flag with different
default_enabled:
and differentactors
used - we lack a clear indication who owns what feature flag and where to find relevant informations
- we do not emphasise the desire to create feature flag rollout issue to indicate that feature flag is in fact a ~"technical debt"
- we don't know exactly what feature flags we have in our codebase
- we don't know exactly how our feature flags are configured for different environments: what is being used for
test
, what we ship foron-premise
, what is our settings forstaging
,qa
andproduction
Proposal
Introduce a feature-flags/<name-of-feature.yml>
that would allow us to have:
- A central place where all feature flags are documented,
- A description of why the given feature flag was introduced,
- A what relevant issue and merge request it was introduced by,
- A deadline of feature flag removal, as this is gitlab-ce~3011693 with relevant issue discussing the rollout of the feature flag,
- Build automated documentation with all feature flags in the codebase,
- Track how many feature flags are per given stage.
The format of the file would be:
feature-flag: my-feature
default: true|false
group: Verify
description: |
This is a feature flag to control CI live-traces
issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/64783
deadline: 13.0
We discussed that in past for our feature-flags
a feature to make it code-oriented: https://gitlab.com/gitlab-org/gitlab-ee/issues/779#note_91779479