Skip to content

[#10448] feat(release): enhance do-release scripts to support non-interactive mode#10449

Merged
jerryshao merged 7 commits intomainfrom
feature/10448-non-interactive-release
Mar 19, 2026
Merged

[#10448] feat(release): enhance do-release scripts to support non-interactive mode#10449
jerryshao merged 7 commits intomainfrom
feature/10448-non-interactive-release

Conversation

@diqiu50
Copy link
Copy Markdown
Contributor

@diqiu50 diqiu50 commented Mar 17, 2026

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: #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.

Copilot AI review requested due to automatic review settings March 17, 2026 08:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.sh CLI with force/non-interactive and step control options, and enable stricter shell behavior (set -euo pipefail).
  • Enhance release-util.sh to 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.

Comment thread dev/release/do-release.sh Outdated
Comment thread dev/release/do-release.sh
Comment thread dev/release/do-release.sh
Comment thread dev/release/do-release.sh Outdated
Comment thread dev/release/do-release.sh
Comment thread dev/release/release-util.sh Outdated
Comment thread dev/release/release-util.sh Outdated
Comment thread dev/release/do-release.sh Outdated
Comment thread dev/release/do-release.sh Outdated
Comment thread dev/release/do-release.sh Outdated
@diqiu50 diqiu50 self-assigned this Mar 17, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 17, 2026

Code Coverage Report

Overall Project 64.92% 🟢
Files changed No Java source files changed -

Module Coverage
aliyun 1.73% 🔴
api 47.14% 🟢
authorization-common 85.96% 🟢
aws 1.1% 🔴
azure 2.6% 🔴
catalog-common 10.0% 🔴
catalog-fileset 80.02% 🟢
catalog-hive 80.98% 🟢
catalog-jdbc-clickhouse 78.25% 🟢
catalog-jdbc-common 42.98% 🟢
catalog-jdbc-doris 80.28% 🟢
catalog-jdbc-hologres 54.03% 🟢
catalog-jdbc-mysql 79.23% 🟢
catalog-jdbc-oceanbase 78.38% 🟢
catalog-jdbc-postgresql 82.05% 🟢
catalog-jdbc-starrocks 78.27% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 45.07% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 87.15% 🟢
catalog-lakehouse-paimon 77.71% 🟢
catalog-model 77.72% 🟢
cli 44.51% 🟢
client-java 77.83% 🟢
common 49.36% 🟢
core 81.31% 🟢
filesystem-hadoop3 76.97% 🟢
flink 38.86% 🔴
flink-runtime 0.0% 🔴
gcp 14.2% 🔴
hadoop-common 10.39% 🔴
hive-metastore-common 45.82% 🟢
iceberg-common 50.21% 🟢
iceberg-rest-server 66.24% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 23.78% 🔴
lance-rest-server 57.84% 🟢
lineage 53.02% 🟢
optimizer 82.95% 🟢
optimizer-api 21.95% 🔴
server 85.65% 🟢
server-common 69.72% 🟢
spark 32.79% 🔴
spark-common 39.6% 🔴
trino-connector 31.62% 🔴

@diqiu50 diqiu50 force-pushed the feature/10448-non-interactive-release branch from 351d1a6 to d4a270a Compare March 18, 2026 03:52
Comment thread dev/release/release-util.sh Outdated
@diqiu50 diqiu50 force-pushed the feature/10448-non-interactive-release branch from d4a270a to 09e9e3e Compare March 18, 2026 03:55
Comment thread dev/release/release-util.sh Outdated
local EC=$?
if [ $EC != 0 ]; then
if ! "$@" 1>"$LOG_FILE" 2>&1; then
local EC=$?
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.

What is the purpose of this change?

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.

Please reply this comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We add set -e in do-release.sh, We need to adjust the logic here to ensure errors can be logged.

Copy link
Copy Markdown
Contributor

@jerryshao jerryshao left a comment

Choose a reason for hiding this comment

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

A few issues worth addressing before merge — one functional bug and a couple of minor concerns.

Comment thread dev/release/release-util.sh
Comment thread dev/release/do-release.sh Outdated
Comment thread dev/release/do-release.sh Outdated
Comment thread dev/release/do-release.sh
… 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
@diqiu50 diqiu50 force-pushed the feature/10448-non-interactive-release branch from 09e9e3e to bfcc779 Compare March 18, 2026 04:03
Copy link
Copy Markdown
Contributor

@jerryshao jerryshao left a comment

Choose a reason for hiding this comment

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

Thanks for the quick updates — the three previous issues are all resolved. One remaining bug below.

Comment thread dev/release/do-release.sh Outdated
diqiu50 added 4 commits March 18, 2026 14:29
- 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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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 -y force mode and more CLI options to do-release.sh, plus stricter shell error handling (set -euo pipefail).
  • Extend release-util.sh to 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.

Comment thread dev/release/do-release.sh Outdated
Comment thread dev/release/release-util.sh
Comment thread dev/release/release-util.sh Outdated
Comment thread dev/release/do-release.sh
- 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
@jerryshao jerryshao merged commit ed9a65a into main Mar 19, 2026
27 of 28 checks passed
@jerryshao jerryshao deleted the feature/10448-non-interactive-release branch March 19, 2026 04:03
diqiu50 added a commit to diqiu50/gravitino that referenced this pull request Mar 27, 2026
…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.
danhuawang pushed a commit to danhuawang/gravitino that referenced this pull request Mar 30, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Enhance do-release scripts to support non-interactive mode

3 participants