Skip to content

Commit f99ba69

Browse files
authored
Add release management page to the documentation (#21001)
## Which issue does this PR close? - Related to #19692 ## Rationale for this change As we see more people helping with releases (thank you @timsaucer and @comphead ❤️ ) I think having the process documented more will help Also, I spent quite a while back porting PRs and wanted to document it better ## What changes are included in this PR? 1. Add a release management page 2. Leave links to relevant sections ## Are these changes tested? By CI ## Are there any user-facing changes? Docs only
1 parent edf8ad3 commit f99ba69

4 files changed

Lines changed: 195 additions & 100 deletions

File tree

dev/release/README.md

Lines changed: 66 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -19,59 +19,11 @@
1919

2020
# Release Process
2121

22-
DataFusion typically has major releases around once per month, including breaking API changes.
22+
For contributor-facing guidance on release branches and backports, see the
23+
[Contributor Guide Release Management page](../../docs/source/contributor-guide/release_management.md).
2324

24-
Patch releases are made on an adhoc basis, but we try and avoid them given the frequent major releases.
25-
26-
## Release Process Overview
27-
28-
New development happens on the `main` branch.
29-
Releases are made from branches, e.g. `branch-50` for the `50.x.y` release series.
30-
31-
To prepare for a new release series, we:
32-
33-
- Create a new branch from `main`, such as `branch-50` in the Apache repository (not in a fork)
34-
- Continue merging new features changes to `main` branch
35-
- Prepare the release branch for release:
36-
- Update version numbers in `Cargo.toml` files and create `CHANGELOG.md`
37-
- Add additional changes to the release branch as needed
38-
- When the code is ready, create GitHub tags release candidate (rc) artifacts from the release branch.
39-
- After the release is approved, publish to [crates.io], the ASF distribution servers, and GitHub tags.
40-
41-
To add changes to the release branch, depending on the change we either:
42-
43-
- Fix the issue on `main` and then backport the change to the release branch (e.g. [#18129])
44-
- Fix the issue on the release branch and then forward-port the change back to `main` (e.g.[#18057])
45-
46-
[crates.io]: https://crates.io/crates/datafusion
47-
[#18129]: https://github.com/apache/datafusion/pull/18129
48-
[#18057]: https://github.com/apache/datafusion/pull/18057
49-
50-
## Backporting (add changes) to `branch-*` branch
51-
52-
If you would like to propose your change for inclusion in a patch release, the
53-
change must be applied to the relevant release branch. To do so please follow
54-
these steps:
55-
56-
1. Find (or create) the issue for the incremental release ([example release issue]) and discuss the proposed change there with the maintainers.
57-
2. Follow normal workflow to create PR to `main` branch and wait for its approval and merge.
58-
3. After PR is squash merged to `main`, branch from most recent release branch (e.g. `branch-50`), cherry-pick the commit and create a PR targeting the release branch [example backport PR].
59-
60-
For example, to backport commit `12345` from `main` to `branch-50`:
61-
62-
```shell
63-
git checkout branch-50
64-
git checkout -b backport_to_50
65-
git cherry-pick 12345 # your git commit hash
66-
git push -u <your fork>
67-
# make a PR as normal targeting branch-50, prefixed with [branch-50]
68-
```
69-
70-
It is also acceptable to fix the issue directly on the release branch first
71-
and then cherry-pick the change back to `main` branch in a new PR.
72-
73-
[example release issue]: https://github.com/apache/datafusion/issues/18072
74-
[example backport pr]: https://github.com/apache/datafusion/pull/18131
25+
This guide is for maintainers to create release candidates and run the release
26+
process.
7527

7628
## Release Prerequisites
7729

@@ -160,33 +112,35 @@ branch-50:
160112
First, prepare a PR to update the changelog and versions to reflect the planned
161113
release. See [#18173](https://github.com/apache/datafusion/pull/18173) for an example.
162114

163-
#### Update Version Numbers
164-
165-
Manually update the DataFusion version in the root `Cargo.toml` to reflect the new release version.
115+
- This PR should be the last one merged before creating a release
116+
candidate, so the changelog includes all changes.
117+
- If there are code changes between RCs, create and merge a new PR to update
118+
the changelog before creating the next RC.
166119

167-
Ensure Cargo.lock is updated accordingly by running:
120+
**Step 1**: Manually update the DataFusion version in the root `Cargo.toml` to
121+
reflect the new release version. Ensure `Cargo.lock` is updated accordingly by
122+
running:
168123

169124
```shell
170125
cargo check -p datafusion
171126
```
172127

173-
#### Changelog Generation
174-
175-
We maintain a [changelog] so our users know what has been changed between releases.
176-
177-
[changelog]: ../changelog
178-
179-
The changelog is generated using a Python script.
128+
**Step 2**: Update the [changelog] in `dev/changelog/`. Each release has its
129+
own file, such as `dev/changelog/50.0.0.md`, which should include all changes
130+
since the previous release.
180131

181-
To run the script, you will need a GitHub Personal Access Token (described in the prerequisites section) and the `PyGitHub` library. First install the dev dependencies via `uv`:
132+
The changelog is generated using a Python script, which requires a GitHub
133+
Personal Access Token (described in the prerequisites section) and the
134+
`PyGitHub` library. First install the dev dependencies via `uv`:
182135

183136
```shell
184137
uv sync
185138
```
186139

187-
To generate the changelog, set the `GITHUB_TOKEN` environment variable and then run `./dev/release/generate-changelog.py`
188-
providing two commit ids or tags followed by the version number of the release being created. For example,
189-
to generate a change log of all changes between the `50.3.0` tag and `branch-51`, in preparation for release `51.0.0`:
140+
To generate the changelog, set the `GITHUB_TOKEN` environment variable and run
141+
`./dev/release/generate-changelog.py` with two commit IDs or tags followed by
142+
the release version. For example, to generate a changelog of all changes
143+
between the `50.3.0` tag and `branch-51` for release `51.0.0`:
190144

191145
> [!NOTE]
192146
>
@@ -205,52 +159,52 @@ uv run ./dev/release/generate-changelog.py 50.3.0 branch-51 51.0.0 > dev/changel
205159
This script creates a changelog from GitHub PRs based on the labels associated with them as well as looking for
206160
titles starting with `feat:`, `fix:`, or `docs:`.
207161

208-
Once the change log is generated, run `prettier` to format the document:
162+
Once the changelog is generated, run `prettier` to format the document:
209163

210164
```shell
211165
prettier -w dev/changelog/51.0.0.md
212166
```
213167

214-
#### Commit and PR
215-
216168
Then commit the changes and create a PR targeting the release branch.
217169

218170
```shell
219171
git commit -a -m 'Update version'
220172
```
221173

222-
Remember to merge any fixes back to `main` branch as well.
174+
Remember to merge any fixes back to the `main` branch as well.
223175

224176
### 4. Prepare Release Candidate Artifacts
225177

226178
After the PR gets merged, you are ready to create release artifacts based off the
227179
merged commit.
228180

229-
(Note you need to be a committer to run these scripts as they upload to the apache svn distribution servers)
181+
- You must be a committer to run these scripts because they upload to the
182+
Apache SVN distribution servers.
183+
- If there are code changes between RCs, create and merge a changelog PR before
184+
creating the next RC.
230185

231186
#### Pick a Release Candidate (RC) number
232187

233188
Pick numbers in sequential order, with `1` for `rc1`, `2` for `rc2`, etc.
234189

235-
#### Create git Tag for the Release:
190+
#### Create Git tag for the Release Candidate
236191

237192
While the official release artifacts are signed tarballs and zip files, we also
238-
tag the commit it was created for convenience and code archaeology. Release tags
239-
have the format `<version>` (e.g. `38.0.0`), and release candidates have the
240-
format `<version>-rc<rc>` (e.g. `38.0.0-rc0`). See [the list of existing
193+
tag the commit it was created from for convenience and code archaeology. Release tags
194+
look like `38.0.0`, and release candidate tags look like `38.0.0-rc0`. See [the list of existing
241195
tags].
242196

243197
[the list of existing tags]: https://github.com/apache/datafusion/tags
244198

245-
Using a string such as `38.0.0` as the `<version>`, create and push the rc tag by running these commands:
199+
Create and push the RC tag:
246200

247201
```shell
248202
git fetch apache
249-
git tag <version>-<rc> apache/branch-X # create tag from the release branch
250-
git push apache <version>-<rc> # push tag to Github remote
203+
git tag <version>-rc<rc> apache/branch-X
204+
git push apache <version>-rc<rc>
251205
```
252206

253-
For example, to create the `50.3.0-rc1 tag from `branch-50`:
207+
For example, to create the `50.3.0-rc1` tag from `branch-50`, use:
254208

255209
```shell
256210
git fetch apache
@@ -260,7 +214,7 @@ git push apache 50.3.0-rc1
260214

261215
#### Create, Sign, and Upload Artifacts
262216

263-
Run the `create-tarball.sh` script with the `<version>` tag and `<rc>` and you determined in previous steps:
217+
Run the `create-tarball.sh` script with the `<version>` tag and `<rc>` number you determined in previous steps:
264218

265219
For example, to create the `50.3.0-rc1` artifacts:
266220

@@ -275,34 +229,39 @@ The `create-tarball.sh` script
275229
apache distribution SVN server
276230

277231
2. Provides you an email template to
278-
send to dev@datafusion.apache.org for release voting.
232+
send to `dev@datafusion.apache.org` for release voting.
279233

280234
### 5. Vote on Release Candidate Artifacts
281235

282-
Send the email output from the script to dev@datafusion.apache.org.
236+
Send the email output from the script to `dev@datafusion.apache.org`.
283237

284-
In order to publish the release on crates.io, it must be "official". To become
285-
official it needs at least three PMC members to vote +1 on it.
238+
In order to publish the release on crates.io, it must be "official." To become
239+
official, it needs at least three PMC members to vote +1 on it and no -1 votes.
240+
The vote must remain open for at least 72 hours to give everyone a chance to
241+
review the release candidate.
286242

287243
#### Verifying Release Candidates
288244

289-
The `dev/release/verify-release-candidate.sh` is a script in this repository that can assist in the verification process. Run it like:
245+
`dev/release/verify-release-candidate.sh` is a script in this repository that can assist in the verification process. Run it like this:
290246

291247
```shell
292248
./dev/release/verify-release-candidate.sh 50.3.0 1
293249
```
294250

295251
#### If the Release is not Approved
296252

297-
If the release is not approved, fix whatever the problem is, merge changelog
298-
changes into the release branch and try again with the next RC number.
253+
If the release is not approved, fix whatever the problem is, make a new release
254+
candidate and try again.
255+
256+
Reminders:
299257

300-
Remember to merge any fixes back to `main` branch as well.
258+
1. Update the changelog and create a new PR if there are any code changes, and merge it before creating the next RC.
259+
2. Merge any fixes back to the `main` branch as well.
301260

302-
#### If the Release is Approved: Call the Vote
261+
#### If the Vote Passes: Announce the Result
303262

304263
Call the vote on the Arrow dev list by replying to the RC voting thread. The
305-
reply should have a new subject constructed by adding `[RESULT]` prefix to the
264+
reply should have a new subject constructed by adding the `[RESULT]` prefix to the
306265
old subject line.
307266

308267
Sample announcement template:
@@ -415,39 +374,46 @@ the examples from previous releases.
415374
The release information is used to generate a template for a board report (see example from Apache Arrow project
416375
[here](https://github.com/apache/arrow/pull/14357)).
417376

418-
### 10: Delete old RCs and Releases
377+
### 10: Delete Old RCs and Releases
419378

420379
See the ASF documentation on [when to archive](https://www.apache.org/legal/release-policy.html#when-to-archive)
421380
for more information.
422381

423-
#### Deleting old release candidates from `dev` svn
424-
425382
Release candidates should be deleted once the release is published.
426383

427-
Get a list of DataFusion release candidates:
384+
To get a list of DataFusion release candidates:
428385

429386
```shell
430387
svn ls https://dist.apache.org/repos/dist/dev/datafusion
431388
```
432389

433-
Delete a release candidate:
390+
To delete a release candidate:
434391

435392
```shell
436393
svn delete -m "delete old DataFusion RC" https://dist.apache.org/repos/dist/dev/datafusion/apache-datafusion-50.0.0-rc1/
437394
```
438395

439-
#### Deleting old releases from `release` svn
396+
#### Delete old releases from `release` SVN
440397

441-
Only the latest release should be available. Delete old releases after publishing the new release.
398+
Only the latest release should be available. Delete old releases after
399+
publishing the new release.
442400

443-
Get a list of DataFusion releases:
401+
To get a list of DataFusion releases:
444402

445403
```shell
446404
svn ls https://dist.apache.org/repos/dist/release/datafusion
447405
```
448406

449-
Delete a release:
407+
To delete a release:
450408

451409
```shell
452410
svn delete -m "delete old DataFusion release" https://dist.apache.org/repos/dist/release/datafusion/datafusion-50.0.0
453411
```
412+
413+
### 11. Forward-port changelog to `main`
414+
415+
After the release is published, forward port the version update and changelog to
416+
`main` so that it is up to date for the next release. See [#21053] for an
417+
example PR that forward-ports the changelog to `main`.
418+
419+
[#21053]: https://github.com/apache/datafusion/pull/21053

docs/source/contributor-guide/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ If you are concerned that a larger design will be lost in a string of small PRs,
101101

102102
Note all commits in a PR are squashed when merged to the `main` branch so there is one commit per PR after merge.
103103

104+
## Release Management and Backports
105+
106+
Contributor-facing guidance for release branches, patch releases, and backports
107+
is documented in the [Release Management](release_management.md) guide.
108+
104109
## Before Submitting a PR
105110

106111
Before submitting a PR, run the standard non-functional checks. PRs must pass

0 commit comments

Comments
 (0)