Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prdoc] Optional SemVer bumps and Docs #3441

Merged
merged 5 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 29 additions & 4 deletions prdoc/schema_user.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"$id": "https://raw.githubusercontent.com/paritytech/prdoc/master/prdoc_schema_user.json",
"version": {
"major": 1,
"minor": 0,
"patch": 0,
"timestamp": 20230817152351
"minor": 1,
"patch": 0
},
"title": "Polkadot SDK PRDoc Schema",
"description": "JSON Schema definition for the Polkadot SDK PR documentation",
Expand Down Expand Up @@ -125,10 +124,16 @@
"name": {
"type": "string"
},
"bump": {
"$ref": "#/$defs/semver_bump"
},
"note": {
"type": "string"
}
}
},
"required": [
"name"
]
Comment on lines +134 to +136
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump also needs to be required if we are to follow SemVer in our new release process with the stable/unstable branches.

Suggested change
"required": [
"name"
]
"required": [
"name",
"bump"
]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As first step i wanted to make it optional, so we can try it out on a few crates ourselves to ensure that all the tooling/CI checks works.
If we start with it being required, then many devs will put wrong stuff in there accidentally and we dont notice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, as long as we remember to make it required before we cut the next release yah?

},
"migration_db": {
"type": "object",
Expand Down Expand Up @@ -165,6 +170,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. Please check docs/RELEASE.md for more information.",
"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.",
Expand Down
Loading