Copilot commented on code in PR #7123: URL: https://github.com/apache/incubator-kie/pull/7123#discussion_r4492209726
########## .ci/jenkins/Jenkinsfile.103xplus.release-candidate: ########## @@ -0,0 +1,211 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// 10.3.x+ release pipeline — fully independent, no kogito-pipelines / jobs.groovy dependency. +// - No @Library, no DSL-injected env vars, no drools-deploy / drools-promote downstream jobs +// - Create a plain "Pipeline script from SCM" job pointing at this file and run it +// with a few parameters. Everything it needs is a parameter (with a default). +// - Runs script/release/release-all.sh (R commit + RC tag -> build -> Nexus staging) +// +// MANDATORY parameters : RELEASE_VERSION, TAG_NAME +// Real RC run : DEPLOY=true, PUSH_TAG=true, DRY_RUN=false (the defaults) +// Branch cut (once per minor, before rc1 only): +// CREATE_STREAM_BRANCH=true -> creates X.Y.x from main, +// sets X.Y.999-SNAPSHOT, pushes it, then continues the RC on X.Y.x. +// Leave it false for rc2, final and patch releases (branch already exists). + +pipeline { + agent { + label 'ubuntu' + } + + tools { + maven 'maven_3.9.16' + jdk 'jdk_17_latest' + } + + options { + timestamps() + timeout(time: 360, unit: 'MINUTES') + } + + parameters { + string(name: 'RELEASE_VERSION', defaultValue: '', description: 'MANDATORY. Exact release version, e.g. 10.3.0', trim: true) + string(name: 'TAG_NAME', defaultValue: '', description: 'MANDATORY. RC tag name, e.g. 10.3.0-rc1 (must start with RELEASE_VERSION and be a new tag)', trim: true) + booleanParam(name: 'CREATE_STREAM_BRANCH', defaultValue: false, description: 'Branch cut: create X.Y.x (derived from RELEASE_VERSION) from main, set X.Y.999-SNAPSHOT and push it BEFORE building the RC. Only for the first RC of a new minor (e.g. 10.3.0-rc1). Fails if X.Y.x already exists') + booleanParam(name: 'SKIP_TESTS', defaultValue: true, description: 'Skip running tests during reactor build') + booleanParam(name: 'DEPLOY', defaultValue: true, description: 'Deploy artifacts to Apache Nexus staging') + string(name: 'STAGING_URL', defaultValue: '', description: 'Custom Nexus staging URL (optional)') + booleanParam(name: 'PUSH_TAG', defaultValue: true, description: 'Push the git tag to origin') + string(name: 'EXTRA_MAVEN_OPTS', defaultValue: '', description: 'Extra Maven CLI options to pass to build.sh') + booleanParam(name: 'DRY_RUN', defaultValue: false, description: 'Dry run without making remote git or staging changes') + + // Jenkins IDs — defaults match the existing KIE Jenkins; override only if they differ. + string(name: 'MAVEN_SETTINGS_CONFIG_FILE_ID', defaultValue: 'kie-release-authn-settings', description: 'Config File Provider ID of the Maven settings.xml (must define server "apache.releases.https")', trim: true) + string(name: 'GPG_KEY_CREDS_ID', defaultValue: 'GPG_KEY_FILE', description: 'Secret FILE credential ID holding the armored GPG private key', trim: true) + string(name: 'GPG_PASSPHRASE_CREDS_ID', defaultValue: '', description: 'Optional. Secret TEXT credential ID holding the GPG key passphrase. Leave empty if the key has no passphrase (KIE release key has none)', trim: true) + string(name: 'GIT_PUSH_CREDS_ID', defaultValue: '84811880-2025-45b6-a44c-2f33bef30ad2', description: 'Username/password credential ID used to push the RC tag to GitHub', trim: true) + } + + stages { + stage('Initialize & Validate') { + steps { + script { + if (!params.RELEASE_VERSION?.trim()) { + error 'RELEASE_VERSION parameter is mandatory (e.g. 10.3.0)' + } + if (!params.TAG_NAME?.trim()) { + error 'TAG_NAME parameter is mandatory (e.g. 10.3.0-rc1)' + } + if (!params.TAG_NAME.startsWith(params.RELEASE_VERSION)) { + error "TAG_NAME '${params.TAG_NAME}' must start with RELEASE_VERSION '${params.RELEASE_VERSION}'" + } Review Comment: A value such as `10.3$(...)` for RELEASE_VERSION passes the prefix check when TAG_NAME has the same prefix and survives the stream-branch replacement. It is then interpolated into the shell commands at lines 136–141, executing the substitution while release credentials are bound. Require a numeric X.Y.Z version and its matching X.Y.Z-rcN tag before constructing shell commands. ########## script/release/05-tag-release.sh: ########## @@ -0,0 +1,134 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +set -euo pipefail + +# Promotes an approved RC tag to the final release tag (AUTOMATION F). +# +# After the community vote passes on an RC (e.g. 10.3.0-rc2), this script +# creates the final release tag pointing to the same commit: +# +# git tag 10.3.0 10.3.0-rc2 +# +# By default the tag is created locally only. Pass --push to publish it. +# +# Usage: +# ./script/release/05-tag-release.sh --rc-tag <rc-tag> [--push] [--dry-run] +# +# Examples: +# ./script/release/05-tag-release.sh --rc-tag 10.3.0-rc2 +# ./script/release/05-tag-release.sh --rc-tag 10.3.0-rc2 --push + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)" + +RC_TAG="" +PUSH=false +DRY_RUN=false + +while [[ $# -gt 0 ]]; do + case $1 in + --rc-tag) + RC_TAG="${2:-}" + shift 2 + ;; + --push) + PUSH=true + shift + ;; + --dry-run) + DRY_RUN=true + shift + ;; + *) + echo "Unknown option: $1" + echo "Usage: $0 --rc-tag <rc-tag> [--push] [--dry-run]" + exit 1 + ;; + esac +done + +if [[ -z "${RC_TAG}" ]]; then + echo "ERROR: --rc-tag is required." + echo "Usage: $0 --rc-tag 10.3.0-rc2 [--push]" + exit 1 +fi + +if [[ ! "${RC_TAG}" =~ -rc[0-9]+$ ]]; then + echo "ERROR: --rc-tag must be an RC tag ending in -rc<N> (e.g. 10.3.0-rc2), got '${RC_TAG}'." + exit 1 +fi + +# Derive the final release tag (strip -rcN suffix). +RELEASE_TAG="$(echo "${RC_TAG}" | sed 's/-rc[0-9]*$//')" + +cd "${REPO_ROOT}" + +# Verify the RC tag exists. +if ! git rev-parse "${RC_TAG}" &>/dev/null; then + echo "ERROR: RC tag '${RC_TAG}' not found." + echo " Make sure you have fetched the tag: git fetch origin ${RC_TAG}" + exit 1 +fi + +RC_COMMIT="$(git rev-parse "${RC_TAG}")" + +echo "========================================" +echo "Apache KIE repo — tag release" +echo "RC tag : ${RC_TAG} (${RC_COMMIT:0:12})" +echo "Release tag : ${RELEASE_TAG}" +echo "Push : ${PUSH}" +echo "Dry run : ${DRY_RUN}" +echo "========================================" + +if [[ "${DRY_RUN}" == "true" ]]; then + echo "" + echo "[DRY RUN] Would execute:" + echo " git tag -a ${RELEASE_TAG} ${RC_TAG} -m \"Release ${RELEASE_TAG}\"" + if [[ "${PUSH}" == "true" ]]; then + echo " git push origin ${RELEASE_TAG}" + fi + exit 0 +fi + +echo "" +echo "--- Creating release tag ${RELEASE_TAG} at ${RC_TAG} ---" +git tag -a "${RELEASE_TAG}" "${RC_TAG}" -m "Release ${RELEASE_TAG}" Review Comment: If the final tag is pushed but GitHub Release creation fails, rerunning the promote pipeline stops here because the tag already exists. Allow an existing final tag only when it resolves to the approved RC commit, then continue to the push; fail without changing it if it points elsewhere. ########## .ci/jenkins/Jenkinsfile.103xplus.release-promote: ########## @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// 10.3.x+ promote / tag-release pipeline for incubator-kie. +// Run after the IPMC vote passes to: +// 1. Create and push the official release Git tag (e.g. 10.3.0) pointing to the approved RC commit. +// 2. Create the GitHub Release for incubator-kie. + +pipeline { + agent { + label 'ubuntu' + } + + tools { + maven 'maven_3.9.16' + jdk 'jdk_17_latest' + } + + options { + timestamps() + timeout(time: 60, unit: 'MINUTES') + } + + parameters { + string(name: 'PROJECT_VERSION', defaultValue: '', description: 'Release version (e.g. 10.3.0)', trim: true) + string(name: 'GIT_TAG', defaultValue: '', description: 'Approved RC tag (e.g. 10.3.0-rc1)', trim: true) + string(name: 'BUILD_BRANCH_NAME', defaultValue: '', description: 'Stream branch name (e.g. 10.3.x)', trim: true) + string(name: 'GIT_AUTHOR_PUSH_CREDS_ID', defaultValue: '84811880-2025-45b6-a44c-2f33bef30ad2', description: 'GitHub push credentials ID', trim: true) + } + + stages { + stage('Initialization') { + steps { + script { + cleanWs() + + assert params.PROJECT_VERSION : 'PROJECT_VERSION is required (e.g. 10.3.0)' + assert params.GIT_TAG : 'GIT_TAG (approved RC tag, e.g. 10.3.0-rc1) is required' + assert params.BUILD_BRANCH_NAME : 'BUILD_BRANCH_NAME (e.g. 10.3.x) is required' + assert params.GIT_TAG.startsWith("${params.PROJECT_VERSION}-rc") : "GIT_TAG '${params.GIT_TAG}' must be an RC tag for PROJECT_VERSION '${params.PROJECT_VERSION}' (e.g. ${params.PROJECT_VERSION}-rc1)" Review Comment: Prefix validation accepts a tag such as `10.3.0-rc1$(...)`. That value is interpolated directly into the shell commands at lines 92 and 96, so command substitutions execute before Git validates the tag, with the GitHub credential available. Validate the complete numeric release/RC formats and the stream branch format, or safely quote all parameter values passed to the shell. ########## script/release/04-deploy-to-staging.sh: ########## @@ -0,0 +1,193 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +set -euo pipefail + +# Deploys the locally-built JARs (already in ~/.m2) to a Nexus staging +# repository for Apache release voting. +# +# By default this script runs in DRY RUN mode and will NOT push anything +# remotely. Pass --deploy to actually upload to Nexus. +# +# Usage: +# ./script/release/04-deploy-to-staging.sh --tag <rc-tag> [--deploy] [--staging-url <url>] +# +# Examples: +# # dry run (safe — prints the Maven command that would be run) +# ./script/release/04-deploy-to-staging.sh --tag 10.3.0-rc1 +# +# # actually deploy to Apache Nexus staging +# ./script/release/04-deploy-to-staging.sh --tag 10.3.0-rc1 --deploy +# +# # deploy to a custom staging URL +# ./script/release/04-deploy-to-staging.sh --tag 10.3.0-rc1 --deploy \ +# --staging-url https://repository.apache.org/service/local/staging/deploy/maven2 +# +# Environment variables consumed when --deploy is active: +# MAVEN_SETTINGS Path to a settings.xml with Nexus credentials (required). +# The settings file must define a server with id "apache.releases.https" +# (or the id set via --server-id) carrying the deployer credentials. +# MAVEN_GPG_PASSPHRASE GPG passphrase for signing (required for Apache releases). +# Passed to the GPG agent via the gpg-agent pinentry loopback +# mechanism; NOT exposed on the Maven command line. + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)" + +TAG_NAME="" +DEPLOY=false +STAGING_URL="https://repository.apache.org/service/local/staging/deploy/maven2" +SERVER_ID="apache.releases.https" + +while [[ $# -gt 0 ]]; do + case $1 in + --tag) + TAG_NAME="${2:-}" + shift 2 + ;; + --deploy) + DEPLOY=true + shift + ;; + --staging-url) + STAGING_URL="${2:-}" + shift 2 + ;; + --server-id) + SERVER_ID="${2:-}" + shift 2 + ;; + *) + echo "Unknown option: $1" + echo "Usage: $0 --tag <rc-tag> [--deploy] [--staging-url <url>] [--server-id <id>]" + exit 1 + ;; + esac +done + +if [[ -z "${TAG_NAME}" ]]; then + echo "ERROR: --tag is required." + echo "Usage: $0 --tag 10.3.0-rc1 [--deploy]" + exit 1 +fi + +cd "${REPO_ROOT}" + +# ── Resolve the version from the tag name ──────────────────────────────────── +# Tag format: <version>-rc<N> (e.g. 10.3.0-rc1) +RELEASE_VERSION="$(echo "${TAG_NAME}" | sed 's/-rc[0-9]*$//')" + +echo "========================================" +echo "Apache KIE repo — deploy to staging" +echo "Tag : ${TAG_NAME}" +echo "Release version : ${RELEASE_VERSION}" +echo "Staging URL : ${STAGING_URL}" +echo "Server ID : ${SERVER_ID}" +echo "Deploy (real) : ${DEPLOY}" +echo "========================================" + +# ── Verify we are on / can resolve the RC tag ──────────────────────────────── +if ! git rev-parse "${TAG_NAME}" &>/dev/null; then + echo "" + echo "ERROR: Git tag '${TAG_NAME}' not found in this repository." + echo " Run rc-commit.sh first, or check out the tag manually." + exit 1 +fi + +# Check there are no uncommitted changes (staged, unstaged, or untracked) before +# deploying. Any local modifications could otherwise be included in the deployed artifacts. +if ! git diff --quiet || ! git diff --cached --quiet; then + echo "ERROR: There are uncommitted changes in the working tree." + echo " Commit, stash, or clean them before running this script." + exit 1 +fi +if [[ -n "$(git ls-files --others --exclude-standard)" ]]; then + echo "ERROR: There are untracked files in the working tree:" + git ls-files --others --exclude-standard | sed 's/^/ /' + echo " Remove or .gitignore them before running this script." + exit 1 +fi + +# ── Assemble Maven flags ───────────────────────────────────────────────────── + +DEPLOY_MVN_FLAGS=( + "-DskipTests" + "-Dfull" + # Activate the apache-release profile so the source/javadoc and GPG-signing + # goals defined there are executed (required for Apache releases). + "-Papache-release" + "-DaltDeploymentRepository=${SERVER_ID}::default::${STAGING_URL}" +) + +if [[ -n "${MAVEN_SETTINGS:-}" ]]; then + DEPLOY_MVN_FLAGS+=("-s" "${MAVEN_SETTINGS}") +fi + +# NOTE: MAVEN_GPG_PASSPHRASE is intentionally NOT added to the Maven command +# line — exposing it there would print it in captured console logs. +# The standard GPG Maven plugin (version 3+) reads the passphrase from the +# environment variable MAVEN_GPG_PASSPHRASE via pinentry-loopback automatically. +# For older plugin versions, configure loopback in ~/.gnupg/gpg-agent.conf: +# allow-loopback-pinentry +# and pass: -Dgpg.useagent=false -Dgpg.loopback=true in MAVEN_SETTINGS. + +echo "" +if [[ "${DEPLOY}" == "false" ]]; then + echo "[DRY RUN] Would run from tag ${TAG_NAME}:" + echo "" + echo " git checkout ${TAG_NAME}" + echo " mvn deploy ${DEPLOY_MVN_FLAGS[*]}" + echo " git checkout -" + echo "" + echo "Pass --deploy to actually upload artifacts." + exit 0 +fi + +# ── Checkout the exact tag commit before deploying ─────────────────────────── +# Save the original ref as the commit SHA when in detached HEAD state (e.g., +# Jenkins SCM checkout). `git rev-parse --abbrev-ref HEAD` returns "HEAD" when +# detached, which cannot be used to restore the checkout afterwards. +if git symbolic-ref --quiet HEAD &>/dev/null; then + ORIG_REF="$(git rev-parse --abbrev-ref HEAD)" +else + ORIG_REF="$(git rev-parse HEAD)" +fi + +echo "--- Checking out tag ${TAG_NAME} ---" +git checkout "${TAG_NAME}" + +echo "" +echo "--- Deploying to Nexus staging (${STAGING_URL}) ---" +mvn deploy "${DEPLOY_MVN_FLAGS[@]}" + +echo "" +echo "--- Returning to ${ORIG_REF} ---" +git checkout "${ORIG_REF}" Review Comment: A signing or Nexus deployment failure exits immediately under `set -e`, so the saved ORIG_REF is never restored and the working tree remains detached at the RC. Use an EXIT trap around checkout/deployment to restore the original ref on failure as well as success. ########## script/release/release-all.sh: ########## @@ -0,0 +1,201 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +set -euo pipefail + +# Master orchestrator for the local-first release workflow. +# +# Runs the individual release scripts in the correct order for a full release +# candidate cycle (02-rc-commit.sh -> 03-build.sh -> 04-deploy-to-staging.sh). +# Each step can also be run independently — see script/release/README.md. +# +# Usage: +# ./script/release/release-all.sh <version> [--tag <tag>] [OPTIONS] +# ./script/release/release-all.sh --version <version> [--tag <tag>] [OPTIONS] +# +# Required (one of): +# <version> or --version <ver> Exact release version, e.g. 10.3.0 +# +# Optional tags: +# --tag <tag> | --rc-tag <tag> RC tag name, e.g. 10.3.0-rc1 (defaults to <version>-rc1) +# --rc Explicit flag indicating RC mode +# +# Optional build flags: +# --skip-tests | --skip-build Skip tests during the build +# --maven-opts <opts> Extra Maven options forwarded to build.sh +# +# Optional deploy/publish flags: +# --deploy | --publish Deploy JARs to Nexus staging after the build +# --staging-url <url> Nexus staging URL (default: Apache Nexus) +# +# Optional git flags: +# --push | --push-tag Push the RC tag to origin after creating it +# +# Other: +# --dry-run Print what would happen without executing anything +# +# Examples: +# # Positional or flag version +# ./script/release/release-all.sh 10.3.0 --rc --skip-tests +# ./script/release/release-all.sh --version 10.3.0 --tag 10.3.0-rc1 --skip-tests +# +# # Full RC with deploy to Apache Nexus staging and push tag to origin +# ./script/release/release-all.sh 10.3.0 --tag 10.3.0-rc1 --skip-tests --deploy --push-tag + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)" + +RELEASE_VERSION="" +TAG_NAME="" +SKIP_TESTS=false +EXTRA_MVN_OPTS="" +DEPLOY=false +STAGING_URL="" +PUSH_TAG=false +DRY_RUN=false + +while [[ $# -gt 0 ]]; do + case $1 in + --version) RELEASE_VERSION="${2:-}"; shift 2 ;; + --tag|--rc-tag) TAG_NAME="${2:-}"; shift 2 ;; + --rc) shift ;; # Accepted for parity with tools repo + --skip-tests|--skip-build) SKIP_TESTS=true; shift ;; + --maven-opts) EXTRA_MVN_OPTS="${2:-}"; shift 2 ;; + --deploy|--publish) DEPLOY=true; shift ;; + --staging-url) STAGING_URL="${2:-}"; shift 2 ;; + --push|--push-tag) PUSH_TAG=true; shift ;; + --dry-run) DRY_RUN=true; shift ;; + *) + if [[ -z "${RELEASE_VERSION}" && ! "$1" =~ ^- ]]; then + RELEASE_VERSION="$1" + shift + else + echo "Unknown option: $1" + echo "Usage: $0 [<version> | --version <version>] [--tag <tag>] [OPTIONS]" + exit 1 + fi + ;; + esac +done + +if [[ -z "${RELEASE_VERSION}" ]]; then + echo "ERROR: Version is required." + echo "Usage: $0 10.3.0 [--tag 10.3.0-rc1] [OPTIONS]" + exit 1 +fi + +if [[ -z "${TAG_NAME}" ]]; then + TAG_NAME="${RELEASE_VERSION}-rc1" +fi + +cd "${REPO_ROOT}" + +echo "" +echo "==========================================" +echo "Apache KIE repo — release-all" +echo "Version : ${RELEASE_VERSION}" +echo "RC tag : ${TAG_NAME}" +echo "Skip tests : ${SKIP_TESTS}" +echo "Deploy staging : ${DEPLOY}" +echo "Push tag : ${PUSH_TAG}" +echo "Dry run : ${DRY_RUN}" +echo "==========================================" +echo "" + +# ── Helper ─────────────────────────────────────────────────────────────────── + +run_step() { + local step_name="$1" + shift + echo "" + echo "────────────────────────────────────────" + echo "STEP: ${step_name}" + echo "────────────────────────────────────────" + if [[ "${DRY_RUN}" == "true" ]]; then + echo "[DRY RUN] $*" + else + "$@" + fi + echo "✅ ${step_name} — done" +} + +# ── STEP 1 (Automation D.1): R commit + RC tag ─────────────────────────────── + +RC_COMMIT_SCRIPT="${SCRIPT_DIR}/02-rc-commit.sh" + +RC_COMMIT_ARGS=("${RC_COMMIT_SCRIPT}" "--version" "${RELEASE_VERSION}" "--tag" "${TAG_NAME}") +[[ "${PUSH_TAG}" == "true" ]] && RC_COMMIT_ARGS+=("--push") +[[ "${DRY_RUN}" == "true" ]] && RC_COMMIT_ARGS+=("--dry-run") + +run_step "R commit + RC tag (02-rc-commit.sh)" "${RC_COMMIT_ARGS[@]}" + +# ── STEP 2 (Automation D.2): Build ─────────────────────────────────────────── + +BUILD_SCRIPT="${SCRIPT_DIR}/03-build.sh" + +BUILD_ARGS=("${BUILD_SCRIPT}") +[[ "${SKIP_TESTS}" == "true" ]] && BUILD_ARGS+=("--skip-tests") +[[ -n "${EXTRA_MVN_OPTS}" ]] && BUILD_ARGS+=("--maven-opts" "${EXTRA_MVN_OPTS}") + +# The build must run at the RC tag commit. 02-rc-commit.sh leaves HEAD on the +# development branch, so we check out the tag, build, then return. +if [[ "${DRY_RUN}" == "true" ]]; then + run_step "Build @ ${TAG_NAME} (03-build.sh)" echo "[DRY RUN] git checkout ${TAG_NAME} && ${BUILD_ARGS[*]} && git checkout -" +else + echo "" + echo "────────────────────────────────────────" + echo "STEP: Build @ ${TAG_NAME} (03-build.sh)" + echo "────────────────────────────────────────" + git checkout "${TAG_NAME}" + "${BUILD_ARGS[@]}" + git checkout - Review Comment: With `set -e`, a failed build exits before the following checkout, leaving the caller detached at the release commit instead of on the original development branch. A subsequent release-all invocation then starts from the release version rather than the stream snapshot. Restore the original branch or detached commit in an EXIT trap so build failures preserve the caller's checkout too. ########## .ci/ci-image/start-docker.sh: ########## @@ -0,0 +1,8 @@ +#!/bin/bash Review Comment: These new shell sources lack the ASF license header required by `docs/CONVENTIONS.md:40–41` and checked in CI. Add the standard header after the shebang, as in `.ci/jenkins/dsl/test.sh:3–20`; the same change is needed in `.ci/ci-image/entrypoint.sh:1`, `.ci/ci-image/wait-for-process.sh:1`, and `.ci/ci-image/wait-for-docker.sh:1`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
