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

Release Process #2490

Merged
merged 50 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
11aa7ac
Update README
ggwpez Nov 24, 2023
5eea0df
Add RELEASE doc
ggwpez Nov 24, 2023
d8b7524
Update README
ggwpez Nov 24, 2023
d622a7c
Add AUDIT.md
ggwpez Nov 24, 2023
1e5b3b0
Typo
ggwpez Nov 24, 2023
becbb79
Fix version format
ggwpez Nov 24, 2023
316579d
Update README.md
ggwpez Nov 27, 2023
11b77b0
Apply suggestions from code review
ggwpez Nov 27, 2023
6cdfd59
Remove leeway
ggwpez Nov 27, 2023
35d87bf
Add sections about Testnets and versioning
ggwpez Nov 27, 2023
5189616
Only publish changed crates
ggwpez Nov 27, 2023
a769906
Explain more
ggwpez Dec 1, 2023
6d61040
Apply suggestions from code review
ggwpez Dec 4, 2023
d9bf9ef
Update docs/RELEASE.md
ggwpez Dec 8, 2023
71d9062
Update docs/RELEASE.md
ggwpez Dec 8, 2023
4d65917
Explain more stuff
ggwpez Dec 8, 2023
1cc2780
Update docs/RELEASE.md
ggwpez Dec 8, 2023
423d0ab
Review fixes
ggwpez Dec 8, 2023
9d7bdfd
Merge remote-tracking branch 'origin/oty-release-doc' into oty-releas…
ggwpez Dec 8, 2023
2bdd380
No GH release for nightly
ggwpez Dec 8, 2023
51322b3
SemVer exempt node internal crates
ggwpez Dec 8, 2023
2cd25d9
Exclude unstable APIs
ggwpez Jan 2, 2024
554b247
Minor fixes
ggwpez Jan 2, 2024
d11e585
Improve clobbering script
ggwpez Jan 2, 2024
26d5a8a
Merge remote-tracking branch 'origin/master' into oty-release-doc
ggwpez Jan 8, 2024
7de5e5e
Update release doc
ggwpez Jan 8, 2024
ad657d9
newlines
ggwpez Jan 10, 2024
7158244
Update docs/RELEASE.md
ggwpez Jan 15, 2024
bfad729
Apply suggestions from code review
ggwpez Jan 15, 2024
1e10077
Update README.md
ggwpez Jan 23, 2024
f8dea0b
Update README.md
ggwpez Jan 23, 2024
3341c6b
Update docs/AUDIT.md
ggwpez Jan 23, 2024
3702afb
Update docs/AUDIT.md
ggwpez Jan 23, 2024
dce630d
Update docs/RELEASE.md
ggwpez Jan 23, 2024
c3014c4
Update docs/RELEASE.md
ggwpez Jan 23, 2024
702118b
Update docs/RELEASE.md
ggwpez Jan 23, 2024
ae7e73c
Apply suggestions from code review
ggwpez Jan 23, 2024
7a4b801
Apply suggestions from code review
ggwpez Jan 23, 2024
6169ee8
Mainline -> Stable
ggwpez Jan 23, 2024
d03a2d3
Use uniform numbers
ggwpez Jan 23, 2024
80b81b1
Spelling
ggwpez Jan 23, 2024
9328f76
Wrap lines at 120
ggwpez Jan 23, 2024
e7032c5
Condense bump hint
ggwpez Jan 23, 2024
818c013
Cleanup
ggwpez Jan 23, 2024
f36af66
Merge branch 'master' into oty-release-doc
ggwpez Jan 23, 2024
d01c07a
Update Westend to nightly every 2w
ggwpez Jan 23, 2024
ef1f428
Add hint to Fellowship releases
ggwpez Jan 23, 2024
d11235f
Line breaks
ggwpez Jan 23, 2024
09e539a
Update README.md
ggwpez Jan 24, 2024
fc28e27
MR -> PR
ggwpez Jan 24, 2024
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
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ Polkadot.

Cumulus is a set of tools for writing Substrate-based Polkadot parachains.

## Releases

> [!NOTE]
> Our release process is still Work-In-Progress and may not yet reflect the aspired outline here.

The Polkadot-SDK has two release channels: `mainline` and `nightly`. Production software is advised to only use `mainline`. `nightly` is meant for tinkerers to try out the latest features. The detailed release process is described in [RELEASE.md](docs/RELEASE.md)
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

### Mainline

`mainline` releases have a support duration of **three months**. In this period, the release will not have any breaking changes but only receive bug and security fixes on a **two week** cadence.
liamaharon marked this conversation as resolved.
Show resolved Hide resolved
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

### Nightly

`nightly` releases are released every night from the `master` branch, potentially with breaking changes. They have pre-release version numbers in the format `major.0.0-nightlyYYMMDD`.
Copy link
Member

Choose a reason for hiding this comment

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

The release team needs to confirm, but I think releases can take a very long time. We should check that releasing nightly is feasible, and probably only release creates with changes (incl deps). I can update https://github.com/liamaharon/cargo-workspace-version-tools to handle that.

Copy link
Member Author

@ggwpez ggwpez Jan 23, 2024

Choose a reason for hiding this comment

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

Yes i think having nightly releases right from the start is unrealistic.
It is still put in here as "how it should be", but i dont assume to see nightly releases soon.

I think the release team has a tool to only publish the changed crates, but it seems to lack automatization https://github.com/paritytech/parity-publish


## Upstream Dependencies

Below are the primary upstream dependencies utilized in this project:
Expand Down
17 changes: 17 additions & 0 deletions docs/AUDIT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Audit

Audits are conducted to ensure the absence of severe or exploitable bugs. Merge Requests are generally merged into the `master` branch without audit. The `audited` tag is used to track the latest audited commit of the `master` branch. This means that audits need to happen in order of being merged.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
This is an optimistic approach that lets us develop with greater speed, while requiring (possibly) large refactors in the failure case.

Audits can be deferred if the logic is gated by an `experimental` feature or marked as "Not Production Ready" within the first line of doc. Such changes should be queued manually before these warnings are removed.

## General Guidelines for what to Audit

There is no single one-fits-all rule. Generally we should audit important logic that could immediately be used on production networks. If in doubt; ask in chat or in the Merge Request.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

## Requesting an Audit
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

1. Add the PR to the project `Security Audit (PRs) - SRLabs`
2. Set status to Backlog
3. Assign priority, considering the universe of PRs currently in the backlog, or just leave it as TBD
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
4. Add the component
155 changes: 155 additions & 0 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# Release

The outputs of a release are the `polkadot` and `polkadot-parachain` node binaries, the runtimes for Westend & Rococo and their system parachains, and new crate versions published to `crates.io`.

# Setup

We have two branches: `master` and `stable`. `master` is the main development branch where normal merge requests are opened. Developers need to mostly only care about this branch.
Copy link
Member

Choose a reason for hiding this comment

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

This considers only substrate/parachain focusing elements. I think most of development for Polkadot itself will happen on the stable branch directly, as we don't want to slow us down to only updating the relay chain once every 3 months. Only features that depend on new/breaking changes would need to go to master.

Copy link
Member

@liamaharon liamaharon Jan 17, 2024

Choose a reason for hiding this comment

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

Non-breaking changes still can be added to stable on a more frequent cadence.

Fellowship could also if they wish use the latest audited nightly version if they want to incorporate breaking changes before the next stable release.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fellowship could also if they wish use the latest audited nightly version if they want to incorporate breaking changes before the next stable release.

Yea true, did not think about this but the new process is meant to not slow us down. I guess audited nightly could work.

Copy link
Member

@gavofyork gavofyork Jan 19, 2024

Choose a reason for hiding this comment

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

I don't see how this could push any feature further back than 3 months (even if we avoid nightly completely) and only then in the very worst case. Given our RC development schedules tend to be of the order of years it doesn't seem all that relevant.

The `stable` branch contains a version of the code that is ready to be released. Its contents are always audited. Merging to it is restricted to [Backports](#backports).
Copy link
Member

Choose a reason for hiding this comment

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

How is this supposed to work with relay chain functionality (see above)?

Copy link
Member

Choose a reason for hiding this comment

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

Virtually all relay chain functionality needs to be backported constantly?

Copy link
Member

Choose a reason for hiding this comment

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

#2490 (comment) does this answer your q?

Copy link
Member

Choose a reason for hiding this comment

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

Not really what would the workflow for relay chain devs look like? Like which branch would we usually base our PRs on? If I read this document right, it would be master and then we would backport to stable? And this for all Polkadot PRs?

I feel like the monorepo is biting us here a bit. From the perspective of Polkadot a more consuming perspective would make sense in my opinion. Basically we just use substrate as a normal dep, with its releases. Develop Polkadot and whenever we actually need a new substrate feature (or need security fixes) we update our dependency.

Copy link
Member Author

Choose a reason for hiding this comment

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

I feel like the monorepo is biting us here a bit. From the perspective of Polkadot a more consuming perspective would make sense in my opinion

Could be... but i think if we go with audited nightly then it should be very close to what we currently have.
But its not really that nice, since currently we update the Runtimes to a proper Polkadot-SDK release, in the future we would update then to a nightly release.


ggwpez marked this conversation as resolved.
Show resolved Hide resolved
# Versioning

We are releasing multiple different things from this repository in one release, but we don't want to
use the same version for everything. Thus, in the following we explain the versioning story for the
crates, node and Westend & Rococo. To easily refer to a release, it shall be named by its date in
the form `stableYYMMDD`.

## Crate

We try to follow SemVer<sup>1</sup> 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, with the exception of the following internal crates:
Copy link
Member

Choose a reason for hiding this comment

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

Let's create an issue to track keeping the Cargo.tomls consistent with what's on crates.io? https://github.com/liamaharon/cargo-workspace-version-tools/ already has a script to sync them, I can create two new commands to

  1. major bump everything (every stable release)
  2. nightly bump everything (every nightly release)

Copy link
Member Author

@ggwpez ggwpez Jan 23, 2024

Choose a reason for hiding this comment

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

Yes definitely need to keep them consistent. I will create an issue.

  1. Not sure. I still dont think that we should bump major every three months even without breaking changes. Gav mentioned in this long discussion here that it should be bumped "semver respected", which to me means that we should only bump if required.
  2. ✅ yea we can use that every night to temporarily create the nightly versions.

ggwpez marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
We try to follow SemVer<sup>1</sup> 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, with the exception of the following internal crates:
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.

Copy link
Member

Choose a reason for hiding this comment

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

All crates should follow semver. However, we should have crates that can get merged to stable, even when there are breaking changes aka major version bumps.

Copy link
Member

Choose a reason for hiding this comment

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

@eskimor this is also what I would do to most of the relay chain crates.

We should put some custom metadata into the Cargo.toml telling the tooling that these crates are fine to "break". For the human we should mention this in the description of the Cargo.toml.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it is a prerequisite to have this done before the pr here gets merged, we can do this over time.

Copy link
Member Author

Choose a reason for hiding this comment

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

created #3031


- @bkchr the list of node internals please
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

Inductively, the public API of our library crates is declared as all public items that are neither:
- Inside a `__private` module
- Documented as "unstable" or "experimental" in the first line of docs
- Bear `unstable` or `experimental` in their absolute path

## Node

The versioning of the node is done most of the time by only incrementing the `minor` version.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
The `major` version is only bumped for special releases and the `patch` can be used for an
out of band release that fixes some critical bug. The node version is not following SemVer.
This means that the version doesn't express if there are any breaking changes in the CLI
interface or similar. The node version is declared in the `NODE_VERSION` variable in
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
`polkadot/node/primitives/src/lib.rs`.
Copy link
Member

Choose a reason for hiding this comment

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

  1. Why doesn't the node follow semver?
  2. Why do we put the node version in NODE_VERSION instead of just in the Cargo.toml?

Copy link
Member

Choose a reason for hiding this comment

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

  1. Why doesn't the node follow semver?

What would be the point and what would be included in this? RPC? Cli? Some internal changes?

2. Why do we put the node version in NODE_VERSION instead of just in the Cargo.toml?

#1495 (comment)

Copy link
Member

@liamaharon liamaharon Dec 8, 2023

Choose a reason for hiding this comment

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

What would be the point and what would be included in this? RPC? Cli? Some internal changes?

from the PoV of node operators, with node versions I would expect

  • Patch: I can blindly update my node. No new features, something like a bug fix or perf improvement
  • Minor: I can blindly update my node. Maybe there are some new CLI args / RPC endpoints, but no breakages
  • Major: I should be careful updating my node. There have been breaking changes, it could be something about the CLI args or RPC format has changed

If you ask node operators, I think they would appreciate semver signalling like this?

#1495 (comment)

This doesn't really explain why 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

I see Liam's point, that it would have been good to use SemVer to signal the behavior changes of the node.

In my understanding the reason we don't do that is that we have always targeted Polkadot node 1.0 to be the white paper. Now that it has been delivered, we have two options:

  1. Indefinitely keep the major to 1 to adhere to the previous standard.
  2. Pivot into SemVer. All major versions higher than 1 adhere to Polkadot 1. But, then, if someday there is an official Polkadot 2 white paper and node for it, it would be a bit of a pickle.

At the moment, I am leaning towards option 1. I think most operators are already used to reading changelogs and applying any CLI changes.

ggwpez marked this conversation as resolved.
Show resolved Hide resolved

## Westend & Rococo

For the these networks, in addition to incrementing the `Cargo.toml` version we also increment the
`spec_version` and sometimes the `transaction_version`. The spec version is also following the node
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
version. Its schema is: `M_mmm_ppp` and for example `1_002_000` is the node release `1.2.0`. This
versioning has no further meaning, and is only done to map from an on chain `spec_version` easily to
the release in this repository.
The Westend testnet will be updated to the new runtime version immediately after a *Stable* release happened.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

# Backports

**From `master` to `stable`**

Backports in this direction can be anything that is audited and either `minor` or a `patch` bump. [Security fixes](#bug-and-security-fix) should be prioritized over additions or improvements.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

**From `stable` to `master`**

Should not be needed since all changes first get merged into `master`. The `stable` branch can get out of sync and will be synced with the [Clobbering](#clobbering) process.

# Processes

The following processes are necessary to actualize our releases. Each process has a *Cadence* on which it must execute and a *Responsible* that is responsible for autonomously doing so and reporting back any error in the RelEng<sup>2</sup> channel. All processes should be automated as much as possible.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

## Crate Bumping

Cadence: (possibly) each Merge Request. Responsible: Developer that opened the MR.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

Following SemVer isn't easy, but there exists [a guide](https://doc.rust-lang.org/cargo/reference/semver.html) in the Rust documentation that explains the small details on when to bump what. This process should be augmented with CI checks that utilize [`cargo-semver-checks`](https://github.com/obi1kenobi/cargo-semver-checks) and/or [`cargo-public-api`](https://github.com/Enselic/cargo-public-api). They must also pay attention to downstream dependencies that require a version bump, because they export the changed API.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

### Steps

1. Developer opens a Merge Request with changed crates against `master`.
2. They bump all changed crates according to SemVer.
Copy link
Contributor

Choose a reason for hiding this comment

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

what about having multiple PRs that modify the same crates. I guess we're supposed to bump them only once within a 3-month period right? This can be a bit cumbersome and prone to human error

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes good observation. There was some discussion on if we maybe rather use PrDoc to indicate SemVer bumps, but then we need additional tooling to translate that into crate bumps and it does not play well with other tools.

We would probably need a CI that prevents double bumps, but i agree that it could be a point of friction.

3. They bump all crates that export any changed types in their *public API*.
4. They also bump all crates that inherit logic changes from relying on one of the bumped crates.
Copy link
Member

@liamaharon liamaharon Dec 4, 2023

Choose a reason for hiding this comment

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

I'm confused by this.

Shouldn't crate bumping only be necessary when merging to the release branch, and master bumps are just automated nightly releases?

Do you mean to refer to the release branch instead of master branch here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was trying to describe the normal workflow of merging a standard Merge request.

Currently we never touch the Cargo.toml version. But in the future we would need to increment it according to SemVer. This can be a major, minor or patch bump - depending on the change.

Otherwise when would we bump these versions? We dont really "merge" to the release branch, unless its a backport.

Copy link
Member

@liamaharon liamaharon Dec 4, 2023

Choose a reason for hiding this comment

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

My understanding was

  • merge to master: don't need to do bumps on merge. releases will be made nightly bumping the semver with a new -nightlyYYYY-MM-DD suffix. I don't see benefit of bumping X.Y.Z between nightly releases, because the code will have a breaking bump (from the -nightly change) soon anyway.
  • merge to release: we need to bump according to X.Y.Z semver, because we need to make new releases for the changed crates.

Copy link
Member

@liamaharon liamaharon Dec 4, 2023

Choose a reason for hiding this comment

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

This is how I understood it, where master branch only get nightly releases.

each crates versions like this:

stable
v1.0.0 --------> v1.0.1 ------------------------> v2.0.0 ---------------------- -> ...
                                                    ^
                                             CLOBBER|
master                                              |
v2.0.0-nightly2023-01-01 -> ... v2.0.0-nightly2023-04-01 -> v3.0.0-nightly2023-04-02 -> ...

Copy link
Member Author

Choose a reason for hiding this comment

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

we need to bump according to X.Y.Z semver, because we need to make new releases for the changed crates.

But then how do we keep track of these in the meantime? Yes sure we dont need to bump for the nightly releases since they get their own version number overwritten.
We would also need to bullet proof automate these version bump then. I would also like to do this with prdoc and so on, but @bkchr seems to be in favour of just bumping them directly. Note that we dont need to bump multiple times on master if there was no release so far.

Copy link
Member

@gavofyork gavofyork Dec 12, 2023

Choose a reason for hiding this comment

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

So we would still bump only major every 3 months?

In my proposal, yes.

In my proposal:

  • Major bumps on release every 3 months when the Clobber happens. SemVer respected.
  • Minor bumps on release every 2 weeks for any crate touched by a backport or any crate depending on such a crate. Backport reviews make an explicit check that they do not make breaking changes. SemVer respected.
  • Patch bumps on release for out-of-band security fixes which have been reviewed as non-breaking. SemVer respected.
  • Nightly just has the next major version with a -nightly suffix. SemVer respected.

Copy link
Member Author

@ggwpez ggwpez Jan 2, 2024

Choose a reason for hiding this comment

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

My understanding from the forum post is this was the plan yes: master is never bumped manually, it's only bumped by the CI every nightly release.

The nightly is a pre-release, since it has a dash in the version name. It is completely irrelevant for any SemVer considerations and can break at any time.

For example, if a crate version in stable is 1.2.1, master would be set to 2.0.0-nightlyYYYY-MM-DD.

Yes, but only temporarily in the CI. This bump is never actually committed.

Then every 6th release, we remove the -nightlyYYYY-MM-DD from the versions and that becomes our new stable branch.

As you said below, this could introduce major bump without breaking changes. But maybe it would still be a good tradeoff if the other way introduces too much overhead. I mainly dont like it much because it breaks cargo update.

This way, we don't need to worry at all about breaking changes when we merge to master.

We dont have to "worry" about them, but we still have to mark them as breaking.

In my proposal:
Major bumps on release every 3 months when the Clobber happens. SemVer respected.

Just as note: I interpret this as meaning that unnecessary major bump should be avoided, since SemVer does not require them.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would really first like to try out the tooling and then see what we should do. I mean the tooling probably already works for most of the things we are doing as breaking changes, like changing a function name or removing a parameter.

Okay then lets try the native bumping without Prdoc for now.

Copy link
Member

Choose a reason for hiding this comment

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

Do we need to update this to clarify manual 'crate bumping' applies to backports into stable not master?

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you mean? We would bump crates in the MR that merges into master.
Then that version bump could get back ported to stable, but its version should not need any tweaking.

ggwpez marked this conversation as resolved.
Show resolved Hide resolved

## Stable Release

Cadence: every two weeks. Responsible: Release Team.

This process aims to release the `stable` branch as a *Stable* release every two weeks.

### Steps

1. Check if process [Clobbering](#clobbering) needs to happen and do so, if that is the case.
2. Check out the latest commit of `stable`.
3. Update the `CHANGELOG.md` version, date and compile the content using the prdoc files.
4. Open a Merge Request against `stable` for visibility.
5. Check if there were any changes since the last release and abort, if not.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
6. Run `cargo semver-checks` and `cargo public-api` again to ensure that there are no SemVer breaks.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
7. Internal QA from the release team can happen here.
8. Do a dry-run release to ensure that it *should* work.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
8. Do a dry-run release to ensure that it *should* work.

What should work? Building the binary? Sounds like bullshit to me, again CI is building the stuff all the time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes but there are lots of build errors that only arrive when building with cargo publish --dry-run.
For example the location of the README or other relative paths gets messed up within the workspace, since it builds each crate in isolation.
Eventually i dont mind how the release team ensures that it all works, but i think for a start it is fine to have in here.

10. Comment that a *Stable* release will happen from the merged commit hash.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
11. Release all changed crates to crates.io.
12. Create a release on GitHub.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
13. Notify Devops so that they can update Westend to the new runtime.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

## Nightly Release

Cadence: every day at 00:00 UTC+1. Responsible: Release Team
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

This process aims to release the `master` branch as a *Nightly* release. The process can start at 00:00 UTC+1 and should automatically do the following steps.

1. Check out the latest commit of branch `master`.
2. Compare this commit to the latest `nightly*` tag and abort if there are no changes detected.
3. Set the version of all crates to `major.0.0-nightlyYYMMDD` where `major` is the last released `major` version of that crate plus one.
4. Tag this commit as `nightlyYYMMDD`.
5. Do a dry-run release to ensure that it *should* work.
6. Push this tag (the commit will not belong to any branch).
8. Release all crates that had changed since the last nightly release to crates.io.
Copy link
Member

Choose a reason for hiding this comment

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

Basically we would need to release all of the crates or not? Or the tool that checks if something changed in a crate, needs to take into consideration the dependency graph. Aka we changed something deep inside the graph and thus all crates that depend on this crate are also bumped.

Which brings up another point, we can not just do what you said in point 3. We only need to bump the version of the crates that changed. We will then also need to depend on some of the older nightly releases in crates. In the end we will end up with every crate being on a different nightly tag, depending on when it was modified the last time. I mean this works, but just highlights again that we need some tooling to ensure that we use the correct crate versions for every crate in some downstream project.

Copy link
Member Author

@ggwpez ggwpez Jan 23, 2024

Choose a reason for hiding this comment

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

Basically we would need to release all of the crates or not? Or the tool that checks if something changed in a crate, needs to take into consideration the dependency graph.

AFAIK parity-publish does exactly this.

We will then also need to depend on some of the older nightly releases in crates. In the end we will end up with every crate being on a different nightly tag, depending on when it was modified the last time.

Ah crap. Did not think about this.

I mean this works, but just highlights again that we need some tooling to ensure that we use the correct crate versions for every crate in some downstream project.

Yea this sounds like a nightmare. We could also create an overarching polkadot-sdk crate that locks in all crate versions. Otherwise some custom bumper CLI...
I think the release team was building such a CLI to do the bumping in downstream repos.


## Clobbering

Cadence: every 6th release (~3 months). Responsible: Release Team

This process aims to bring branch `stable` in sync with the latest audited commit of `master`. It is not done via a Merge Request but rather by just copying files. It should be automated.
Copy link
Member

Choose a reason for hiding this comment

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

What is the problem with merging?

Copy link
Member

Choose a reason for hiding this comment

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

Copying files is not quite the best term.. It just means nuke the working tree with whatever is the most recently audited commit in nightly, instead of trying to do merge conflict resolution or whatever.

Copy link
Member

Choose a reason for hiding this comment

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

Which would prohibit us from working on stable directly for Polkadot - correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Stable cannot have changes that were not in master first. Problem are the git conflicts and nuking is easier.

Which would prohibit us from working on stable directly for Polkadot - correct?

Yes

ggwpez marked this conversation as resolved.
Show resolved Hide resolved
The following script is provided to do the clobbering. Note that it keeps the complete history of all past clobbering processes.

```bash
# Ensure we have the latest remote data
git fetch
# Switch to the release branch
git checkout release
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

# Delete all tracked files in the working directory
git ls-files -z | xargs -0 rm -f
# Find and delete any empty directories
find . -type d -empty -delete

# Get the last audited commit
AUDITED=$(git rev-parse --short=10 origin/audited)
# Grab the files from the commit
git checkout $AUDITED -- .

# Stage, commit, and push the working directory which now matches 'audited' 1:1
git add .
git commit -m "Clobbering with audited ($AUDITED)"
git push
```

## Bug and Security Fix

Cadence: n.a. Responsible: Developer

Describes how developers should merge bug and security fixes.

### Steps

1. Developer opens a Merge Request with a bug or security fix.
2. They have the possibility to mark the MR as such, and does so.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
3. Audit happens with priority.
4. It is merged into `master`.
5. It is automatically back-ported to `stable`.
Copy link
Contributor

Choose a reason for hiding this comment

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

you mean we'll have automation for this? Most likely the backport will have conflicts or even logic changes that don't always result in git conflicts

Copy link
Member

Choose a reason for hiding this comment

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

In the trivial case I guess the back port could be made automatically. But in general it would likely be two separate (similar) PRs.

6. The fix will be released in the next *Stable* release. In urgent cases, a release can happen earlier.

# Footnotes

1: `SemVer`: Semantic Versioning v2.0.0 as defined on https://semver.org/.
2: `RelEng`: The *RelEng: Polkadot Release Coordination* Matrix channel.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
Loading