Skip to content

featureflag: Support environment variable to enable all feature flags

Patrick Steinhardt requested to merge pks-feature-flags-enable-all-via-env into master

While we strive hard to test code with all variants of feature flags, this can really only catch errors for which we have written tests in our own codebase. This opens up a blind spot when Gitaly is being tested via integration tests though, which are not part of our project. The result is that features hidden behind flags are never tested by QA. This is not ideal, as lots of bugs we had were thus exposed by users even though QA tests would've known to catch them.

We could make integration tests aware of feature flags we have defined, but that's a rather cumbersome job and would be guaranteed to run out of sync eventually. This commit thus introduces a rather blunt new tool, which is the new GITALY_TESTING_ENABLE_ALL_FEATURE_FLAGS environment variable. If it is set to "true", then we force-override all feature flags we have defined and pretend they're set to "true".

While this is not an elegant way to achieve our goal of testing feature flags, it should work well enough as we can now simply run two QA jobs: one with that environment variable set, and one with that environment variable unset.

Merge request reports

Loading