From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- .../nimbus/schemas/NimbusEnrollment.schema.json | 226 +++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 toolkit/components/nimbus/schemas/NimbusEnrollment.schema.json (limited to 'toolkit/components/nimbus/schemas/NimbusEnrollment.schema.json') diff --git a/toolkit/components/nimbus/schemas/NimbusEnrollment.schema.json b/toolkit/components/nimbus/schemas/NimbusEnrollment.schema.json new file mode 100644 index 0000000000..13d568b89c --- /dev/null +++ b/toolkit/components/nimbus/schemas/NimbusEnrollment.schema.json @@ -0,0 +1,226 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/NimbusEnrollment", + "definitions": { + "NimbusEnrollment": { + "type": "object", + "properties": { + "slug": { + "type": "string", + "description": "Unique identifier for the experiment" + }, + "userFacingName": { + "type": "string", + "description": "Public name of the experiment displayed on \"about:studies\"" + }, + "userFacingDescription": { + "type": "string", + "description": "Short public description of the experiment displayed on on \"about:studies\"" + }, + "isRollout": { + "type": "boolean", + "description": "When this property is set to true, treat this experiment as a rollout. Rollouts are currently handled as single-branch experiments separated from the bucketing namespace for normal experiments. See also: https://mozilla-hub.atlassian.net/browse/SDK-405" + }, + "featureIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of featureIds the experiment contains configurations for." + }, + "branch": { + "anyOf": [ + { + "type": "object", + "properties": { + "slug": { + "type": "string", + "description": "Identifier for the branch" + }, + "feature": { + "type": "object", + "properties": { + "featureId": { + "type": "string", + "description": "The identifier for the feature flag" + }, + "value": { + "type": "object", + "additionalProperties": {}, + "description": "Optional extra params for the feature (this should be validated against a schema)" + } + }, + "required": [ + "featureId", + "value" + ], + "description": "A single feature configuration" + } + }, + "required": [ + "slug", + "feature" + ] + }, + { + "type": "object", + "properties": { + "slug": { + "type": "string", + "description": "Identifier for the branch" + }, + "feature": { + "type": "object", + "properties": { + "featureId": { + "type": "string", + "const": "unused-feature-id-for-legacy-support" + }, + "enabled": { + "type": "boolean", + "const": false + }, + "value": { + "type": "object", + "additionalProperties": {} + } + }, + "required": [ + "featureId", + "enabled", + "value" + ], + "description": "The feature key must be provided with valid values to prevent crashes if the DTO is encountered by Desktop clients earlier than version 95." + }, + "features": { + "type": "array", + "items": { + "type": "object", + "properties": { + "featureId": { + "type": "string", + "description": "The identifier for the feature flag" + }, + "value": { + "type": "object", + "additionalProperties": {}, + "description": "Optional extra params for the feature (this should be validated against a schema)" + } + }, + "required": [ + "featureId", + "value" + ] + }, + "description": "An array of feature configurations" + } + }, + "required": [ + "slug", + "feature", + "features" + ] + }, + { + "type": "object", + "properties": { + "slug": { + "type": "string", + "description": "Identifier for the branch" + }, + "features": { + "type": "array", + "items": { + "type": "object", + "properties": { + "featureId": { + "type": "string", + "description": "The identifier for the feature flag" + }, + "value": { + "type": "object", + "additionalProperties": {}, + "description": "Optional extra params for the feature (this should be validated against a schema)" + } + }, + "required": [ + "featureId", + "value" + ] + }, + "description": "An array of feature configurations" + } + }, + "required": [ + "slug", + "features" + ] + } + ], + "description": "Branch configuration for the experiment" + }, + "experimentType": { + "type": "string", + "description": "What kind of experiment this enrollment corresponds to." + }, + "enrollmentId": { + "type": "string", + "description": "A unique identifier for the enrollment." + }, + "active": { + "type": "boolean", + "description": "Whether or not the enrollment is active." + }, + "lastSeen": { + "type": "string", + "format": "date-time", + "description": "The last time the experiment was seen." + }, + "force": { + "type": "boolean", + "description": "Whether or not this was a force enrollment." + }, + "prefs": { + "type": "array", + "description": "Information about prefs set by this enrollment.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the pref that was set." + }, + "featureId": { + "type": "string", + "description": "The ID of the feature that owns the variable that set this pref." + }, + "variable": { + "type": "string", + "description": "The variable that set this pref." + }, + "branch": { + "type": "string", + "enum": ["user", "default"], + "description": "The branch the pref was set on." + }, + "originalValue": { + "description": "The original value before the experiment." + } + }, + "additionalProperties": false + } + } + }, + "required": [ + "slug", + "userFacingName", + "userFacingDescription", + "branch", + "enrollmentId", + "active", + "lastSeen" + ], + "description": "An enrollment in a Nimbus Experiment saved to disk" + } + } +} -- cgit v1.2.3