From b64412a08bd1d3a9111f252fc5c63423c0ef7a59 Mon Sep 17 00:00:00 2001 From: Daniel Rozenberg Date: Tue, 2 Nov 2021 13:48:27 -0400 Subject: [PATCH] Add versioning.json file --- .vscode/settings.json | 4 ++ build-system/global-configs/README.md | 6 ++ build-system/global-configs/versioning.json | 12 ++++ build-system/json-schemas/versioning.json | 69 +++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 build-system/global-configs/versioning.json create mode 100644 build-system/json-schemas/versioning.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 03c9a5fe819c..d2299dd8882e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -50,6 +50,10 @@ "fileMatch": ["build-system/tasks/bundle-size/filesize.json"], "url": "./build-system/json-schemas/filesize.json" }, + { + "fileMatch": ["build-system/global-configs/versioning.json"], + "url": "./build-system/json-schemas/versioning.json" + }, { "fileMatch": ["test/visual-diff/visual-tests.jsonc"], "url": "./build-system/json-schemas/visual-tests.json" diff --git a/build-system/global-configs/README.md b/build-system/global-configs/README.md index 467f72533482..b2d396eff4b8 100644 --- a/build-system/global-configs/README.md +++ b/build-system/global-configs/README.md @@ -112,3 +112,9 @@ Example: ``` Once merged onto the `main` branch, this file is automatically picked up by the AMP CDN (usually within 1-2 hours from PR merge) and its content is injected into `v0.[m]js`. AMP caches can also inject the contents of this file verbatim into pages inside a `` element. + +# versioning.json + +Defines the routing between channels and RTVs (see [Versioning section in amp-framework-hosting.md](../../docs/spec/amp-framework-hosting.md#versioning) for an explanation of AMP versions and RTV numbers). + +Currently in testing in preparation for [#36152](https://github.com/ampproject/amphtml/issues/36152). diff --git a/build-system/global-configs/versioning.json b/build-system/global-configs/versioning.json new file mode 100644 index 000000000000..ac2d8d525810 --- /dev/null +++ b/build-system/global-configs/versioning.json @@ -0,0 +1,12 @@ +{ + "beta": "030000000000000", + "control": "020000000000000", + "experimental": "000000000000000", + "experimentA": null, + "experimentB": null, + "experimentC": null, + "lts": "010000000000000", + "nightly": "040000000000000", + "nightly-control": "050000000000000", + "stable": "010000000000000" +} diff --git a/build-system/json-schemas/versioning.json b/build-system/json-schemas/versioning.json new file mode 100644 index 000000000000..4e8cee47b938 --- /dev/null +++ b/build-system/json-schemas/versioning.json @@ -0,0 +1,69 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "Versioning (RTV) information", + "type": "object", + "required": [ + "beta", + "control", + "experimental", + "experimentA", + "experimentB", + "experimentC", + "lts", + "nightly", + "nightly-control", + "stable" + ], + "properties": { + "beta": { + "type": "string", + "pattern": "03\\d{13}" + }, + "control": { + "type": "string", + "pattern": "02\\d{13}" + }, + "experimental": { + "type": "string", + "pattern": "00\\d{13}" + }, + "experimentA": { + "type": [ + "string", + "null" + ], + "pattern": "10\\d{13}" + }, + "experimentB": { + "type": [ + "string", + "null" + ], + "pattern": "11\\d{13}" + }, + "experimentC": { + "type": [ + "string", + "null" + ], + "pattern": "12\\d{13}" + }, + "lts": { + "type": "string", + "pattern": "01\\d{13}" + }, + "nightly": { + "type": "string", + "pattern": "04\\d{13}" + }, + "nightly-control": { + "type": "string", + "pattern": "05\\d{13}" + }, + "stable": { + "type": "string", + "pattern": "01\\d{13}" + } + }, + "additionalProperties": false +}