diff --git a/dev/release/README.md b/dev/release/README.md index 5fecf14579efb..a419cda0e2a3d 100644 --- a/dev/release/README.md +++ b/dev/release/README.md @@ -89,6 +89,31 @@ cargo update --workspace # updates Cargo.lock ./ci/scripts/doc_prettier_check.sh --write --allow-dirty ``` +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. 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 On the release branch, update the DataFusion version using the following @@ -316,10 +341,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 @@ -346,6 +375,12 @@ python3 -m http.server --directory build/html 8000 Then open http://localhost:8000/ and check the version picker in the navigation bar. +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 Only approved releases of the tarball should be published to 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).