Skip to content

Inject feature flags into Praefect's gitaly calls

John Cai requested to merge jc-praefect-ff into master

When Praefect initiates gRPC calls to Gitaly, it uses a context that does not include feature flags that were injected by Rails. This means we need a way to know which feature flags are enabled or disabled. To do this, we can ask Rails directly through the /features API.

The previous commit added the client method to call the /features endpoint in GitLab. This commit adds a helper that gets a list of features that are enabled or disabled, and injects those into the outgoing context.

We are limited however, in terms of the /features endpoint however. If the a feature gate has a "boolean" value that is set to "true", we know it is enabled. If there is only one feature gate and it is a "boolean" value set to "false", we know it's disabled. However, if the "boolean" value is set to "false" but there are more feature gates, we don't have a way to tell if it is enabled or not.

This will give us some feature flag control in Praefect versus none, so we can start with this iterative step. gitlab#363372 will add functionality to the GitLab endpoint for more fine grained knowledge of whether or not a feature flag is enabled.

Merge request reports