Skip to content

Commit 58e1976

Browse files
New release process (#1438)
* Document the backporting of bug fixes * Fix processes following discussion * Add normalization in ``tbump`` * Remove numbering so the diff is manageable and the doc easier to update Co-authored-by: Daniël van Noord <[email protected]>
1 parent 1622459 commit 58e1976

File tree

2 files changed

+62
-28
lines changed

2 files changed

+62
-28
lines changed

doc/release.md

Lines changed: 58 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,76 @@
22

33
So, you want to release the `X.Y.Z` version of astroid ?
44

5-
## Process
5+
## Releasing a major or minor version
66

7-
(Consider triggering the "release tests" workflow in GitHub Actions first.)
7+
**Before releasing a major or minor version check if there are any unreleased commits on
8+
the maintenance branch. If so, release a last patch release first. See
9+
`Releasing a patch version`.**
810

9-
1. Check if the dependencies of the package are correct
10-
2. Check the result (Do `git diff vX.Y.Z-1 ChangeLog` in particular).
11-
3. Install the release dependencies `pip3 install -r requirements_test.txt`
12-
4. Bump the version and release by using `tbump X.Y.Z --no-push`.
13-
5. Push the tag.
14-
6. Release the version on GitHub with the same name as the tag and copy and paste the
15-
appropriate changelog in the description. This trigger the pypi release.
11+
- Remove the empty changelog for the last unreleased patch version `X.Y-1.Z'`. (For
12+
example: `v2.3.5`)
13+
- Check the result of `git diff vX.Y-1.Z' ChangeLog`. (For example:
14+
`git diff v2.3.4 ChangeLog`)
15+
- Install the release dependencies: `pip3 install -r requirements_test.txt`
16+
- Bump the version and release by using `tbump X.Y.0 --no-push`. (For example:
17+
`tbump 2.4.0 --no-push`)
18+
- Check the result visually and then by triggering the "release tests" workflow in
19+
GitHub Actions first.
20+
- Push the tag.
21+
- Release the version on GitHub with the same name as the tag and copy and paste the
22+
appropriate changelog in the description. This triggers the PyPI release.
23+
- Move the `main` branch up to a dev version with `tbump`:
1624

17-
## Post release
18-
19-
### Back to a dev version
25+
```bash
26+
tbump X.Y+1.0-dev0 --no-tag --no-push # You can interrupt after the first step
27+
git commit -am "Upgrade the version to x.y+1.0-dev0 following x.y.0 release"
28+
```
2029

21-
Move back to a dev version with `tbump`:
30+
For example:
2231

2332
```bash
24-
tbump X.Y.Z+1-dev0 --no-tag --no-push # You can interrupt after the first step
25-
git commit -am "Upgrade the version to x.y.z+1-dev0 following x.y.z release"
33+
tbump 2.5.0-dev0 --no-tag --no-push
34+
git commit -am "Upgrade the version to 2.5.0-dev0 following 2.4.0 release"
2635
```
2736

2837
Check the result and then upgrade the main branch
2938

30-
### Milestone handling
39+
- Delete the `maintenance/X.Y-1.x` branch. (For example: `maintenance/2.3.x`)
40+
- Create a `maintenance/X.Y.x` (For example: `maintenance/2.4.x` from the `v2.4.0` tag.)
3141

32-
We move issue that were not done in the next milestone and block release only if it's an
33-
issue labelled as blocker.
42+
## Backporting a fix from `main` to the maintenance branch
3443

35-
## Post release
44+
Whenever a commit on `main` should be released in a patch release on the current
45+
maintenance branch we cherry-pick the commit from `main`.
3646

37-
### Merge tags in main for pre-commit
47+
- During the merge request on `main`, make sure that the changelog is for the patch
48+
version `X.Y-1.Z'`. (For example: `v2.3.5`)
49+
- After the PR is merged on `main` cherry-pick the commits on the `maintenance/X.Y.x`
50+
branch (For example: from `maintenance/2.4.x` cherry-pick a commit from `main`)
51+
- Release a patch version
3852

39-
If the tag you just made is not part of the main branch, merge the tag `vX.Y.Z` in the
40-
main branch by doing a history only merge. It's done in order to signal that this is an
41-
official release tag, and for `pre-commit autoupdate` to works.
53+
## Releasing a patch version
4254

43-
```bash
44-
git checkout main
45-
git merge --no-edit --strategy=ours vX.Y.Z
46-
git push
47-
```
55+
We release patch versions when a crash or a bug is fixed on the main branch and has been
56+
cherry-picked on the maintenance branch.
57+
58+
- Check the result of `git diff vX.Y-1.Z-1 ChangeLog`. (For example:
59+
`git diff v2.3.4 ChangeLog`)
60+
- Install the release dependencies: `pip3 install -r requirements_test.txt`
61+
- Bump the version and release by using `tbump X.Y-1.Z --no-push`. (For example:
62+
`tbump 2.3.5 --no-push`)
63+
- Check the result visually and then by triggering the "release tests" workflow in
64+
GitHub Actions first.
65+
- Push the tag.
66+
- Release the version on GitHub with the same name as the tag and copy and paste the
67+
appropriate changelog in the description. This triggers the PyPI release.
68+
- Merge the `maintenance/X.Y.x` branch on the main branch. The main branch should have
69+
the changelog for `X.Y-1.Z+1` (For example `v2.3.6`). This merge is required so
70+
`pre-commit autoupdate` works for pylint.
71+
- Fix version conflicts properly, or bump the version to `X.Y.0-devZ` (For example:
72+
`2.4.0-dev6`) before pushing on the main branch
73+
74+
## Milestone handling
75+
76+
We move issues that were not done to the next milestone and block releases only if there
77+
are any open issues labelled as `blocker`.

tbump.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ src = "astroid/__pkginfo__.py"
2828
name = "Upgrade changelog changelog"
2929
cmd = "python3 script/bump_changelog.py {new_version}"
3030

31+
[[before_commit]]
32+
name = "Normalize the contributors-txt configuration"
33+
cmd = "contributors-txt-normalize-confinguration -a script/.contributors_aliases.json -o script/.contributors_aliases.json"
34+
3135
[[before_commit]]
3236
name = "Upgrade the contributors list"
3337
cmd = "python3 script/create_contributor_list.py"

0 commit comments

Comments
 (0)