Skip to content

Nimbus Features

roux g. buciu edited this page Apr 21, 2023 · 4 revisions

What is a feature?

A feature, in Nimbus, is a configuration that outlines a set of properties that define the experimentable aspects of a feature. Each feature should be distinct, and standalone from other features.

How it works

The Feature Manifest Language file

Nimbus works by outlining available features in the nimbus.fml.yaml file. This file has three main sections:

  • about - identifying the client for Nimbus
  • channels - outlining the available channels for building/setting defaults for
  • include - outlining the various features to include in the file at build time

Features

Feature files are found in the nimbus-features directory from the root of the repo. For ease of working & maintaining features, each feature should be placed in its own file. Each feature file is composed of several sections:

Section Optional Description
features No Contains the feature in the file
objects Yes Outlines the custom objects for the specific feature
enums Yes Outlines the custom enums for the specific feature

If objects or enums don't contain anything, they may be omitted from the file.

When creating a new feature, please use the iOSNimbusFeatureUtility.

How to use it

Some external documentation on Nimbus features can be found here. However, setting up a new feature in code is fairly simple, if these steps are followed.

  1. Use the iOSNimbusFeatureUtility to add a feature
  2. Either add the feature to the FeatureFlagManager, if it's a feature flag, or create a separate feature layer governing that feature as required.
  3. Use the layer in the app.

The iOSNimbusFeatureUtility

This utility should be used for managing the nimbus.fml.yaml file, and currently provides the ability to add a feature and update the file. To use it, use the following command at the root level of the repository in your terminal. Note that an argument is required.

$ sh iOSNimbusFeatureUtility.sh --argument

Arguments

Argument Description
--add featureNameFeature This creates a feature file named featureNameFeature.yaml in the nimbus-features directory. It also adds a template to that file for a new feature. featureName should be camelCase and should have the suffix Feature. This will then also run the --update command, so it's not necessary to run it yourself.
--update This updates the nimbus.fml.yaml file with the feature that currently exist in the nimbus-features directory.

Editing a feature

To edit a feature, open the respective feature's file in the nimbus-features directory, and proceed to edit the feature.

To edit a feature simply means to add or remove a variable, as well as adding or removing objects or enums as necessary.

Note: the top level feature name should not be changed unless working with a Nimbus engineer to make sure the old name is removed from the database, as this is currently a manual process.

Clone this wiki locally