Feature Flags

Feature flags are a way to control the behaviour of the software. They are typically used to control the behaviour of the software in development and production, by controlling the introduction of features across multiple software components.

This page provides SKAO software developers with the necessary information to understand, implement, and manage feature flags effectively within our ecosystem.

Note

Feature flags are used as a term to describe a variety of different ways to achieve the same goal in this document. The premise is the same as described above, but the implementation may differ. Feature flags can be implemented as runtime configurable toggles via API calls, or via Tango attributes, or deployment configuration options as program parameters for the applications, or compile-time options as build flags, or any other custom implementations. The goal is to provide a consistent way to control the behaviour of the software across multiple components.

Explanation of feature flags

  • The Feature Flags provides a detailed explanation of what feature flags are, why we want to use them and how they fit in to the software development lifecycle at the SKAO.

Read in-depth information on them here.

TL;DR on how to use feature flags:

First, please read the explanation of feature flags and different types of feature flags, where they can be used, where they should not be used and how to use them.

Then, follow the table below (click to enlarge if needed):

Feature Flag Usage Flowchart

Different Options for Implementation

There are several options for implementing feature flags:

  • GitLab’s built-in Feature Flags functionality, which is based on the open-source Unleash feature management system. This is a runtime configurable toggle.

  • Tango Attributes as Feature Flags. This is a runtime configurable toggle and only applicable to SKA Control Systems.

  • Static Configuration (that can be used with Vault based runtime configuration). This is a static/deployment configuration option.

What GitLab Provides:

  • UI for Management

  • Environment Scoping

  • Basic Strategies

  • API Access

  • Integration with Unleash

Limitations & Considerations:

  • Performance (over 100+ flags)

  • Advanced Strategies

  • Dependency on GitLab

  • No Built-in Proxy

What Tango Attributes Provides:

  • Familiar implementation

  • Integrated/Coupled Configuration

  • API Access

  • Leverage other Tango features

Limitations & Considerations:

  • Not applicable outside of Tango

  • No Advanced Strategies

  • No UI for management

  • More complex UX (config & setup)

  • No Advanced Strategies

What Static Configuration Provides:

  • Vault for Management

  • Environment Scoping

  • API Access

  • Act as any other config (less docs needed, more user familiarity)

  • Static configuration options for deployment.

Limitations & Considerations:

  • More complex/error prone to implement

  • No Advanced Strategies

  • Harder to control & track

  • Dependency on Vault

Project examples

Attention

More examples are requested to raise the awareness of feature flags and how to use them. Please add your examples to this list below following the contribution guidelines.

Tutorials

Reference