Skip to content
This repository was archived by the owner on Dec 28, 2025. It is now read-only.

introduce new version of validation#21

Closed
Pengzna wants to merge 2 commits intomasterfrom
merge-validate-release
Closed

introduce new version of validation#21
Pengzna wants to merge 2 commits intomasterfrom
merge-validate-release

Conversation

@Pengzna
Copy link

@Pengzna Pengzna commented Nov 15, 2025

as title

Summary by CodeRabbit

  • 文档更新

    • 优化了发布版本验证的指南文档,更新了构建命令和测试流程的说明。
  • 流程改进

    • 增强了发布版本的自动化验证工作流,提供更全面的验证覆盖和多平台支持。
  • 其他

    • 更新了项目配置文件。

imbajin and others added 2 commits November 14, 2025 20:12
…he#427)

* chore: update release workflow and .gitignore entries

Bumped default release version to 1.7.0 and updated default GPG user in the release workflow. Added installation step for subversion on Ubuntu. Appended WARP.md to .gitignore.

* refactor: unify release validation script and add local path support

Deleted validate-release-in-local.sh and enhanced validate-release.sh to support both SVN and local directory validation.

Added color-coded output, improved argument handling, and included Java version checks for better usability and error reporting.

* refactor: revamp release validation script with enhanced checks V2

Major rewrite of validate-release.sh for Apache HugeGraph, adding modular structure, improved logging, error/warning collection, colorized output, and comprehensive validation steps for source and binary packages.

 New features include dependency checks, GPG key management, license compliance, file size and binary checks, version consistency, and automated server/toolchain testing.

Usage instructions and help output are expanded for clarity.

* refactor: enhance release validation for multi-arch and license checks V3

Updated CI workflow to support additional OS and architectures (arm64, macOS 14). Improved documentation and script usage instructions.

The license header check now covers more file types and excludes generated/vendor files. Maven build commands in docs and scripts now use '-DskipTests' and '-Dcheckstyle.skip=true' for consistency. Added a detailed README for the release validation script.

* refactor: improve validation script error context and reporting V4

Adds contextual error and warning reporting with step and package information, enhances license category and header checks, improves version consistency logic, and refines summary output with execution time and clearer formatting.

These changes make validation results more actionable and easier to interpret, especially for multi-package and multi-step validations.

* fix: add JSON to CATEGORY_X license validation

The JSON license was added to the CATEGORY_X regex in the binary package validation step to ensure packages with this license are properly flagged during release validation.

* Update .github/workflows/validate-release.yml

* Update .github/workflows/validate-release.yml

---------

Co-authored-by: Peng Junzhi <78788603+Pengzna@users.noreply.github.com>
@github-actions
Copy link

@codecov-ai-reviewer review

@coderabbitai
Copy link

coderabbitai bot commented Nov 15, 2025

Caution

Review failed

The pull request is closed.

概览

本次提交引入了新的发布版本验证工作流,更新了现有工作流的配置和输入参数,修订了文档中的Maven测试命令语义,以及在.gitignore中添加了新的忽略文件条目。

变更内容

聚合 / 文件 变更摘要
GitHub Actions工作流
.github/workflows/validate-release-new.yml
新增完整的Apache发布版本验证工作流,包含9个验证步骤:Java版本验证、发布文件准备、GPG密钥导入、SHA512和GPG签名验证、源包验证(含许可证检查、编译验证)、服务器包测试、工具链包测试、二进制包验证及最终摘要输出。支持多操作系统和Java版本矩阵。
GitHub Actions工作流配置更新
.github/workflows/validate-release.yml
更新输入参数默认值、在SVN下载阶段增加Ubuntu特定的安装步骤、扩展二进制包类别过滤器(包括JSON.org)、扩展操作系统矩阵(支持ubuntu-24.04-arm和macos-14)。
版本控制忽略配置
.gitignore
添加WARP.md至忽略文件列表。
发布版本验证文档
content/cn/docs/contribution-guidelines/validate-release.md
content/en/docs/contribution-guidelines/validate-release.md
修改Unix编译验证命令:将-Dmaven.test.skip=true替换为-DskipTests,改变测试执行行为从"完全跳过"改为"编译但跳过执行";添加-P profile为可选说明。

预期代码审查工作量

🎯 3 (中等) | ⏱️ ~25-30 分钟

特别需要关注的区域:

  • 新工作流文件中9步验证流程的逻辑完整性和错误处理
  • Maven测试执行行为变更对现有构建流程的影响
  • 操作系统矩阵扩展中的新平台支持(ubuntu-24.04-arm, macos-14)
  • 跨文档的一致性更新(英文和中文文档的测试命令对齐)

可能相关的PR

诗歌

🐰 新的验证之轮开始转动,
九层检验守卫发布的宝殿,
跨平台、跨版本、跨天地,
GPG的印章闪闪生光,
文档更新同步向前!✨

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch merge-validate-release

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af87f8a and 363a05c.

⛔ Files ignored due to path filters (3)
  • dist/README.md is excluded by !**/dist/**
  • dist/validate-release-in-local.sh is excluded by !**/dist/**
  • dist/validate-release.sh is excluded by !**/dist/**
📒 Files selected for processing (5)
  • .github/workflows/validate-release-new.yml (1 hunks)
  • .github/workflows/validate-release.yml (4 hunks)
  • .gitignore (1 hunks)
  • content/cn/docs/contribution-guidelines/validate-release.md (1 hunks)
  • content/en/docs/contribution-guidelines/validate-release.md (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @Pengzna, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the release validation process for Apache HugeGraph by introducing a robust, automated shell script. The new script streamlines the verification of release packages, ensuring compliance with Apache policies and functional correctness through a series of checks, from cryptographic signatures to runtime tests. Accompanying documentation has been added and existing guidelines updated to support this enhanced validation workflow.

Highlights

  • New Release Validation Script: A comprehensive new validate-release.sh script (version 2.0.0) has been introduced to automate the Apache HugeGraph release validation process. This script performs extensive checks on release packages, covering integrity, license compliance, content validation, compilation, and runtime tests for server and toolchain components.
  • Updated Documentation for Validation: The Chinese and English contribution guidelines (validate-release.md) have been updated to reflect the new validation process, specifically modifying Maven commands to use -DskipTests for skipping tests during package compilation.
  • Detailed Validation README: A new dist/README.md file provides extensive documentation for the validate-release.sh script, detailing its features, usage, validation steps, output format, license check specifics, error handling, and troubleshooting.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/validate-release-new.yml
    • .github/workflows/validate-release.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Pengzna Pengzna closed this Nov 15, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is an excellent and comprehensive refactoring of the release validation script. The new version is much more robust, user-friendly, and maintainable. The structured approach with functions, detailed logging, colored output, and the 'collect and report' error handling strategy are all significant improvements. The new README is also very detailed and helpful. I've made a few suggestions to further improve robustness and usability, mainly around Java version detection, argument parsing, and handling of file search results. Overall, great work on this major enhancement!

Comment on lines +313 to +335
check_java_version() {
local required_version=$1

info "Checking Java version..."

if ! command -v java &> /dev/null; then
collect_error "Java is not installed or not in PATH"
return 1
fi

local current_version=$(java -version 2>&1 | head -n 1 | awk -F '"' '{print $2}' | awk -F '.' '{print $1}')
info "Current Java version: $current_version (Required: ${required_version})"

if [[ "$current_version" != "$required_version" ]]; then
collect_error "Java version mismatch! Current: Java $current_version, Required: Java ${required_version}"
collect_error "Please switch to Java ${required_version} before running this script"
return 1
fi

success "Java version check passed: Java $current_version"
mark_check_passed
return 0
}

Choose a reason for hiding this comment

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

high

The current method for parsing the Java version is not robust and will fail for Java 8. java -version for Java 8 outputs a string like java version "1.8.0_341", and your current awk command would incorrectly parse this as version 1. This would cause the validation to fail incorrectly on a system with Java 8, even if Java 8 were the required version. The suggested change handles both Java 8 and Java 9+ version string formats.

check_java_version() {
    local required_version=$1

    info "Checking Java version..."

    if ! command -v java &> /dev/null; then
        collect_error "Java is not installed or not in PATH"
        return 1
    fi

    local version_str
    version_str=$(java -version 2>&1 | head -n 1)
    local current_version
    if [[ "$version_str" =~ \"1\.([0-9]+) ]]; then
        # Handle Java 8 format (e.g., "1.8.0_341")
        current_version="${BASH_REMATCH[1]}"
    else
        # Handle Java 9+ format (e.g., "11.0.15")
        current_version=$(echo "$version_str" | awk -F '"' '{print $2}' | awk -F '.' '{print $1}')
    fi
    info "Current Java version: $current_version (Required: ${required_version})"

    if [[ "$current_version" != "$required_version" ]]; then
        collect_error "Java version mismatch! Current: Java $current_version, Required: Java ${required_version}"
        collect_error "Please switch to Java ${required_version} before running this script"
        return 1
    fi

    success "Java version check passed: Java $current_version"
    mark_check_passed
    return 0
}

Comment on lines +1082 to +1085
if [[ ! -d "${DIST_DIR}" ]]; then
collect_error "Directory ${DIST_DIR} does not exist"
exit 1
fi

Choose a reason for hiding this comment

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

high

The script's argument parsing can be confusing if a user tries to specify a Java version without a local path. For example, ./validate-release.sh 1.7.0 user 11 would fail with a 'Directory 11 does not exist' error. While the README documents the "" workaround, improving the error message would greatly enhance usability and prevent user confusion by guiding them to the correct syntax.

Suggested change
if [[ ! -d "${DIST_DIR}" ]]; then
collect_error "Directory ${DIST_DIR} does not exist"
exit 1
fi
if [[ ! -d "${DIST_DIR}" ]]; then
collect_error "Directory '${DIST_DIR}' does not exist."
if [[ "${DIST_DIR}" =~ ^[0-9]+$ ]]; then
collect_error "It looks like you may have tried to specify a Java version as the 3rd argument. To do so, provide an empty string for the local path, e.g.:\n ${SCRIPT_NAME} ${RELEASE_VERSION} ${USER} \"\" ${DIST_DIR}"
fi
exit 1
fi

Comment on lines +337 to +349
find_package_dir() {
local pattern=$1
local base_dir=${2:-"${DIST_DIR}"}

local found=$(find "$base_dir" -maxdepth 3 -type d -path "$pattern" 2>/dev/null | head -n1)

if [[ -z "$found" ]]; then
collect_error "Could not find directory matching pattern: $pattern"
return 1
fi

echo "$found"
}

Choose a reason for hiding this comment

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

medium

The find_package_dir function uses head -n1 to select a directory if multiple directories match the pattern. This could lead to unpredictable behavior if the file system contains unexpected directories. It's more robust to treat multiple matches as an error and report it to the user, ensuring the script always operates on the correct directory.

Suggested change
find_package_dir() {
local pattern=$1
local base_dir=${2:-"${DIST_DIR}"}
local found=$(find "$base_dir" -maxdepth 3 -type d -path "$pattern" 2>/dev/null | head -n1)
if [[ -z "$found" ]]; then
collect_error "Could not find directory matching pattern: $pattern"
return 1
fi
echo "$found"
}
find_package_dir() {
local pattern=$1
local base_dir=${2:-"${DIST_DIR}"}
local -a found_dirs
readarray -t found_dirs < <(find "$base_dir" -maxdepth 3 -type d -path "$pattern" 2>/dev/null)
if [[ ${#found_dirs[@]} -eq 0 ]]; then
collect_error "Could not find directory matching pattern: $pattern"
return 1
elif [[ ${#found_dirs[@]} -gt 1 ]]; then
collect_error "Found multiple directories matching pattern '$pattern':\n$(printf ' %s\n' "${found_dirs[@]}")"
return 1
fi
echo "${found_dirs[0]}"
}

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants