- Status: accepted
- Deciders: @travis79, @jhugman, @teshaq, @k88hudson
- Date: 2021-10-26
Context and problem statement
In order to allow product teams to define experimentable application features, there needs to be a manifest file which defines these in a way that is understandable to the Nimbus ecosystem. The feature manifest should define data types used in the application code to configure features. It should also be able to define a complete default configuration for each application feature.
The purpose of this document is to define the decision on the format of the feature manifest but not be a full specification of the schema or language of it.
- It should not be onerous to write and maintain for a junior engineer or intern
- A single feature should be readable/guessable by a product owner or designer
- Once written, it should be easy to navigate and read, even if there are many features
- It should map easily to Kotlin, Swift (and Rust)
- No algebraic types
- No inheritance / polymorphism
- Defaults should be specifiable at the property level
- Defaults should be specifiable at the feature level
- Alignment with Desktop Nimbus which is already using a feature manifest, in the hopes that the schema can be shared between mobile and desktop eventually
The front-end format for the Nimbus manifests will follow the YAML format.
- More concise, and less likely to have errors due to formatting such as missing a bracket or comma
- Support for comments within the document
- A schema can be defined using JSONSchema for the purposes of validation
- YAML is a superset of JSON, so any existing JSON should be able to be parsed by the YAML parser
- JSON can be embedded within YAML
- Support for multiple documents within one file, so each feature could be a separate "document", simplifying and flattening the schema
- Yet another data representation language to deal with
- Readability over other formats is marginal
To illustrate the YAML format, here is an example of the "homescreen" feature, first in JSON, then the same representation in YAML.
This example is only intended to illustrate the structure of the data, and not serve as an example of the suggested format. See the YAML example below for the suggested format.
"doc": "The sections of the homescreen",
"doc": "The original frecency sorted sites"
"doc": "Jump back in section"
"doc": "Tabs that have been bookmarked recently"
"doc": "Represents the homescreen feature",
"doc": "A map of booleans",
This example is meant to illustrate the concise format and readability of YAML.
# Define your enumerations here
description: The sections of the homescreen
description: The original frecency sorted sites
description: Jump back in section
description: Tabs that have been bookmarked recently
# Define your features here
description: Represents the homescreen feature
description: A map of booleans
variable_type: Map<Enum(SectionId), Boolean>
Other considered options
Option 1 - JSON
JSON is still technically supported since YAML is a superset of JSON.
- It should be easy to copy a winning branch of an experiment or rollout back into the feature manifest
- Reference to bundled text and icons should allow for multiple choice in the manifest
- An app may consist of multiple projects
- The format/schema/grammar of the feature manifest language should be documented in the nimbus-shared repo