This is an automated email from the ASF dual-hosted git repository.

Kusuma04-dev pushed a commit to branch test_10.3.x
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/test_10.3.x by this push:
     new 0304a613f82 updated
0304a613f82 is described below

commit 0304a613f82ae357f814c054982bc39b9ab837ba
Author: Kusuma04-dev <[email protected]>
AuthorDate: Tue Oct 27 23:27:34 2026 +0530

    updated
---
 .ci/jenkins/Jenkinsfile.103xplus.release-candidate | 94 +++++++++++-----------
 1 file changed, 46 insertions(+), 48 deletions(-)

diff --git a/.ci/jenkins/Jenkinsfile.103xplus.release-candidate 
b/.ci/jenkins/Jenkinsfile.103xplus.release-candidate
index 708f0a11a0a..6b052208b81 100644
--- a/.ci/jenkins/Jenkinsfile.103xplus.release-candidate
+++ b/.ci/jenkins/Jenkinsfile.103xplus.release-candidate
@@ -43,27 +43,22 @@ pipeline {
     parameters {
         string(
             name: 'RELEASE_VERSION',
-            description: 'Release version (e.g., 1.0.0)',
+            description: 'MANDATORY. Exact release version, e.g. 10.3.0',
             defaultValue: '0.0.0'
         )
         string(
-            name: 'RELEASE_CANDIDATE_VERSION',
-            description: 'Release candidate version (e.g., 10.3.0-rc1)',
+            name: 'TAG_NAME',
+            description: 'MANDATORY. RC tag name, e.g. 10.3.0-rc1 (must start 
with RELEASE_VERSION and be a new tag)',
             defaultValue: '0.0.0-rc1'
         )
-        string(
-            name: 'BASE_REF',
-            description: 'Git branch or tag to release from. When 
CREATE_STREAM_BRANCH=true this is the branch the new X.Y.x stream branch is cut 
from (normally main)',
-            defaultValue: 'main'
-        )
         booleanParam(
             name: 'CREATE_STREAM_BRANCH',
-            description: 'Branch cut, part 1: create branch X.Y.x (derived 
from RELEASE_VERSION) from BASE_REF and push it. Only for the first RC of a new 
minor (e.g. 10.3.0-rc1). Fails if X.Y.x already exists',
+            description: 'Branch cut, part 1: create branch X.Y.x (derived 
from RELEASE_VERSION) from main and push it. Only for the first RC of a new 
minor (e.g. 10.3.0-rc1). Fails if X.Y.x already exists',
             defaultValue: false
         )
         booleanParam(
             name: 'UPDATE_STREAM_VERSION',
-            description: 'Branch cut, part 2: set the development version in 
all files on X.Y.x (project version X.Y.999, kogito maven X.Y.999-SNAPSHOT, 
stream name X.Y.x), commit and push. Use together with CREATE_STREAM_BRANCH for 
a normal branch cut, or alone if X.Y.x was already created (the stage then 
checks out the existing X.Y.x)',
+            description: 'Branch cut, part 2: set the development version in 
all files on X.Y.x (project version X.Y.999, kogito maven X.Y.999-SNAPSHOT, 
stream name X.Y.x), commit and push. Use together with CREATE_STREAM_BRANCH for 
a normal branch cut, or alone if X.Y.x was already created',
             defaultValue: false
         )
         booleanParam(
@@ -113,6 +108,28 @@ pipeline {
             }
         }
 
+        // The stream branch X.Y.x is derived from RELEASE_VERSION. A branch 
cut starts from main;
+        // every other run (rc2, patch releases) builds from the existing 
X.Y.x.
+        stage('Resolve release ref') {
+            steps {
+                script {
+                    def m = (params.RELEASE_VERSION =~ /^(\d+)\.(\d+)\..+$/)
+                    if (!m.matches()) {
+                        error("Cannot derive stream branch from 
RELEASE_VERSION '${params.RELEASE_VERSION}' (expected e.g. 10.3.0)")
+                    }
+                    streamBranch = "${m.group(1)}.${m.group(2)}.x"
+                    devVersion = "${m.group(1)}.${m.group(2)}.999"
+                    m = null
+
+                    if (!params.TAG_NAME.startsWith(params.RELEASE_VERSION)) {
+                        error("TAG_NAME '${params.TAG_NAME}' must start with 
RELEASE_VERSION '${params.RELEASE_VERSION}'")
+                    }
+                    baseRef = params.CREATE_STREAM_BRANCH ? 'main' : 
streamBranch
+                    echo "Building from ${baseRef}"
+                }
+            }
+        }
+
         stage('Start required services') {
             steps {
                 script {
@@ -133,7 +150,7 @@ pipeline {
                     script {
                         githubUtils.checkoutRepo(
                             
"http://github.com/${pipelineVars.githubRepositorySlug}.git";,
-                            "${params.BASE_REF}",
+                            "${baseRef}",
                             "${pipelineVars.kieToolsBotGithubCredentialsId}"
                         )
                     }
@@ -158,7 +175,7 @@ pipeline {
                         sh """#!/bin/bash -el
                         git config user.email [email protected]
                         git config user.name asf-ci-kie
-                        git checkout ${params.BASE_REF}
+                        git checkout ${baseRef}
                         """.trim()
                     }
                 }
@@ -182,22 +199,13 @@ pipeline {
             steps {
                 dir('kie-tools') {
                     script {
-                        def m = (params.RELEASE_VERSION =~ 
/^(\d+)\.(\d+)\..+$/)
-                        if (!m.matches()) {
-                            error("Cannot derive stream branch from 
RELEASE_VERSION '${params.RELEASE_VERSION}' (expected e.g. 10.3.0)")
-                        }
-                        def streamBranch = "${m.group(1)}.${m.group(2)}.x"
-                        def devVersion = "${m.group(1)}.${m.group(2)}.999"
-                        def devMavenVersion = "${devVersion}-SNAPSHOT"
-                        m = null
-
-                        def exists = sh(
-                            returnStatus: true,
-                            script: "git ls-remote --exit-code --heads origin 
${streamBranch} > /dev/null"
-                        ) == 0
-
-                        // Part 1: create the branch
+                        // Part 1: create the branch from main (the checkout 
above is already on the
+                        // existing X.Y.x when only UPDATE_STREAM_VERSION is 
set)
                         if (params.CREATE_STREAM_BRANCH) {
+                            def exists = sh(
+                                returnStatus: true,
+                                script: "git ls-remote --exit-code --heads 
origin ${streamBranch} > /dev/null"
+                            ) == 0
                             if (exists) {
                                 error("Branch '${streamBranch}' already exists 
on origin. The branch cut is done once per minor; unset CREATE_STREAM_BRANCH 
for rc2 / patch releases.")
                             }
@@ -206,23 +214,13 @@ pipeline {
                                 git checkout -b "$STREAM_BRANCH"
                                 '''
                             }
-                        } else if (!exists) {
-                            error("Branch '${streamBranch}' does not exist on 
origin. Set CREATE_STREAM_BRANCH=true as well.")
-                        } else {
-                            // Update-only: continue on the already existing 
branch
-                            withEnv(["STREAM_BRANCH=${streamBranch}"]) {
-                                sh '''#!/bin/bash -el
-                                git fetch origin 
"+refs/heads/$STREAM_BRANCH:refs/remotes/origin/$STREAM_BRANCH"
-                                git checkout -B "$STREAM_BRANCH" 
"origin/$STREAM_BRANCH"
-                                '''
-                            }
                         }
 
                         // Part 2: update the version in all files
                         // Same set of changes as the 10.2.x branch cut 
(Jenkinsfile.setup-branch):
                         // project version, kogito maven version, stream name 
(+ optional CI image tag).
                         if (params.UPDATE_STREAM_VERSION) {
-                            withEnv(["DEV_VERSION=${devVersion}", 
"DEV_MAVEN_VERSION=${devMavenVersion}", "STREAM_BRANCH=${streamBranch}", 
"UPDATE_CI_IMAGE_TAG=${params.UPDATE_CI_IMAGE_TAG}"]) {
+                            withEnv(["DEV_VERSION=${devVersion}", 
"DEV_MAVEN_VERSION=${devVersion}-SNAPSHOT", "STREAM_BRANCH=${streamBranch}", 
"UPDATE_CI_IMAGE_TAG=${params.UPDATE_CI_IMAGE_TAG}"]) {
                                 sh '''#!/bin/bash -el
                                 pnpm update-version-to "$DEV_VERSION"
                                 pnpm update-kogito-version-to --maven 
"$DEV_MAVEN_VERSION"
@@ -260,7 +258,7 @@ pipeline {
                     script {
                         sh """#!/bin/bash -el
                         git add .
-                        git commit --allow-empty -am "Apache KIE 
${params.RELEASE_VERSION} release candidate ${params.RELEASE_CANDIDATE_VERSION}"
+                        git commit --allow-empty -am "Apache KIE 
${params.RELEASE_VERSION} release candidate ${params.TAG_NAME}"
                         """.trim()
                     }
                 }
@@ -287,8 +285,8 @@ pipeline {
             steps {
                 dir('kie-tools') {
                     script {
-                        
githubUtils.createTag("${params.RELEASE_CANDIDATE_VERSION}")
-                        githubUtils.pushObject('origin', 
"${params.RELEASE_CANDIDATE_VERSION}", 
"${pipelineVars.asfGithubPushCredentialsId}")
+                        githubUtils.createTag("${params.TAG_NAME}")
+                        githubUtils.pushObject('origin', "${params.TAG_NAME}", 
"${pipelineVars.asfGithubPushCredentialsId}")
                         sleep(time: 1, unit: 'MINUTES')
                     }
                 }
@@ -301,12 +299,12 @@ pipeline {
                     script {
                         echo "Building release candidate artifacts..."
                         echo "Version: ${params.RELEASE_VERSION}"
-                        echo "RC: ${params.RELEASE_CANDIDATE_VERSION}"
+                        echo "RC: ${params.TAG_NAME}"
 
                         // Build artifacts WITHOUT publishing (no --publish 
flag)
                         // The --rc flag creates artifacts for Apache SVN
                         sh """#!/bin/bash -el
-                        ./scripts/release/release-all.sh 
${params.RELEASE_VERSION} --rc --git-ref ${params.RELEASE_CANDIDATE_VERSION}
+                        ./scripts/release/release-all.sh 
${params.RELEASE_VERSION} --rc --git-ref ${params.TAG_NAME}
                         """
                     }
                 }
@@ -343,17 +341,17 @@ pipeline {
                     script {
                         echo "Publishing to Apache SVN staging repository..."
                         echo "Repository: 
${pipelineVars.asfReleaseStagingRepository}"
-                        echo "RC Version: ${params.RELEASE_CANDIDATE_VERSION}"
+                        echo "RC Version: ${params.TAG_NAME}"
                         
                         releaseUtils.publishArtifacts(
                             "${WORKSPACE}/kie-tools/release-artifacts",
                             "${pipelineVars.asfReleaseStagingRepository}",
-                            "${params.RELEASE_CANDIDATE_VERSION}",
+                            "${params.TAG_NAME}",
                             "${pipelineVars.asfReleaseSVNStagingCredentialsId}"
                         )
                         
                         echo "✅ Release candidate published to:"
-                        echo "   
${pipelineVars.asfReleaseStagingRepository}/${params.RELEASE_CANDIDATE_VERSION}/"
+                        echo "   
${pipelineVars.asfReleaseStagingRepository}/${params.TAG_NAME}/"
                     }
                 }
             }
@@ -366,10 +364,10 @@ pipeline {
             echo "✅ Release Candidate Created Successfully!"
             echo "=========================================="
             echo "Version: ${params.RELEASE_VERSION}"
-            echo "RC: ${params.RELEASE_CANDIDATE_VERSION}"
+            echo "RC: ${params.TAG_NAME}"
             echo ""
             echo "Artifacts published to:"
-            echo 
"${pipelineVars.asfReleaseStagingRepository}/${params.RELEASE_CANDIDATE_VERSION}/"
+            echo 
"${pipelineVars.asfReleaseStagingRepository}/${params.TAG_NAME}/"
             echo ""
             echo "Next steps:"
             echo "1. Start a vote thread on [email protected]"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to