Code References

Ryan Feigenbaum - Sep 16 - - Dev Community

Code References

As companies grow, they often find themselves increasingly reliant on feature flags. While these are valuable tools, they sometimes linger in the codebase, leading to technical debt. It's important for developers to be aware of this and consider regular clean-ups. If not addressed in a timely manner, this can become a challenging issue, potentially impacting the efficiency and effectiveness of the engineering team. Proactive management of these feature flags can help ensure smooth and sustainable operations.

Code References

Code References is a new feature that allows teams to quickly see instances of feature flags being leveraged in their codebase. By scanning customers’ code bases via CLI tool and sending results to our application backend, GrowthBook can help surface valuable information early and direct devs to the exact lines of code that need addressing.

Let's take a high-level look how Code References in GrowthBook works and how your company can get started with their GrowthBook account.

Overview

Code References requires implementing a step in your development CI workflow.

Since the task of searching for multiple feature flag keys across a potentially large codebase can be hard, we've provided a low-level Go utility meant to run quickly on your CI infrastructure, that can produce results that your GrowthBook API can process.

This utility is called gb-find-code-refs, and is a fork of an existing open-source tool created by LaunchDarkly called ld-find-code-refs. Our changes have made the tool more general purpose, so you can use it for your own purposes in addition to using it with GrowthBook.

Using gb-find-code-refs, you can create a CI job that will fetch feature flags from GrowthBook, then scan your codebase for those flags using gb-find-code-refs, and finally submit those generated code references back to GrowthBook.

The diagram below illustrates the flow of information from gb-find-code-refs to GrowthBook.

Code References

Getting Started

To support Code References, we provide an all-in-one streamlined GitHub Action that is easy set up with your existing GitHub workflow. For Non-GitHub users, we provide all the tooling you'll need to set it up yourself.

See the Getting Started section in our documentation for more information.

Conclusion

The significance of of Code Refs underscores a broader goal towards more sustainable and efficient development practices, where the focus is on not just the introduction of new features but also on the long-term health and scalability of the software.

For companies looking to maintain a competitive edge in the field of software development, adopting tools like Code References is essential. We hope that you find Code References in GrowthBook to be a powerful tool in your toolkit for managing feature flags efficiently and effectively.

. . . . . . . . . . . . . . .