Update release preparation to scripts/release#2069
Conversation
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.
There was a problem hiding this comment.
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.shandscripts/release/prepare-docker.sh(with a dedicatedscripts/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 inscripts/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, notGithub. Please update for consistency with the rest of the docs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
left a comment
There was a problem hiding this comment.
Added some initial comments
|
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.
89cfaa2 to
d348682
Compare
- 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
|
Thank you @gareth-ellis and @gbanasiak. I addressed all your comments. |
…Also update documentation.
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
…preparation-tooling
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
…preparation-tooling
eb1c30e to
56da168
Compare
|
I addressed all comments and fixed more things, then updated the description of this PR. |
…preparation-tooling
gbanasiak
left a comment
There was a problem hiding this comment.
Thank you, this works fine to me. Please find minor comments below.
| echo "Updating release version number" | ||
| printf '__version__ = "%s"\n' "$RELEASE_VERSION" > esrally/_version.py |
There was a problem hiding this comment.
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 . |
There was a problem hiding this comment.
Is pip install required considering we're running this under uv via Makefile?
There was a problem hiding this comment.
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.
| # 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 |
There was a problem hiding this comment.
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?
| $(MAKE) clean lint test-all docs | |
| $(MAKE) clean lint test docs |
| 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) |
There was a problem hiding this comment.
WDYT about adding a check if milestone has any PRs / issues attached?
Supersedes #2067
Summary
scripts/release/:prepare.sh(NOTICE, AUTHORS, changelog viachangelog.py, version bump inesrally/_version.py, git commit), withcreate-notice.shas the shared NOTICE generator.make release RELEASE_VERSION=X.Y.Zrunsprepare.sh;make release-checks/make test-releaserunclean,lint,test-all,docs, thenprepare.sh --drywith the same version.prepare-release.shandrelease-checks.shin favor of the paths above.scripts/offline-install.shsourcescreate-notice.shfromscripts/release/.changelog.pyreads the GitHub token from a file; setRALLY_CHANGELOG_TOKEN_FILEto that path (default~/.github/rally_release_changelog.token).github3.pyremains a develop dependency for this script.CONTRIBUTING.md(maintainer release pointer),docs/developing.rst(e.g. Java 21 for integration tests).pyproject.toml/uv.lockupdates as needed (including a documentedpippin for track dependency installs);.pre-commit-config.yamlruns shellcheck onscripts/release/*.shand pylint includesscripts/release/changelog.py.esrally/utils/io.py— tar extraction usesfilter="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