Skip to content

Update release preparation to scripts/release#2069

Open
fressi-elastic wants to merge 27 commits into
elastic:masterfrom
fressi-elastic:chore/release-preparation-tooling
Open

Update release preparation to scripts/release#2069
fressi-elastic wants to merge 27 commits into
elastic:masterfrom
fressi-elastic:chore/release-preparation-tooling

Conversation

@fressi-elastic

@fressi-elastic fressi-elastic commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Supersedes #2067

Summary

  • Release prep scripts live under scripts/release/: prepare.sh (NOTICE, AUTHORS, changelog via changelog.py, version bump in esrally/_version.py, git commit), with create-notice.sh as the shared NOTICE generator.
  • Makefile: make release RELEASE_VERSION=X.Y.Z runs prepare.sh; make release-checks / make test-release run clean, lint, test-all, docs, then prepare.sh --dry with the same version.
  • Removed root prepare-release.sh and release-checks.sh in favor of the paths above.
  • scripts/offline-install.sh sources create-notice.sh from scripts/release/.
  • Changelog automation: changelog.py reads the GitHub token from a file; set RALLY_CHANGELOG_TOKEN_FILE to that path (default ~/.github/rally_release_changelog.token). github3.py remains a develop dependency for this script.
  • Docs: CONTRIBUTING.md (maintainer release pointer), docs/developing.rst (e.g. Java 21 for integration tests).
  • Tooling: pyproject.toml / uv.lock updates as needed (including a documented pip pin for track dependency installs); .pre-commit-config.yaml runs shellcheck on scripts/release/*.sh and pylint includes scripts/release/changelog.py.
  • Small fix: esrally/utils/io.py — tar extraction uses filter="tar" on Python 3.12+ with a fallback for 3.10/3.11.

Out of scope

Per-release generated artifacts for an actual release (e.g. committed CHANGELOG.md, AUTHORS, NOTICE.txt, version bump) can land in a follow-up release PR after this merges.

Maintainer runbook

Consolidate release scripts under scripts/release/, add Docker/Makefile
integration, githooks, and documentation. Root prepare-release.sh and
release-checks.sh are removed in favor of the unified layout.

This commit intentionally excludes release artifacts (AUTHORS, CHANGELOG,
_version, NOTICE) which land in a follow-up release PR.
@fressi-elastic fressi-elastic requested a review from Copilot March 23, 2026 13:38
@fressi-elastic fressi-elastic changed the title Releng: move release preparation to scripts/release Move release preparation to scripts/release Mar 23, 2026
@fressi-elastic fressi-elastic mentioned this pull request Mar 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reorganizes and expands Rally’s release engineering workflow by moving release preparation into scripts/release/, adding a dedicated Docker-based release preparation path, and updating documentation + tooling references accordingly.

Changes:

  • Introduces scripts/release/prepare.sh and scripts/release/prepare-docker.sh (with a dedicated scripts/release/Dockerfile) to standardize release prep in a container.
  • Updates release-related scripts to use a shared token-path convention (RALLY_CHANGELOG_TOKEN) and improves milestone handling in scripts/release/changelog.py.
  • Adds repo githooks and extends pre-commit configuration (shellcheck for release scripts), plus documentation updates.

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
uv.lock Locks new pip dependency resolution.
scripts/release/prepare.sh New host/container release preparation script (NOTICE/AUTHORS/CHANGELOG/version bump + commit).
scripts/release/prepare-docker.sh New Docker runner for release prep (bind-mount repo, named venv volume, UID/GID handling).
scripts/release/create-notice.sh Improves NOTICE generation (curl retries, dependency list updates).
scripts/release/checks.sh Replaces old release checks with token-aware, platform-aware checks under scripts/release/.
scripts/release/changelog.py Adds token path configurability + milestone reopen/create logic.
scripts/release/Dockerfile New image for release prep tooling and editable install.
scripts/offline-install.sh Updates NOTICE generation script path.
scripts/githooks/pre-commit Adds optional repo-managed pre-commit hook wrapper.
scripts/githooks/post-commit Adds optional hook to strip Cursor trailers from commit messages.
release-checks.sh Removes legacy release checks script at repo root.
pyproject.toml Updates NOTICE script reference; adds pip pin; documents github3.py pin rationale.
prepare-release.sh Removes legacy release preparation script at repo root.
docs/docker.rst Documents the separate maintainer-focused release prep image and workflow.
docs/developing.rst Adds a detailed “Preparing a release” section and token guidance.
Makefile Updates release / release-checks targets to use new scripts and RELEASE_VERSION.
CONTRIBUTING.md Documents optional repo hooks; adds maintainer release process pointers.
.pre-commit-config.yaml Adjusts pylint excludes for moved changelog; adds shellcheck hook for release scripts/hooks.
.dockerignore Adds a root dockerignore to keep the release-prep image build context small.
Comments suppressed due to low confidence (1)

scripts/release/changelog.py:116

  • Spelling in the comment: GitHub is capitalized as GitHub, not Github. Please update for consistency with the rest of the docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/docker.rst Outdated
Comment thread pyproject.toml Outdated
Comment thread scripts/release/prepare.sh Outdated
Comment thread scripts/githooks/post-commit Outdated
Comment thread docs/developing.rst Outdated
fressi-elastic and others added 7 commits March 23, 2026 14:47
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Elastic maintainers should follow the internal Rally Release Process on
Codex for tokens, milestones, make release, and the full workflow.

ReadTheDocs keeps only validation and implementation pointers: what
make release skips, release-checks and pre-commit, and where Docker
and changelog scripts document behavior. CONTRIBUTING, prepare-docker,
checks.sh, and Dockerfile comments cross-link accordingly.

@gareth-ellis gareth-ellis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some initial comments

Comment thread docs/developing.rst Outdated
Comment thread docs/docker.rst Outdated
Comment thread scripts/release/prepare-docker.sh Outdated
Comment thread CONTRIBUTING.md Outdated
@fressi-elastic

Copy link
Copy Markdown
Contributor Author

The run book for these procedures is being updated here -> https://github.com/elastic/elasticsearch-team/pull/2546

The env var holds a filesystem path to the token file, not the secret.
Update changelog.py, checks.sh, and prepare-docker.sh; clarify error
messages that a token file path is required.
Drop orphan dev_preparing_a_release anchor from developing.rst.
Point release scripts only at the Codex runbook for workflow and
release-checks expectations.
Comment thread CONTRIBUTING.md Outdated
Comment thread docs/developing.rst
@fressi-elastic fressi-elastic force-pushed the chore/release-preparation-tooling branch from 89cfaa2 to d348682 Compare March 24, 2026 11:20
- CONTRIBUTING.md: point maintainers at make release and scripts/release
- docs/developing.rst: restore How to contribute code section
- scripts/release: drop codex.elastic.dev references from checks.sh and prepare-docker.sh
@fressi-elastic

Copy link
Copy Markdown
Contributor Author

Thank you @gareth-ellis and @gbanasiak. I addressed all your comments.

@fressi-elastic fressi-elastic requested a review from a team March 24, 2026 11:31
Remove duplicate github3.py and the obsolete Docker release comment from develop extras. Correct the developing docs typo (performed) and the Makefile install-pre-commit comment grammar.

Made-with: Cursor
@fressi-elastic fressi-elastic changed the title Move release preparation to scripts/release Update release preparation to scripts/release Mar 27, 2026
Remove scripts/release/checks.sh and run make release-checks via
prepare.sh --dry, which mirrors prepare without writing repo files or
using git. Stop committing NOTICE.txt; prepare.sh stages only AUTHORS,
CHANGELOG.md, and esrally/_version.py.

Add changelog.py --dry (argparse) so dry prepare does not create
GitHub milestones; gate TarFile.extractall(filter=...) on Python 3.12+
to fix decompression tests on 3.10 and 3.11.

Made-with: Cursor
…ures

prepare.sh: detect changelog.py failures explicitly for dry and normal
runs; print a clear error and exit with the script exit code.

changelog.py: token/login errors and uncaught exceptions report to
stderr; tracebacks on stderr; changelog markdown explicitly on stdout;
brief stderr status before emitting markdown.

Made-with: Cursor
@fressi-elastic fressi-elastic force-pushed the chore/release-preparation-tooling branch from eb1c30e to 56da168 Compare March 28, 2026 01:30
@fressi-elastic

Copy link
Copy Markdown
Contributor Author

I addressed all comments and fixed more things, then updated the description of this PR.

@fressi-elastic fressi-elastic added the enhancement Improves the status quo label Mar 30, 2026

@gbanasiak gbanasiak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this works fine to me. Please find minor comments below.

Comment on lines +98 to +99
echo "Updating release version number"
printf '__version__ = "%s"\n' "$RELEASE_VERSION" > esrally/_version.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this stop working after #2080? Just making sure we're aligned here, cc @pquentin .

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, with #2080 this won't be needed and may even fail.

# Non-empty PREPARE_RELEASE_NO_VERIFY adds --no-verify (e.g. scripts/release/prepare-docker.sh).
git commit -m "Bump version to $RELEASE_VERSION" ${PREPARE_RELEASE_NO_VERIFY:+--no-verify}

pip install --editable .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is pip install required considering we're running this under uv via Makefile?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the uv docs state this:

Note that if you use uv run in a project, i.e., a directory with a pyproject.toml, it will install the current project before running the script. If your script does not depend on the project, use the --no-project flag to skip this:

# Note: the `--no-project` flag must be provided _before_ the script name.
uv run --no-project example.py

That said, the install won't be editable, so we'll need to reinstall to get the new version. It does not need to be editable, though. And it would be cleaner to use uv pip.

Comment thread Makefile
# usage: e.g. make release-checks RELEASE_VERSION=X.Y.Z
release-checks test-release: venv
@if [ -z "$(RELEASE_VERSION)" ]; then echo "error: set RELEASE_VERSION (e.g. make release-checks RELEASE_VERSION=X.Y.Z)" >&2; exit 1; fi
$(MAKE) clean lint test-all docs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found make release-checks a bit lenghty. Can we use test instead of test-all to reduce the time it takes to run the check?

Suggested change
$(MAKE) clean lint test-all docs
$(MAKE) clean lint test docs

Comment on lines +138 to +141
milestone = ensure_open_milestone(rally_repo, milestone_name, dry_run=dry_run)
if milestone.open_issues > 0:
print("There are [%d] open issues on milestone [%s]. Aborting..." % (milestone.open_issues, milestone_name), file=sys.stderr)
exit(2)
sys.exit(2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about adding a check if milestone has any PRs / issues attached?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improves the status quo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants