Skip to content

Commit a311d14

Browse files
authored
chore: Update Release instructions (#21705)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Related to #21635. ## Rationale for this change Upon releasing 53.0.0 and 53.1.0 I found some steps not clear or misleading, I tried to clarify steps based on most recent experience <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->
1 parent 466c3ea commit a311d14

File tree

2 files changed

+99
-84
lines changed

2 files changed

+99
-84
lines changed

dev/release/README.md

Lines changed: 97 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ We then publish the code in the approved artifacts to crates.io.
7777

7878
### 1. Create Release Branch
7979

80-
First create a new release branch from `main` in the apache repository.
80+
First create a new release branch from `main` in the `apache` repository.
8181

8282
For example, to create the `branch-50` branch for the `50.x.y` release series:
8383

@@ -88,11 +88,28 @@ git checkout -b branch-50 # create local branch
8888
git push -u apache branch-50 # push branch to apache remote
8989
```
9090

91-
### 2. Add a protection to release candidate branch
91+
### 2. Prepare PR to Update the Release Version
9292

93-
To protect a release candidate branch from accidental merges, run:
93+
Manually update the DataFusion version in the root `Cargo.toml` to
94+
reflect the new release version. Ensure `Cargo.lock` is updated accordingly by
95+
running:
9496

9597
```shell
98+
cargo check -p datafusion
99+
```
100+
101+
Then commit the changes and create a PR targeting the release branch `branch-N`.
102+
103+
```shell
104+
git commit -a -m 'Update version'
105+
```
106+
107+
### 3. Protect Release Branch
108+
109+
To protect a release candidate branch from accidental merges, create PR against `main`:
110+
111+
```shell
112+
git fetch apache && git checkout -b protect_branch_50
96113
./dev/release/add-branch-protection.sh 50
97114
```
98115

@@ -104,28 +121,22 @@ branch-50:
104121
required_approving_review_count: 1
105122
```
106123
107-
- Create a PR.
124+
- Commit changes
125+
- Push to `origin/protect_branch_50`
126+
- Create a PR against `main`.
108127
- Merge to `main`.
128+
- Notify community in Discord/Slack that release branch is created
109129

110-
### 3. Prepare PR to Update Changelog and the Release Version
111-
112-
First, prepare a PR to update the changelog and versions to reflect the planned
113-
release. See [#18173](https://github.com/apache/datafusion/pull/18173) for an example.
130+
### 4. Backporting urgent changes
114131

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.
132+
After release branch `branch-N` created, protected and got its version updated, please check if there are any backports expected from the community.
133+
Please refer to [Backport Flow](../../docs/source/contributor-guide/release_management.md#backport-workflow) for more details.
119134

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:
135+
Backports are important and sometimes unexpected, so please proceed to next release steps once all expected backports are applied.
123136

124-
```shell
125-
cargo check -p datafusion
126-
```
137+
### 5. Prepare PR to Update Changelog
127138

128-
**Step 2**: Update the [changelog] in `dev/changelog/`. Each release has its
139+
Update the changelog in `dev/changelog/`. Each release has its
129140
own file, such as `dev/changelog/50.0.0.md`, which should include all changes
130141
since the previous release.
131142

@@ -168,14 +179,12 @@ prettier -w dev/changelog/51.0.0.md
168179
Then commit the changes and create a PR targeting the release branch.
169180

170181
```shell
171-
git commit -a -m 'Update version'
182+
git commit -a -m 'Update changelog'
172183
```
173184

174-
Remember to merge any fixes back to the `main` branch as well.
175-
176-
### 4. Prepare Release Candidate Artifacts
185+
### 6. Prepare Release Candidate Artifacts
177186

178-
After the PR gets merged, you are ready to create release artifacts based off the
187+
After the changelog updates merged to `branch-N`, you are ready to create release artifacts based off the
179188
merged commit.
180189

181190
- You must be a committer to run these scripts because they upload to the
@@ -191,47 +200,41 @@ Pick numbers in sequential order, with `1` for `rc1`, `2` for `rc2`, etc.
191200

192201
While the official release artifacts are signed tarballs and zip files, we also
193202
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
203+
look like `50.3.0`, and release candidate tags look like `50.3.0-rc1`. See [the list of existing
195204
tags].
196205

197206
[the list of existing tags]: https://github.com/apache/datafusion/tags
198207

199-
Create and push the RC tag:
200-
201-
```shell
202-
git fetch apache
203-
git tag <version>-rc<rc> apache/branch-X
204-
git push apache <version>-rc<rc>
205-
```
206-
207-
For example, to create the `50.3.0-rc1` tag from `branch-50`, use:
208+
Create and push the RC tag, for example, to create the `50.3.0-rc1` tag from `branch-50`, use:
208209

209210
```shell
210211
git fetch apache
211212
git tag 50.3.0-rc1 apache/branch-50
212213
git push apache 50.3.0-rc1
213214
```
214215

216+
Please make sure the format is correct, tools like Homebrew listens for tags and in case of malformed tags users would be notified for non-existent version
217+
215218
#### Create, Sign, and Upload Artifacts
216219

217220
Run the `create-tarball.sh` script with the `<version>` tag and `<rc>` number you determined in previous steps:
218221

219222
For example, to create the `50.3.0-rc1` artifacts:
220223

221224
```shell
222-
GH_TOKEN=<TOKEN> ./dev/release/create-tarball.sh 50.3.0 1
225+
GITHUB_TOKEN=<TOKEN> ./dev/release/create-tarball.sh 50.3.0 1
223226
```
224227

225228
The `create-tarball.sh` script
226229

227230
1. Creates and uploads all release candidate artifacts to the [datafusion
228231
dev](https://dist.apache.org/repos/dist/dev/datafusion) location on the
229-
apache distribution SVN server
232+
Apache distribution SVN server
230233

231234
2. Provides you an email template to
232235
send to `dev@datafusion.apache.org` for release voting.
233236

234-
### 5. Vote on Release Candidate Artifacts
237+
### 7. Vote on Release Candidate Artifacts
235238

236239
Send the email output from the script to `dev@datafusion.apache.org`.
237240

@@ -248,19 +251,13 @@ review the release candidate.
248251
./dev/release/verify-release-candidate.sh 50.3.0 1
249252
```
250253

251-
#### If the Release is not Approved
252-
253-
If the release is not approved, fix whatever the problem is, make a new release
254-
candidate and try again.
255-
256-
Reminders:
254+
#### If Changes Are Requested
257255

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.
256+
If the release is not approved or urgent backports requested, please start over from [here](#4-backporting-urgent-changes)
260257

261258
#### If the Vote Passes: Announce the Result
262259

263-
Call the vote on the Arrow dev list by replying to the RC voting thread. The
260+
Call the vote on the Datafusion dev list by replying to the RC voting thread. The
264261
reply should have a new subject constructed by adding the `[RESULT]` prefix to the
265262
old subject line.
266263

@@ -271,11 +268,9 @@ The vote has passed with <NUMBER> +1 votes. Thank you to all who helped
271268
with the release verification.
272269
```
273270

274-
### 6. Finalize the Release
271+
### 8. Finalize the Release
275272

276-
NOTE: steps in this section can only be done by PMC members.
277-
278-
#### After the release is approved
273+
NOTE: steps in this section can only be done by PMC members after release is approved.
279274

280275
Move artifacts to the release location in SVN, e.g.
281276
https://dist.apache.org/repos/dist/release/datafusion/datafusion-50.3.0/, using
@@ -287,17 +282,17 @@ the `release-tarball.sh` script:
287282

288283
Congratulations! The release is now official!
289284

290-
### 7. Create Release git tags
285+
### 9. Create Release git tags
291286

292287
Tag the same release candidate commit with the final release tag
293288

294289
```shell
295-
git co apache/50.3.0-rc1
290+
git checkout 50.3.0-rc1
296291
git tag 50.3.0
297292
git push apache 50.3.0
298293
```
299294

300-
### 8. Publish on Crates.io
295+
### 10. Publish on Crates.io
301296

302297
Only approved releases of the tarball should be published to
303298
crates.io, in order to conform to Apache Software Foundation
@@ -314,56 +309,84 @@ to all DataFusion crates.
314309
Download and unpack the official release tarball
315310

316311
Verify that the Cargo.toml in the tarball contains the correct version
317-
(e.g. `version = "38.0.0"`) and then publish the crates by running the following commands
312+
(e.g. `version = "50.3.0"`) and then publish the crates by running the following commands
318313

319314
```shell
320-
(cd datafusion/doc && cargo publish)
321-
(cd datafusion/common-runtime && cargo publish)
322315
(cd datafusion/common && cargo publish)
323-
(cd datafusion/proto-common && cargo publish)
324-
(cd datafusion/macros && cargo publish)
316+
(cd datafusion/common-runtime && cargo publish)
317+
(cd datafusion/doc && cargo publish)
325318
(cd datafusion/expr-common && cargo publish)
319+
(cd datafusion/macros && cargo publish)
320+
(cd datafusion/proto-common && cargo publish)
326321
(cd datafusion/physical-expr-common && cargo publish)
327-
(cd datafusion/functions-window-common && cargo publish)
328322
(cd datafusion/functions-aggregate-common && cargo publish)
323+
(cd datafusion/functions-window-common && cargo publish)
329324
(cd datafusion/expr && cargo publish)
330325
(cd datafusion/execution && cargo publish)
331-
(cd datafusion/physical-expr && cargo publish)
332326
(cd datafusion/functions && cargo publish)
333-
(cd datafusion/functions-window && cargo publish)
327+
(cd datafusion/physical-expr && cargo publish)
334328
(cd datafusion/functions-aggregate && cargo publish)
329+
(cd datafusion/functions-window && cargo publish)
335330
(cd datafusion/physical-expr-adapter && cargo publish)
336-
(cd datafusion/physical-plan && cargo publish)
337331
(cd datafusion/functions-nested && cargo publish)
332+
(cd datafusion/physical-plan && cargo publish)
338333
(cd datafusion/session && cargo publish)
339-
(cd datafusion/datasource && cargo publish)
340-
(cd datafusion/catalog && cargo publish)
341-
(cd datafusion/spark && cargo publish)
342334
(cd datafusion/sql && cargo publish)
335+
(cd datafusion/datasource && cargo publish)
343336
(cd datafusion/optimizer && cargo publish)
344-
(cd datafusion/functions-table && cargo publish)
345-
(cd datafusion/datasource-json && cargo publish)
346-
(cd datafusion/datasource-csv && cargo publish)
347-
(cd datafusion/datasource-avro && cargo publish)
337+
(cd datafusion/catalog && cargo publish)
348338
(cd datafusion/datasource-arrow && cargo publish)
339+
(cd datafusion/datasource-avro && cargo publish)
340+
(cd datafusion/datasource-csv && cargo publish)
341+
(cd datafusion/datasource-json && cargo publish)
349342
(cd datafusion/pruning && cargo publish)
350343
(cd datafusion/datasource-parquet && cargo publish)
351-
(cd datafusion/catalog-listing && cargo publish)
344+
(cd datafusion/functions-table && cargo publish)
352345
(cd datafusion/physical-optimizer && cargo publish)
346+
(cd datafusion/catalog-listing && cargo publish)
353347
(cd datafusion/core && cargo publish)
354348
(cd datafusion-cli && cargo publish)
355-
(cd datafusion/substrait && cargo publish)
356-
(cd datafusion/sqllogictest && cargo publish)
357349
(cd datafusion/proto && cargo publish)
350+
(cd datafusion/spark && cargo publish)
351+
(cd datafusion/substrait && cargo publish)
358352
(cd datafusion/ffi && cargo publish)
353+
(cd datafusion/sqllogictest && cargo publish)
354+
```
355+
356+
Crates.io publishing depends on crates dependency tree, this list might contain wrong order.
357+
If it happens crates.io fails with wrong dependency message like below, just rerun all publishing commands.
358+
359+
```shell
360+
error: failed to prepare local package for uploading
361+
362+
Caused by:
363+
failed to select a version for the requirement `datafusion-proto = "^53.1.0"`
364+
candidate versions found which didn't match: 53.0.0, 52.5.0, 52.4.0, ...
365+
location searched: crates.io index
366+
required by package `datafusion-ffi v53.1.0 (/private/tmp/apache-datafusion-53.1.0/datafusion/ffi)`
359367
```
360368

361369
### Publish datafusion-cli on Homebrew
362370

363371
Note: [`datafusion` formula](https://formulae.brew.sh/formula/datafusion) is [updated automatically](https://github.com/Homebrew/homebrew-core/pulls?q=is%3Apr+datafusion+is%3Aclosed),
364372
so no action is needed.
365373

366-
### 9: Add the release to Apache Reporter
374+
### 11. Sync Changelog and Version to main
375+
376+
To sync changelog version and create PR against `main`:
377+
378+
```shell
379+
git fetch apache && git checkout -b sync_change_log_version
380+
```
381+
382+
- Cherry-pick or patch the version updates from step 2
383+
- Cherry-pick or patch the changelog updates from step 5
384+
- Commit changes, `git commit -a -m 'Sync changelog and version to main'`
385+
- Push to `origin/sync_change_log_version`
386+
- Create a PR against `main`.
387+
- Merge to `main`.
388+
389+
### 12. Add the release to Apache Reporter
367390

368391
When you have published the release, please help the project by adding the release to
369392
[Apache Reporter](https://reporter.apache.org/). The reporter system should
@@ -374,7 +397,7 @@ the examples from previous releases.
374397
The release information is used to generate a template for a board report (see example from Apache Arrow project
375398
[here](https://github.com/apache/arrow/pull/14357)).
376399

377-
### 10: Delete Old RCs and Releases
400+
### 13. Delete Old RCs and Releases
378401

379402
See the ASF documentation on [when to archive](https://www.apache.org/legal/release-policy.html#when-to-archive)
380403
for more information.
@@ -409,11 +432,3 @@ To delete a release:
409432
```shell
410433
svn delete -m "delete old DataFusion release" https://dist.apache.org/repos/dist/release/datafusion/datafusion-50.0.0
411434
```
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

dev/release/download-python-wheels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ def main():
3939
args = parser.parse_args()
4040

4141
tag = args.tag
42-
ghp_token = os.environ.get("GH_TOKEN")
42+
ghp_token = os.environ.get("GITHUB_TOKEN")
4343
if not ghp_token:
4444
print(
4545
"ERROR: Personal Github token is required to download workflow artifacts. "
46-
"Please specify a token through GH_TOKEN environment variable.")
46+
"Please specify a token through GITHUB_TOKEN environment variable.")
4747
sys.exit(1)
4848

4949
print(f"Downloading latest python wheels for RC tag {tag}...")

0 commit comments

Comments
 (0)