From 8b9eb1ffc5e390a14cfb25c86e746991c366457a Mon Sep 17 00:00:00 2001 From: Jayadeep Kinavoor Madam Date: Thu, 28 May 2026 11:14:25 +0200 Subject: [PATCH] BUILD-11458: Add release channel pointer JSON schema Author the JSON Schema (draft-07) for the per-channel pointer file written by the upcoming update-release-channel action to s3://///.json. Required fields: - schemaVersion: const 1 - version: string - released_at: ISO-8601 / RFC 3339 UTC timestamp additionalProperties: true so future additive fields do not break v1 consumers. Schema lives at update-release-channel/schema/v1.json with a README documenting the versioning policy (filename + schemaVersion in lockstep, new file only for breaking changes). Validation against real action outputs lands with the writer unit tests (BUILD-11460) and the integration test workflow (BUILD-11461); no sample fixtures are checked in here. Part of epic BUILD-11447. --- update-release-channel/schema/README.md | 23 +++++++++++++++++++++ update-release-channel/schema/v1.json | 27 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 update-release-channel/schema/README.md create mode 100644 update-release-channel/schema/v1.json diff --git a/update-release-channel/schema/README.md b/update-release-channel/schema/README.md new file mode 100644 index 00000000..92df96e1 --- /dev/null +++ b/update-release-channel/schema/README.md @@ -0,0 +1,23 @@ +# Release channel pointer schema + +JSON Schema for the per-channel pointer file written by the `update-release-channel` GitHub Action to +`s3://downloads-cdn-eu-central-1-prod///.json`. + +## Versioning + +The schema version lives in the **filename** (`v1.json`, `v2.json`, ...) and in lockstep in the `schemaVersion` field +inside the JSON document. + +A new file (e.g. `v2.json`) is introduced **only** when existing fields are removed, renamed, or changed in a +non-backwards-compatible way. Additive changes (new optional fields) ship as updates to `v1.json` — consumers MUST +ignore unknown fields. + +## v1 fields + +| Field | Type | Required | Description | +| --------------- | ------- | -------- | ------------------------------------------------------------------------ | +| `schemaVersion` | integer | yes | Const `1`. | +| `version` | string | yes | Currently published version on this channel (e.g. `0.9.0.977`). | +| `updatedAt` | string | yes | ISO-8601 UTC timestamp at which the channel was promoted to `version`. | + +`additionalProperties: true` — unknown fields are accepted and MUST be ignored by older consumers. diff --git a/update-release-channel/schema/v1.json b/update-release-channel/schema/v1.json new file mode 100644 index 00000000..8ae4aa76 --- /dev/null +++ b/update-release-channel/schema/v1.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/SonarSource/ci-github-actions/master/update-release-channel/schema/v1.json", + "title": "Release Channel Pointer (v1)", + "description": "Per-channel release pointer JSON. Consumers MUST ignore unknown fields.", + "type": "object", + "required": ["schemaVersion", "version", "updatedAt"], + "additionalProperties": true, + "properties": { + "schemaVersion": { + "description": "Schema version. Bumped only on non-backwards-compatible changes; additive evolution stays at 1.", + "type": "integer", + "const": 1 + }, + "version": { + "description": "Currently published version on this channel (e.g. \"0.9.0.977\", \"2026.1.0\").", + "type": "string", + "minLength": 1 + }, + "updatedAt": { + "description": "ISO-8601 / RFC 3339 UTC timestamp at which this channel was promoted to point at `version`.", + "type": "string", + "format": "date-time", + "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$" + } + } +}