Declutter your flags with automated flag archival checks in LaunchDarkly featured image

Feature management is a best practice for high-velocity engineering teams to reduce risk, improve productivity, and enhance customer experiences with every release. At LaunchDarkly, many of our customers gate every single change to production behind a feature flag to ensure that they can de-risk the the rollout and roll back instantly if something goes wrong.

But what happens when you’re a large, high-velocity organization that puts every release behind a feature flag? Like a lot of our power users, you could quickly rack up tens of thousands of flags, some of which are old and need to be cleaned up.

The ‘flag sprawl’ problem

While ignoring this “chore” might seem harmless, the proliferation of stale flags can clutter the codebase, making it harder to read and maintain. Additionally, the flag sprawl can also make it hard to comprehend and find things in the user interface. 

This accrual of tech debt disrupts developer workflows, forcing them to think about how to clean up flags rather than building new products. Engineering teams often manage flag debt using spreadsheets, create manual tasks in their issue-tracking tools to clean up old flags post-release, or have ‘archival days’ where valuable engineering hours are spent cleaning up flags.

Automated archival checks with LaunchDarkly

To solve this problem, we’re excited to introduce automated checks in LaunchDarkly to let you know when a flag is ready to be removed. That means that your team can more easily and proactively manage flag debt, contributing to a cleaner codebase and freeing up more time for building and shipping new products.

How does it work?

We believe that there are two critical stages to cleaning up a released flag – removing the code references followed by archiving the flag in the dashboard. To help with this, LaunchDarkly runs checks across all your critical environments before marking any flags with one of the following indicators.

A flag is marked as Needs code removal when it is:

  • Temporary
  • Older than 30 days
  • Has code references
  • Has been evaluated in the past 7 days
  • Serving a single variation 
  • Not a prerequisite for any other flags 

Note: LaunchDarkly’s code references integration can help quickly identify all the places in your codebase where the flag key is referenced and needs to be cleaned up.

Similarly, a flag is marked as Ready for Archival when it is:

  • Temporary
  • Older than 30 days
  • Has no code references
  • Has not been evaluated in the past 7 days
  • And is not a prerequisite for any other flags

LaunchDarkly’s flags list will list archival checks such as Ready for code removal and Ready for Archival by default next to any flags that are ready to be cleaned up. 

Users can also filter to see specific flags that they might want to remove from code or archive in the LaunchDarkly interface.

Coming soon

We understand that your mileage may vary when it comes to the criteria for defining things as “Needs code removal” and “Ready to archive”. Therefore, we’re going to work on the ability to allow users to customize these definitions to meet their organization’s needs.

For a more detailed explanation of how to start archiving your flags, refer to our documentation.

Like what you read?
Get a demo
Related Content