[#10448] feat(release): enhance do-release scripts to support non-interactive mode#10449
[#10448] feat(release): enhance do-release scripts to support non-interactive mode#10449
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a non-interactive/automation-friendly mode to the release driver scripts under dev/release/, aiming to reduce manual prompts and allow release pipelines to run unattended.
Changes:
- Extend
do-release.shCLI with force/non-interactive and step control options, and enable stricter shell behavior (set -euo pipefail). - Enhance
release-util.shto prefer environment-provided release inputs in force mode and improve defaults/prompts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
| dev/release/release-util.sh | Updates prompting/config acquisition to support force-mode environment overrides and tweaks release info derivation. |
| dev/release/do-release.sh | Adds new CLI flags for automation, introduces strict bash settings, and changes prompting/wait behavior under force mode. |
You can also share your feedback on Copilot code review. Take the survey.
Code Coverage Report
|
351d1a6 to
d4a270a
Compare
d4a270a to
09e9e3e
Compare
| local EC=$? | ||
| if [ $EC != 0 ]; then | ||
| if ! "$@" 1>"$LOG_FILE" 2>&1; then | ||
| local EC=$? |
There was a problem hiding this comment.
What is the purpose of this change?
There was a problem hiding this comment.
Please reply this comment.
There was a problem hiding this comment.
We add set -e in do-release.sh, We need to adjust the logic here to ensure errors can be logged.
jerryshao
left a comment
There was a problem hiding this comment.
A few issues worth addressing before merge — one functional bug and a couple of minor concerns.
… mode
- Add :) case in getopts for missing option arguments
- Replace error() call before release-util.sh is sourced with inline echo+exit
- Add security warning in help text for -p/-t flags
- Consolidate all variable exports after getopts: RUNNING_IN_DOCKER, DRY_RUN, FORCE,
RC_COUNT, RELEASE_STEP, GIT_BRANCH, RELEASE_VERSION, ASF_PASSWORD, GPG_PASSPHRASE
- Use ${PYPI_API_TOKEN:-} to avoid unbound variable error under set -u
- Use ${GPG_PASSPHRASE:-} and ${JAVA_HOME:-} in docker path
- Fix RC_COUNT=0 check to treat 0 as missing (not valid)
- Fix run_silent to use if/! pattern so set -e does not swallow error output
- Fix NRC_COUNT wiring: use auto-detected value as default, only override when -r is explicitly provided
- Use ${VAR:-} pattern for ASF_USERNAME, GIT_NAME, ASF_PASSWORD, GPG_PASSPHRASE in get_release_info
09e9e3e to
bfcc779
Compare
jerryshao
left a comment
There was a problem hiding this comment.
Thanks for the quick updates — the three previous issues are all resolved. One remaining bug below.
- Add is_force() helper for consistency with is_dry_run() - Replace all direct FORCE variable checks with is_force() - Simplify read_config: remove redundant DISPLAY_DEFAULT variable, rename param to ENV_VAR_NAME for clarity - Always call get_release_info in non-docker mode so derived vars (RELEASE_TAG, GIT_REF, SKIP_TAG, ASF_USERNAME, etc.) are always initialized; force/non-interactive mode handled inside via is_force() - Fix run_silent to preserve real exit code using || EC=$? pattern - Add RELEASE_VERSION to export block; remove debug echo line - Add usage examples to -h help output
In docker mode get_release_info is never called, leaving RELEASE_TAG and SKIP_TAG unbound. With set -u active this causes an immediate abort at the should_build/tag check. Derive RELEASE_TAG from RELEASE_VERSION and RC_COUNT (which the driver script exports), and determine SKIP_TAG by checking whether the tag already exists via check_for_tag.
Tags are always created by the driver script before entering docker, so SKIP_TAG should always be 1 inside docker rather than re-checking via check_for_tag. Also initialize RELEASE_TAG with an empty default to satisfy set -u when the driver script has not exported it.
There was a problem hiding this comment.
Pull request overview
This PR enhances the Apache Gravitino release scripts to better support automation by adding a non-interactive (“force”) mode and additional CLI options, reducing the need for manual input during the release process.
Changes:
- Add
-yforce mode and more CLI options todo-release.sh, plus stricter shell error handling (set -euo pipefail). - Extend
release-util.shto source configuration from environment variables in force mode and improve RC/branch auto-detection. - Minor robustness/wording improvements (e.g., command failure capture, prompt text fixes, removing duplicate Java version assignment).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| dev/release/release-util.sh | Adds force-mode/env-var handling in read_config, improves release info/RC logic, and introduces is_force. |
| dev/release/do-release.sh | Adds non-interactive and step/secret CLI options, enforces stricter bash error handling, and skips certain prompts in force mode. |
You can also share your feedback on Copilot code review. Take the survey.
- Use printf instead of echo for GPG passphrase to handle special characters - Validate RC_COUNT is a positive integer before proceeding - Validate RELEASE_STEP against allowed values (tag/build/docs/publish/finalize) - Error and exit in force mode when required env var is not set
…on-interactive mode (apache#10449) ### What changes were proposed in this pull request? - `do-release.sh`: add `-y` (force) flag, `-s/-r/-p/-t` options for full CLI control; skip interactive prompts when in force mode; add `set -euo pipefail` for stricter error handling - `release-util.sh`: read release info from environment variables when in force mode; auto-detect latest branch and RC count; fix duplicate `JAVA_VERSION` assignment in `init_java` ### Why are the changes needed? The release process requires manual input at multiple steps. Non-interactive mode allows the release pipeline to be driven by automation without human intervention. Fix: apache#10448 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Manually verified with `bash -n` syntax check on all modified scripts.
…on-interactive mode (apache#10449) ### What changes were proposed in this pull request? - `do-release.sh`: add `-y` (force) flag, `-s/-r/-p/-t` options for full CLI control; skip interactive prompts when in force mode; add `set -euo pipefail` for stricter error handling - `release-util.sh`: read release info from environment variables when in force mode; auto-detect latest branch and RC count; fix duplicate `JAVA_VERSION` assignment in `init_java` ### Why are the changes needed? The release process requires manual input at multiple steps. Non-interactive mode allows the release pipeline to be driven by automation without human intervention. Fix: apache#10448 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Manually verified with `bash -n` syntax check on all modified scripts.
What changes were proposed in this pull request?
do-release.sh: add-y(force) flag,-s/-r/-p/-toptions for full CLI control; skip interactive prompts when in force mode; addset -euo pipefailfor stricter error handlingrelease-util.sh: read release info from environment variables when in force mode; auto-detect latest branch and RC count; fix duplicateJAVA_VERSIONassignment ininit_javaWhy are the changes needed?
The release process requires manual input at multiple steps. Non-interactive mode allows the release pipeline to be driven by automation without human intervention.
Fix: #10448
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Manually verified with
bash -nsyntax check on all modified scripts.