From 06f52264f7032623a4135fc066434f7da3312459 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Tue, 1 Dec 2026 15:11:23 -0500 Subject: [PATCH 1/3] docs: Document how to update the upgrade guide in the release process Co-Authored-By: Claude Fable 5.2 --- dev/release/README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/dev/release/README.md b/dev/release/README.md index 5fecf14579efb..52da6ef3c0f6a 100644 --- a/dev/release/README.md +++ b/dev/release/README.md @@ -89,6 +89,13 @@ cargo update --workspace # updates Cargo.lock ./ci/scripts/doc_prettier_check.sh --write --allow-dirty ``` +In the same PR, start the upgrade guide for the next version by adding a +`## DataFusion 58.0.0` section to +`docs/source/library-user-guide/upgrading/index.md`, above the +`## DataFusion 57.0.0` section. Leave the `57.0.0` section in place until +`57.0.0` is released, see +[Update the upgrade guide](#update-the-upgrade-guide). + ### 3. Prepare PR to Update the Release Version On the release branch, update the DataFusion version using the following @@ -346,6 +353,34 @@ python3 -m http.server --directory build/html 8000 Then open http://localhost:8000/ and check the version picker in the navigation bar. +#### Update the upgrade guide + +The [upgrade guide](../../docs/source/library-user-guide/upgrading/index.md) on +`main` only has the content for versions that are not yet released. The guides +for released versions are in the versioned documentation, which is built from +the release tag, and are linked from the "Past Upgrade Guides" section. + +For a major release (e.g. `57.0.0`), in the same PR that updates +`versions.json`: + +- Remove the `## DataFusion 57.0.0` section from the upgrade guide. Upgrade + notes for `57.0.0` that are written after `branch-57` was created must be + backported to `branch-57`, as the copy on `main` is not published for the + release. +- Add a link to the top of the "Past Upgrade Guides" list: + + ```markdown + - [DataFusion 57.0.0](https://datafusion.apache.org/versions/57.0.0/library-user-guide/upgrading/index.html#datafusion-57-0-0) + ``` + +- If `redirects` in `docs/source/conf.py` has an entry for the released + version (such as `library-user-guide/upgrading/57.0.0`), point it to the same URL. + +For a minor or patch release (e.g. `55.3.0`), change the "Past Upgrade Guides" +link and the `redirects` entry for that major version to the new release +(`/versions/55.3.0/`), which has any upgrade notes added since the previous +release. + ### 11. Publish on Crates.io Only approved releases of the tarball should be published to From 1fc2f645fbe38d06130b61e2e0631d862e14b4dc Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Tue, 1 Dec 2026 15:55:29 -0500 Subject: [PATCH 2/3] Publish the docs for a release branch before it is tagged Co-Authored-By: Claude Fable 5.2 --- dev/release/README.md | 72 +++++++++++++++++----------------- docs/scripts/build_versions.sh | 30 ++++++++++---- 2 files changed, 57 insertions(+), 45 deletions(-) diff --git a/dev/release/README.md b/dev/release/README.md index 52da6ef3c0f6a..95817027af12b 100644 --- a/dev/release/README.md +++ b/dev/release/README.md @@ -89,12 +89,28 @@ cargo update --workspace # updates Cargo.lock ./ci/scripts/doc_prettier_check.sh --write --allow-dirty ``` -In the same PR, start the upgrade guide for the next version by adding a -`## DataFusion 58.0.0` section to -`docs/source/library-user-guide/upgrading/index.md`, above the -`## DataFusion 57.0.0` section. Leave the `57.0.0` section in place until -`57.0.0` is released, see -[Update the upgrade guide](#update-the-upgrade-guide). +In the same PR, publish the documentation for the new release branch and +start the upgrade guide for the next version: + +- Add the new version to `docs/source/_static/versions.json` immediately after + the `Development (main)` entry, with the name `57.0.0 (unreleased)` and + without `"preferred"`. Until the `57.0.0` tag exists, the + [Deploy DataFusion versioned docs](../../.github/workflows/docs_versions.yaml) + workflow builds `/versions/57.0.0/` from `branch-57`. +- In the [upgrade guide](../../docs/source/library-user-guide/upgrading/index.md), + replace the `## DataFusion 57.0.0` section with an empty + `## DataFusion 58.0.0` section, and add a link to the top of the + "Past Upgrade Guides" list: + + ```markdown + - [DataFusion 57.0.0](https://datafusion.apache.org/versions/57.0.0/library-user-guide/upgrading/index.html#datafusion-57-0-0) + ``` + +- If `redirects` in `docs/source/conf.py` has an entry for the new version + (such as `library-user-guide/upgrading/57.0.0`), point it to the same URL. + +From then on, the upgrade guide for `57.0.0` is only on `branch-57`: add +upgrade notes for changes that are backported to `branch-57` there. ### 3. Prepare PR to Update the Release Version @@ -323,10 +339,14 @@ git push apache 55.2.0 #### Publish the versioned documentation -Open a PR against `main` that adds the release to -`docs/source/_static/versions.json` immediately after the `Development (main)` -entry and marks it with `"preferred": true` (remove `"preferred"` from the -previous release). +Open a PR against `main` that marks the release with `"preferred": true` in +`docs/source/_static/versions.json` (remove `"preferred"` from the previous +release). + +For a major release (e.g. `57.0.0`) the entry was added in +[Bump Version on main](#2-bump-version-on-main): remove `(unreleased)` from +its name. For a minor or patch release, add the entry immediately after the +`Development (main)` entry. The version picker only lists the most recent release of each major version. If the new release is a minor or patch release (e.g. `55.2.0`), move the @@ -353,33 +373,11 @@ python3 -m http.server --directory build/html 8000 Then open http://localhost:8000/ and check the version picker in the navigation bar. -#### Update the upgrade guide - -The [upgrade guide](../../docs/source/library-user-guide/upgrading/index.md) on -`main` only has the content for versions that are not yet released. The guides -for released versions are in the versioned documentation, which is built from -the release tag, and are linked from the "Past Upgrade Guides" section. - -For a major release (e.g. `57.0.0`), in the same PR that updates -`versions.json`: - -- Remove the `## DataFusion 57.0.0` section from the upgrade guide. Upgrade - notes for `57.0.0` that are written after `branch-57` was created must be - backported to `branch-57`, as the copy on `main` is not published for the - release. -- Add a link to the top of the "Past Upgrade Guides" list: - - ```markdown - - [DataFusion 57.0.0](https://datafusion.apache.org/versions/57.0.0/library-user-guide/upgrading/index.html#datafusion-57-0-0) - ``` - -- If `redirects` in `docs/source/conf.py` has an entry for the released - version (such as `library-user-guide/upgrading/57.0.0`), point it to the same URL. - -For a minor or patch release (e.g. `55.3.0`), change the "Past Upgrade Guides" -link and the `redirects` entry for that major version to the new release -(`/versions/55.3.0/`), which has any upgrade notes added since the previous -release. +For a minor or patch release (e.g. `55.3.0`), also change the link for that +major version in the "Past Upgrade Guides" section of the +[upgrade guide](../../docs/source/library-user-guide/upgrading/index.md), and +its entry in `redirects` in `docs/source/conf.py`, to the new release +(`/versions/55.3.0/`). ### 11. Publish on Crates.io diff --git a/docs/scripts/build_versions.sh b/docs/scripts/build_versions.sh index 7c47dbe278ffa..920d4944eabc0 100755 --- a/docs/scripts/build_versions.sh +++ b/docs/scripts/build_versions.sh @@ -32,7 +32,8 @@ Build the documentation for released DataFusion versions. Usage: $(basename "$0") [options] [VERSION ...] -Builds the documentation for each VERSION from its git tag. With no VERSION, +Builds the documentation for each VERSION from its git tag or, if there is no +such tag yet, from its release branch (such as branch-57). With no VERSION, builds every release listed in ${MANIFEST#"${REPO_DIR}/"} or ${OLD_MANIFEST#"${REPO_DIR}/"}. @@ -45,7 +46,8 @@ Options: -h, --help Show this help message Environment: - DATAFUSION_UPSTREAM_URL Repository to fetch missing release tags from + DATAFUSION_UPSTREAM_URL Repository to fetch missing release tags and + branches from (default: ${UPSTREAM_URL}) Example: preview the site with the 55.0.0 docs under versions/55.0.0/ @@ -141,17 +143,28 @@ trap cleanup EXIT # Make sure this checkout has the release tag, fetching it from upstream # otherwise (a shallow CI checkout stays shallow). -fetch_tag() { +# Prints the ref to build VERSION from: its release tag or, if VERSION is not +# yet released, the head of its release branch (such as branch-57). +release_ref() { local version="$1" - if git -C "${REPO_DIR}" rev-parse -q --verify "refs/tags/${version}^{commit}" >/dev/null; then + local tag="refs/tags/${version}" + if git -C "${REPO_DIR}" rev-parse -q --verify "${tag}^{commit}" >/dev/null; then + echo "${tag}" return fi - echo "Fetching tag ${version} from ${UPSTREAM_URL}" local depth=() if [[ "$(git -C "${REPO_DIR}" rev-parse --is-shallow-repository)" == "true" ]]; then depth=(--depth 1) fi - git -C "${REPO_DIR}" fetch "${depth[@]}" "${UPSTREAM_URL}" "refs/tags/${version}:refs/tags/${version}" + echo "Fetching tag ${version} from ${UPSTREAM_URL}" >&2 + if git -C "${REPO_DIR}" fetch "${depth[@]}" "${UPSTREAM_URL}" "${tag}:${tag}" >&2; then + echo "${tag}" + return + fi + local branch="branch-${version%%.*}" + echo "No tag ${version}: building from ${branch}" >&2 + git -C "${REPO_DIR}" fetch "${depth[@]}" "${UPSTREAM_URL}" "refs/heads/${branch}" >&2 + git -C "${REPO_DIR}" rev-parse FETCH_HEAD } build_version() { @@ -160,12 +173,13 @@ build_version() { local output="${OUTPUT_DIR}/${version}" echo "==> Building documentation for ${version}" - fetch_tag "${version}" + local ref + ref="$(release_ref "${version}")" if [[ -e "${worktree}" ]]; then git -C "${REPO_DIR}" worktree remove --force "${worktree}" >/dev/null 2>&1 || rm -rf "${worktree}" fi - git -C "${REPO_DIR}" worktree add --detach "${worktree}" "refs/tags/${version}" + git -C "${REPO_DIR}" worktree add --detach "${worktree}" "${ref}" # The workspace dependency graph is generated at build time and embedded in # the contributor guide (docs/build.sh does the same for the current docs). From b83a5586f5bc7658f56c29d941d02faba429d05d Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Tue, 1 Dec 2026 16:03:02 -0500 Subject: [PATCH 3/3] Note when backported upgrade notes are published Co-Authored-By: Claude Fable 5.2 --- dev/release/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/release/README.md b/dev/release/README.md index 95817027af12b..a419cda0e2a3d 100644 --- a/dev/release/README.md +++ b/dev/release/README.md @@ -110,7 +110,9 @@ start the upgrade guide for the next version: (such as `library-user-guide/upgrading/57.0.0`), point it to the same URL. From then on, the upgrade guide for `57.0.0` is only on `branch-57`: add -upgrade notes for changes that are backported to `branch-57` there. +upgrade notes for changes that are backported to `branch-57` there. They are +published the next time the workflow runs, which is at the latest in +[Publish the versioned documentation](#publish-the-versioned-documentation). ### 3. Prepare PR to Update the Release Version