Skip to content

Commit 1cb2e17

Browse files
authored
Update docs to reflect recent changes (#40)
* Document backport releases * Correct format of root version and explanation for how it gets incremented
1 parent 61d9aa6 commit 1cb2e17

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

docs/usage-monorepo-fixed.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Using the tool in a monorepo with fixed versions
22

3+
> <table><tr><td><b>👋 HEADS UP!</b> This is an aspirational document; the tool does not support this workflow yet.</td></tr></table>
4+
35
For a monorepo using a "fixed" versioning strategy, the tool needs to know not only which version you want to release, but also which packages you want to release.
46

57
Start by running:

docs/usage-monorepo-independent.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Using the tool in a monorepo with independent versions
22

3-
For a monorepo using an "independent" versioning strategy, the tool needs to know which packages you want to release and how to set the version for each package.
3+
For a monorepo using an "independent" versioning strategy, the tool needs to know two things:
4+
5+
1. Which packages you want to release and how to set the version for each package.
6+
2. Whether or not you are creating a backport release as opposed to an "ordinary" release.
7+
8+
## Ordinary release
9+
10+
Typically, a new release will follow the most recent release (that is, the changes within the release are applied to the code in the most recent release). We call this an _ordinary_ release.
411

512
Start by running:
613

@@ -33,9 +40,26 @@ Once you've filled out the release spec, save and close it, and the tool will co
3340

3441
At this point, the tool will:
3542

36-
1. Calculate a new release version by extracting the build number from the current version, incrementing it, and combining it with the current date, then setting the `version` of the root package to this new version.
43+
1. Calculate a new release version by incrementing the "ordinary" (first) number of the current version, then set the `version` of the root package to this new version.
3744
2. Go through each workspace package specified, and:
38-
1. Adjust the `version` of the package to the version specified.
45+
1. Calculate a new version of the package that you specified in the release spec, then set the `version` of the package to this new version.
3946
2. Read the Git history of the repo to extract the names of the commits which have made any changes to any files within the package since the Git tag that corresponds to the current version of the package.
4047
3. Add a new section to the changelog for the package which is titled by the release version and which lists the commits gathered.
41-
3. Commit the changes to a new branch called `release/<release-version>`, where `<release-version>` is the version calculated in step one (e.g. `release/2022.6.8-123`), and switch to that branch.
48+
3. Commit the changes to a new branch called `release/<release-version>`, where `<release-version>` is the version calculated in step one (e.g. `release/5.0.0`), then switch to that branch.
49+
50+
## Backport release
51+
52+
Sometimes you will need to create a release which contains a change, such as an important fix, to a pre-existing release. We call this a _backport_ release.
53+
54+
The process for creating a backport release works the same as an ordinary release, except before you run the tool, you will switch to a branch that represents an "alternative timeline" based off a past version (for instance, you might have previously cut a branch that continues the 1.x line of the project, even though the latest version is 2.x).
55+
56+
> **Note**
57+
> It's necessary to be on another branch and not the main line, because `create-release-branch` uses the version of packages as they exist on the current branch, and not the latest published versions, to determine the release version and to populate changelogs correctly.
58+
59+
Once on this branch, run:
60+
61+
```
62+
create-release-branch --backport
63+
```
64+
65+
In this case, the new release version will be calculated by incrementing the "backport" (second) number of the current version, but the versions and changelogs of workspace packages will still be updated according to the release spec.

docs/usage-polyrepo.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Using the tool for a polyrepo package
22

3+
> <table><tr><td><b>👋 HEADS UP!</b> This is an aspirational document; the tool does not support this workflow yet.</td></tr></table>
4+
35
For a package within a polyrepo architecture, the tool needs to know the new version of the package you want to release. This can happen one of two ways:
46

57
1. You can have the tool determine the release version automatically by bumping the major, minor, or patch part of the current version.

0 commit comments

Comments
 (0)