@mozilla/nimbus-schemas 2024.12.2 → 3000.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -7
- package/index.d.ts +271 -225
- package/package.json +1 -1
- package/schemas/DesktopAllVersionsNimbusExperiment.schema.json +42 -23
- package/schemas/DesktopFeature.schema.json +4 -0
- package/schemas/DesktopFeatureManifest.schema.json +4 -0
- package/schemas/DesktopNimbusExperiment.schema.json +41 -22
- package/schemas/ExperimentBucketConfig.schema.json +46 -0
- package/schemas/ExperimentFeatureConfig.schema.json +19 -0
- package/schemas/ExperimentLocalizations.schema.json +12 -0
- package/schemas/ExperimentOutcome.schema.json +19 -0
- package/schemas/NimbusExperimentV7.schema.json +306 -0
- package/schemas/SdkFeatureManifest.schema.json +4 -0
- package/schemas/SdkNimbusExperiment.schema.json +226 -3
package/README.md
CHANGED
|
@@ -10,29 +10,55 @@ This directory contains a package of schemas published to various repositories f
|
|
|
10
10
|
- node ^16
|
|
11
11
|
- yarn ^1.22
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
### Common Operations
|
|
14
14
|
From project root (i.e., parent to this directory)
|
|
15
15
|
- Build: `make schemas_build`
|
|
16
16
|
- Run linting and tests: `make schemas_check`
|
|
17
17
|
- Code formatting: `make schemas_format`
|
|
18
18
|
|
|
19
|
-
#### Building Python Schemas Package
|
|
20
|
-
`make schemas_build_pypi`
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
### Adding New Schemas
|
|
21
|
+
|
|
22
|
+
**Example**
|
|
23
|
+
Creating a new sub-package `new_stuff`
|
|
24
|
+
1. Add new directory `mozilla_nimbus_schemas` / `new_stuff` with schemas inside.
|
|
25
|
+
1. Add `new_stuff` schemas to the `new_stuff` directory's `__init__.py` file.
|
|
26
|
+
1. Add `new_stuff` to top level `__init__.py`:
|
|
27
|
+
>`from mozilla_nimbus_schemas.new_stuff import *`
|
|
28
|
+
1. Generate Typescript and/or JSON Schemas for `new_stuff` by updating the `generate_json_schema.py` script like so:
|
|
29
|
+
|
|
30
|
+
a. Import `new_stuff` alongside existing `mozilla_nimbus_schemas` imports, e.g.,
|
|
31
|
+
>`from mozilla_nimbus_schemas import experiments, jetstream, new_stuff`
|
|
32
|
+
|
|
33
|
+
b. (optional) Add `new_stuff` to Typescript generation
|
|
34
|
+
* Update `TS_SCHEMA_PACKAGES` list, e.g.,
|
|
35
|
+
>`TS_SCHEMA_PACKAGES = [experiments, jetstream, new_stuff]`
|
|
36
|
+
|
|
37
|
+
c. (optional) Add `new_stuff` to JSON Schema generation
|
|
38
|
+
* Update `JSON_SCHEMA_PACKAGES` list, e.g.,
|
|
39
|
+
>`JSON_SCHEMA_PACKAGES = [experiments, new_stuff]`
|
|
40
|
+
|
|
41
|
+
1. Build everything with `make schemas_build`
|
|
42
|
+
|
|
43
|
+
1. Update the version (see [Versioning](#versioningversioning) below).
|
|
24
44
|
|
|
25
45
|
## Schemas
|
|
26
46
|
### Jetstream
|
|
27
47
|
|
|
28
48
|
Contains schemas describing analysis results, metadata, and errors from [Jetstream](https://github.com/mozilla/jetstream).
|
|
29
49
|
|
|
50
|
+
### Experiments
|
|
51
|
+
|
|
52
|
+
Defines the schemas used for validating the Experimenter v6 API. Previously defined in the now-deprecated [`nimbus-shared`](https://github.com/mozilla/nimbus-shared).
|
|
53
|
+
|
|
30
54
|
|
|
31
55
|
## Deployment
|
|
32
56
|
The build and deployment occurs automatically through CI. A deployment is triggered on merges into the `main` branch when the version number changes. Schemas are published to various repos for access in different languages.
|
|
33
57
|
|
|
34
|
-
|
|
35
|
-
`mozilla-nimbus-schemas` uses
|
|
58
|
+
### Versioning
|
|
59
|
+
`mozilla-nimbus-schemas` uses semantic versioning (`semver`) of `major.minor.patch`. Previously, we
|
|
60
|
+
used a date-based versioning scheme (`CalVer`), which is why the version is so high (3000+). Any
|
|
61
|
+
breaking changes should result in an increase in the major version.
|
|
36
62
|
|
|
37
63
|
#### Version Updates
|
|
38
64
|
1. To update the published package versions, update the `VERSION` file in this directory.
|