From d18aec7dfe6b2cf3785fb300e6c3f09c57e7e3d8 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Thu, 22 Feb 2024 13:00:07 +0100 Subject: [PATCH 1/5] [prdoc] Add optional SemVer bump to crates Signed-off-by: Oliver Tale-Yazdi --- prdoc/schema_user.json | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/prdoc/schema_user.json b/prdoc/schema_user.json index 82215d51866b..711fb3ca9cfd 100644 --- a/prdoc/schema_user.json +++ b/prdoc/schema_user.json @@ -125,10 +125,16 @@ "name": { "type": "string" }, + "bump": { + "$ref": "#/$defs/semver_bump" + }, "note": { "type": "string" } - } + }, + "required": [ + "name" + ] }, "migration_db": { "type": "object", @@ -165,6 +171,26 @@ "description" ] }, + "semver_bump": { + "description": "The type of bump to apply to the crate version according to Cargo SemVer: https://doc.rust-lang.org/cargo/reference/semver.html", + "oneOf": [ + { + "const": "major", + "title": "Major", + "description": "A bump to the leftmost non-zero digit of the version number." + }, + { + "const": "minor", + "title": "Minor", + "description": "A bump to the second leftmost non-zero digit of the version number." + }, + { + "const": "patch", + "title": "Patch", + "description": "A bump to the third leftmost non-zero digit of the version number." + } + ] + }, "doc": { "type": "object", "description": "You have the the option to provide different description of your PR for different audiences.", From 1a893555b71941c22e74a2312a3fdf80918e155f Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Thu, 22 Feb 2024 13:06:23 +0100 Subject: [PATCH 2/5] Explain cargo semver quirk in release doc Signed-off-by: Oliver Tale-Yazdi --- docs/RELEASE.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 6d681d78f367..e73be2779a99 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -18,10 +18,16 @@ Rococo. To easily refer to a release, it shall be named by its date in the form ## Crate -We try to follow [SemVer 2.0.0](https://semver.org/) as best as possible for versioning our crates. SemVer requires a -piece of software to first declare a public API. The public API of the Polkadot SDK is hereby declared as the sum of all -crates' public APIs. +We try to follow [SemVer 2.0.0](https://semver.org/) as best as possible for versioning our crates. The definitions of +`major`, `minor` and `patch` version for Rust crates are slightly altered from their standard for pre `1.0.0` versions. +Quoting [rust-lang.org](https://doc.rust-lang.org/cargo/reference/semver.html): +>Initial development releases starting with “0.y.z” can treat changes in “y” as a major release, and “z” as a minor +release. “0.0.z” releases are always major changes. This is because Cargo uses the convention that only changes in the +left-most non-zero component are considered incompatible. + +SemVer requires a piece of software to first declare a public API. The public API of the Polkadot SDK +is hereby declared as the sum of all crates' public APIs. Inductively, the public API of our library crates is declared as all public items that are neither: - Inside a `__private` module From ffd6a3aa1533c22d9c55da1ff451fc2d3ec63e65 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Thu, 22 Feb 2024 13:12:07 +0100 Subject: [PATCH 3/5] Add hint to release doc Signed-off-by: Oliver Tale-Yazdi --- prdoc/schema_user.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prdoc/schema_user.json b/prdoc/schema_user.json index 711fb3ca9cfd..bf53e4340c45 100644 --- a/prdoc/schema_user.json +++ b/prdoc/schema_user.json @@ -172,7 +172,7 @@ ] }, "semver_bump": { - "description": "The type of bump to apply to the crate version according to Cargo SemVer: https://doc.rust-lang.org/cargo/reference/semver.html", + "description": "The type of bump to apply to the crate version according to Cargo SemVer: https://doc.rust-lang.org/cargo/reference/semver.html. Please check docs/RELEASE.md for more information.", "oneOf": [ { "const": "major", From b80a8ef1b403b3fff898a5e136adf6a8bd94d949 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Mon, 26 Feb 2024 16:52:29 +0100 Subject: [PATCH 4/5] Bump version to 1.0.1 Signed-off-by: Oliver Tale-Yazdi --- prdoc/schema_user.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/prdoc/schema_user.json b/prdoc/schema_user.json index bf53e4340c45..f20e0cf9a461 100644 --- a/prdoc/schema_user.json +++ b/prdoc/schema_user.json @@ -4,8 +4,7 @@ "version": { "major": 1, "minor": 0, - "patch": 0, - "timestamp": 20230817152351 + "patch": 1 }, "title": "Polkadot SDK PRDoc Schema", "description": "JSON Schema definition for the Polkadot SDK PR documentation", From a7bb6f9505c217fe941870f034e99d4103ba2800 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Mon, 26 Feb 2024 16:53:35 +0100 Subject: [PATCH 5/5] Bump to 1.1.0 Signed-off-by: Oliver Tale-Yazdi --- prdoc/schema_user.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prdoc/schema_user.json b/prdoc/schema_user.json index f20e0cf9a461..1bd0b3b93ee4 100644 --- a/prdoc/schema_user.json +++ b/prdoc/schema_user.json @@ -3,8 +3,8 @@ "$id": "https://raw.githubusercontent.com/paritytech/prdoc/master/prdoc_schema_user.json", "version": { "major": 1, - "minor": 0, - "patch": 1 + "minor": 1, + "patch": 0 }, "title": "Polkadot SDK PRDoc Schema", "description": "JSON Schema definition for the Polkadot SDK PR documentation",