How Shortcut Uses LaunchDarkly
BlogProduct Development
Product Development

How Shortcut Uses LaunchDarkly

Christine Sanderson-Movius
Senior Software Engineer
November 19, 2022

In modern agile software development, feature management is a best practice to reduce risk and speed up code delivery. At Shortcut, our engineers use LaunchDarkly. This post will explore why and how we use it.

Why Use a Feature Flag?

Feature flags enable us to fine-tune how we ship features and experiments. Feature flags are currently used at Shortcut to:

  • Gate a feature from general release without needing a long-term feature branch or blocking other development on the application. This is particularly useful when incrementally working on a larger feature, as it allows us to break down work into smaller pieces and safely merge those incremental code changes into the main code branch.
  • Time the release of the feature with a special release event.
  • Target the release of a feature to specific user groups (e.g. new users in recently created organizations).
  • Perform A/B and multivariate experiments, which empower us to make informed decisions about what features to ship based on user behavior.
  • Reduce the need for rolling back deployments when a bug is introduced. One can quickly turn off the feature flag in production instead.

Why Use LaunchDarkly?

LaunchDarkly supports fine-tuned targeting, provides insights and debugging, and empowers backend and frontend engineers to work together by using a shared feature flag system. You can take a look at the LaunchDarkly docs to determine if this product suits your business' needs as well.

Feature Flags in the Product/Engineering/Design Process

  • Be proactive rather than reactive: Make a determination as early as possible in the ideation process to determine whether a feature flag is needed for an upcoming initiative. It is easier to account for a feature flag earlier on in the development process than to retrofit functionality to use a feature flag.
  • Backend and/or Frontend? Make a determination as to whether the feature flag should be read from the frontend, backend, or both sides of the stack. Backend: use a feature flag on the backend if the flag is being used to control data/entity generation.
  • Clean up feature flags: Make follow up Stories to cleanup related feature flag logic after a feature has been successfully released. Feature flags make related logic more complex, and we want to prevent a situation in which engineers are trying to work around old, unneeded feature flag logic. Account for time for this cleanup in your quarterly planning.

Read More: 10 Ways to Use Shortcut Docs

Initial Feature Flag Setup

The LaunchDarkly Docs provide robust instructions on how to set up a flag, but here are some additional considerations:

  • Flag environment: At Shortcut, we have two environments: test and production. When you create a flag in test, it will automatically create a corresponding flag in production, and then you can separately manage the flag in each environment.
  • Enable flag for frontend evaluation: Under Client-side SDK availability be sure to select SDKs using Client-side ID.


LaunchDarkly

Don't forget to select SDKs using Client-side ID!

  • Typos: This may sound silly, but seriously double check your flag name and key for typos. Flag keys cannot be changed after they are created, so better to check now than to be stuck with a misspelled flag key later!
  • Tags: Consider adding a tag with your team's name. This will allow for easier flag management for your team.
  • Flag Description: Don't leave it blank! Make it useful and specific.
  • Variation Descriptions: It is usually assumed that true refers to the new/variant feature. However, it can be helpful to add a short description to the variations to provide extra clarity.
  • Subscribe to your flag in Slack: Consider subscribing your team's Slack channel to the flags you own.

Feature Flags in Development

  • True/False Behavior: Compose functionality so that true evaluates to the "new" feature or the "variant" if running an A/B test.
  • Tests: Ensure your unit and/or integration test suite is set up to support testing feature flags. Write tests to support functionality for all relevant feature flag combinations to reduce introducing regressions.

Enabling Feature Flags and Using Targeting

  • General release tips: LaunchDarkly docs for turning flags on and off. You can schedule turning a flag on or off for a specific time - perfect for release events! Coordinating multiple flags? Consider setting flag prerequisites.
  • When performing a targeted release: LaunchDarkly docs for targeting users with flags. Here at Shortcut, when we perform A/B tests we group users by organization or workspace to ensure teammates get the same experience. If you also wish to group users, you can use advanced rollouts. You can also use user segments in your targeting, which can then be used for consistent targeting across multiple flags.

Releasing with Feature Flags

Shortcut Tip: Keep track of enabling the feature flag with either a Task or a separate Story

  • When to use a Task: When a flag is connected to a single Story. If you have a VCS integration, it may automatically mark a Story as complete when the relevant code deployed, so it can be easy to overlook a lingering task to turn on the flag when the parent Story is marked as complete. So you may want to create a separate Story for enabling the flag anyways.
  • When to use a separate Story: When the flag is connected to a larger Epic or set of Stories. When a flag has more complex configuration rules (e.g. using a user segment, setting up an A/B test).

Feature Flag Cleanup

  • As mentioned above, make follow up Stories to cleanup related feature flag logic after a feature has been successfully released. LaunchDarkly will update a flag's status to Launched when all users have received the same variation of a flag for 7+ days.
  • Once a flag is removed from the code, it will no longer be evaluated by LaunchDarkly. Then, a flag is automatically marked as Inactive when it has not been evaluated for 7+ days.
  • Once a flag has been marked as Inactive it is safe to archive this flag.

Use Shortcut

Just as we use LaunchDarkly, LaunchDarkly has been using Shortcut for years. We help the LaunchDarkly team stay in sync and focused on delivering industry-leading feature flag management to customers (like us) around the world. Read the full story here.

Topics:
No items found.
Share this Shortcut story
Enjoy your work
Project management software should be helpful, not a hassle.