Manage Feature Flags
Migrate and delete old feature flags
Codegen’s GraphSitter library provides powerful APIs for managing feature flag usage in code. This guide will walk you through the basics of how to detect and clean up obsolete feature flags.
Removing rolled out flags
Once a feature has been fully rolled out behind a flag and is stable on production, the next step is to remove old fallback code paths.
Common syntax for feature flags include:
Deleting unused feature flags
Detecting unused feature flag is a specific use case of deleting dead code, isolated to a specific search space.
Recommended Next Steps
Once rolled out feature flags are removed, new dead code paths may have been created. Run a delete dead code codemod to ensure complete clean-up.
Best Practices
-
Use Caution: Ensure that flags have been fully rolled out before deleting.
-
Fix Tests: Check for additional ways feature flags are used in the codebase (e.g. string arguments in test patches).
Related Skills
Was this page helpful?