From db9e83ff536edff27b1b31bdc5bb92af7d93a4c7 Mon Sep 17 00:00:00 2001 From: radtriste Date: Fri, 8 Sep 2023 15:24:50 +0200 Subject: [PATCH 1/2] Update pipelines --- .ci/jenkins/Jenkinsfile | 44 ++++++++++++++++++++ .ci/jenkins/Jenkinsfile.deploy | 23 +++------- .ci/jenkins/Jenkinsfile.promote | 16 ++----- .ci/jenkins/Jenkinsfile.setup-branch | 19 ++------- .ci/jenkins/Jenkinsfile.turtle | 13 ++---- .ci/jenkins/dsl/jobs.groovy | 12 +++--- .ci/jenkins/project/Jenkinsfile.drools | 13 ++---- .ci/jenkins/project/Jenkinsfile.nightly | 6 --- .ci/jenkins/project/Jenkinsfile.post-release | 28 ++----------- .ci/jenkins/project/Jenkinsfile.release | 6 --- .ci/jenkins/project/Jenkinsfile.setup-branch | 7 ---- 11 files changed, 75 insertions(+), 112 deletions(-) create mode 100644 .ci/jenkins/Jenkinsfile diff --git a/.ci/jenkins/Jenkinsfile b/.ci/jenkins/Jenkinsfile new file mode 100644 index 00000000000..bd14a10ad77 --- /dev/null +++ b/.ci/jenkins/Jenkinsfile @@ -0,0 +1,44 @@ +@Library('jenkins-pipeline-shared-libraries')_ + +pr_check_script = null + +pipeline { + agent { + label 'ubuntu' + } + options { + timestamps() + timeout(time: '720', unit: 'MINUTES') + } + environment { + BUILDCHAIN_PROJECT = 'kiegroup/optaplanner' + BUILDCHAIN_CONFIG_REPO = 'optaplanner' + BUILDCHAIN_CONFIG_FILE_PATH = '.ci/buildchain-config.yaml' + + ENABLE_SONARCLOUD = 'true' + SONARCLOUD_ANALYSIS_MVN_OPTS = '-Dsonar.projectKey=org.optaplanner:optaplanner' + OPTAPLANNER_BUILD_MVN_OPTS = '-Prun-code-coverage' + } + stages { + stage('Initialize') { + steps { + script { + // load `pr_check.groovy` file from kogito-pipelines:main + dir('kogito-pipelines') { + checkout(githubscm.resolveRepository('kogito-pipelines', 'kiegroup', 'apache_migration', false, 'kie-ci')) // TODO to change back to kiegroup:main + pr_check_script = load 'dsl/scripts/pr_check.groovy' + } + } + } + } + stage('PR check') { + steps { + script { + dir('kogito-pipelines') { + pr_check_script.launch() + } + } + } + } + } +} diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 3b0d4662c8c..f7e98f36944 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -14,12 +14,10 @@ imageUtils = null pipeline { agent { - label 'ubuntu' - } - - tools { - maven env.BUILD_MAVEN_TOOL - jdk env.BUILD_JDK_TOOL + docker { + image env.AGENT_DOCKER_BUILDER_IMAGE + args env.AGENT_DOCKER_BUILDER_ARGS + } } options { @@ -28,21 +26,13 @@ pipeline { disableConcurrentBuilds(abortPrevious: true) } - // parameters { - // For parameters, check into .jenkins/dsl/jobs.groovy file - // } - environment { - // Some generated env is also defined into .jenkins/dsl/jobs.groovy file - OPTAPLANNER_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}") - MAVEN_OPTS = '-Xms1024m -Xmx4g' - PR_BRANCH_HASH = "${util.generateHash(10)}" // Maven configuration - MAVEN_DEPLOY_LOCAL_DIR = "${WORKSPACE}/maven_deploy_dir" + MAVEN_DEPLOY_LOCAL_DIR = "/tmp/maven_deploy_dir" } stages { @@ -197,9 +187,6 @@ pipeline { when { expression { return shouldStageArtifacts() } } - tools { - jdk 'kie-jdk11' - } steps { script { // Stage release artifacts diff --git a/.ci/jenkins/Jenkinsfile.promote b/.ci/jenkins/Jenkinsfile.promote index f4fa50479c1..cf6651d7dfa 100644 --- a/.ci/jenkins/Jenkinsfile.promote +++ b/.ci/jenkins/Jenkinsfile.promote @@ -13,12 +13,10 @@ imageUtils = null pipeline { agent { - label 'ubuntu' - } - - tools { - maven env.BUILD_MAVEN_TOOL - jdk env.BUILD_JDK_TOOL + docker { + image env.AGENT_DOCKER_BUILDER_IMAGE + args env.AGENT_DOCKER_BUILDER_ARGS + } } options { @@ -27,13 +25,7 @@ pipeline { disableConcurrentBuilds(abortPrevious: true) } - // parameters { - // For parameters, check into .jenkins/dsl/jobs.groovy file - // } - environment { - // Some generated env is also defined into .jenkins/dsl/jobs.groovy file - OPTAPLANNER_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}") PR_BRANCH_HASH = "${util.generateHash(10)}" diff --git a/.ci/jenkins/Jenkinsfile.setup-branch b/.ci/jenkins/Jenkinsfile.setup-branch index 1d7395898a4..196f687fbc5 100644 --- a/.ci/jenkins/Jenkinsfile.setup-branch +++ b/.ci/jenkins/Jenkinsfile.setup-branch @@ -5,12 +5,10 @@ import org.kie.jenkins.MavenCommand pipeline { agent { - label 'ubuntu' - } - - tools { - maven env.BUILD_MAVEN_TOOL - jdk env.BUILD_JDK_TOOL + docker { + image env.AGENT_DOCKER_BUILDER_IMAGE + args env.AGENT_DOCKER_BUILDER_ARGS + } } options { @@ -18,18 +16,9 @@ pipeline { timeout(time: 60, unit: 'MINUTES') } - // parameters { - // For parameters, check into ./dsl/jobs.groovy file - // } - environment { - // Static env is defined into ./dsl/jobs.groovy file - OPTAPLANNER_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}") - // Keep here for visitibility - MAVEN_OPTS = '-Xms1024m -Xmx4g' - BRANCH_HASH = "${util.generateHash(10)}" } diff --git a/.ci/jenkins/Jenkinsfile.turtle b/.ci/jenkins/Jenkinsfile.turtle index 8e6566cefa0..598a677abe9 100644 --- a/.ci/jenkins/Jenkinsfile.turtle +++ b/.ci/jenkins/Jenkinsfile.turtle @@ -6,22 +6,17 @@ optaplannerRepo = 'optaplanner' pipeline { agent { - label 'ubuntu' - } - tools { - maven env.BUILD_MAVEN_TOOL - jdk env.BUILD_JDK_TOOL + docker { + image env.AGENT_DOCKER_BUILDER_IMAGE + args env.AGENT_DOCKER_BUILDER_ARGS + } } options { timestamps() timeout(time: 3, unit: 'DAYS') // Turtle tests take ~2 days to complete. disableConcurrentBuilds(abortPrevious: true) } - // parameters { - // For parameters, check the .jenkins/dsl/jobs.groovy file. - // } environment { - MAVEN_OPTS = '-Xms1024m -Xmx4g' // Contains the email address of the team's Zulip channel. OPTAPLANNER_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}") } diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 44cb9647399..3fd7968a24e 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -47,7 +47,7 @@ KogitoJobUtils.createMainQuarkusUpdateToolsJob(this, void setupProjectDroolsJob(String droolsBranch) { def jobParams = JobParamsUtils.getBasicJobParamsWithEnv(this, 'optaplanner-drools-snapshot', JobType.NIGHTLY, 'ecosystem', "${jenkins_path_project}/Jenkinsfile.drools", 'Optaplanner testing against Drools snapshot') - JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams) + JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) jobParams.triggers = [ cron : 'H 2 * * *' ] jobParams.env.putAll([ JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", @@ -130,7 +130,7 @@ void setupProjectReleaseJob() { void setupProjectPostReleaseJob() { def jobParams = JobParamsUtils.getBasicJobParams(this, 'optaplanner-post-release', JobType.RELEASE, "${jenkins_path_project}/Jenkinsfile.post-release", 'Optaplanner Post Release') - JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams) + JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) jobParams.env.putAll([ JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", @@ -234,7 +234,7 @@ void setupSpecificBuildChainNightlyJob(String envName) { void createSetupBranchJob() { def jobParams = JobParamsUtils.getBasicJobParams(this, 'optaplanner', JobType.SETUP_BRANCH, "${jenkins_path}/Jenkinsfile.setup-branch", 'OptaPlanner Setup Branch') - JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams) + JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) jobParams.env.putAll([ REPO_NAME: 'optaplanner', JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", @@ -262,7 +262,7 @@ void createSetupBranchJob() { void setupDeployJob(JobType jobType, String envName = '') { def jobParams = JobParamsUtils.getBasicJobParamsWithEnv(this, 'optaplanner-deploy', jobType, envName, "${jenkins_path}/Jenkinsfile.deploy", 'Optaplanner Deploy') - JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams) + JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) if (jobType == JobType.PULL_REQUEST) { jobParams.git.branch = '${BUILD_BRANCH_NAME}' jobParams.git.author = '${GIT_AUTHOR}' @@ -340,7 +340,7 @@ void setupDeployJob(JobType jobType, String envName = '') { void setupPromoteJob(JobType jobType) { def jobParams = JobParamsUtils.getBasicJobParams(this, 'optaplanner-promote', jobType, "${jenkins_path}/Jenkinsfile.promote", 'Optaplanner Promote') - JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams) + JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) jobParams.env.putAll([ JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", @@ -383,7 +383,7 @@ void setupPromoteJob(JobType jobType) { void setupOptaPlannerTurtleTestsJob(String constraintStreamImplType) { def jobParams = JobParamsUtils.getBasicJobParams(this, "optaplanner-turtle-tests-${constraintStreamImplType}", JobType.OTHER, "${jenkins_path}/Jenkinsfile.turtle", "Run OptaPlanner turtle tests with CS-${constraintStreamImplType} on a weekly basis.") - JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams) + JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) jobParams.env.putAll([ CONSTRAINT_STREAM_IMPL_TYPE: "${constraintStreamImplType}", JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}" diff --git a/.ci/jenkins/project/Jenkinsfile.drools b/.ci/jenkins/project/Jenkinsfile.drools index 60a097f0ec6..e3824c19b49 100644 --- a/.ci/jenkins/project/Jenkinsfile.drools +++ b/.ci/jenkins/project/Jenkinsfile.drools @@ -8,18 +8,13 @@ quickstartsRepo = 'optaplanner-quickstarts' pipeline { agent { - label 'ubuntu' + docker { + image env.AGENT_DOCKER_BUILDER_IMAGE + args env.AGENT_DOCKER_BUILDER_ARGS + } } environment { - // DROOLS_BRANCH should be defined directly into the job environment - OPTAPLANNER_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}") - - MAVEN_OPTS = '-Xms1024m -Xmx4g' - } - tools { - maven env.BUILD_MAVEN_TOOL - jdk env.BUILD_JDK_TOOL } options { timestamps() diff --git a/.ci/jenkins/project/Jenkinsfile.nightly b/.ci/jenkins/project/Jenkinsfile.nightly index 0025e0a8863..baccc166117 100644 --- a/.ci/jenkins/project/Jenkinsfile.nightly +++ b/.ci/jenkins/project/Jenkinsfile.nightly @@ -26,13 +26,7 @@ pipeline { timeout(time: 1380, unit: 'MINUTES') } - // parameters { - // For parameters, check into ./dsl/jobs.groovy file - // } - environment { - // Some generated env is also defined into ./dsl/jobs.groovy file - OPTAPLANNER_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}") // Use branch name in nightly tag as we may have parallel main and release branch builds diff --git a/.ci/jenkins/project/Jenkinsfile.post-release b/.ci/jenkins/project/Jenkinsfile.post-release index 880a3e18de9..b0edb0cc47d 100644 --- a/.ci/jenkins/project/Jenkinsfile.post-release +++ b/.ci/jenkins/project/Jenkinsfile.post-release @@ -10,12 +10,10 @@ String stableBranchName = 'stable' pipeline { agent { - label 'ubuntu' - } - - tools { - maven env.BUILD_MAVEN_TOOL - jdk env.BUILD_JDK_TOOL + docker { + image env.AGENT_DOCKER_BUILDER_IMAGE + args env.AGENT_DOCKER_BUILDER_ARGS + } } options { @@ -24,13 +22,7 @@ pipeline { disableConcurrentBuilds(abortPrevious: true) } - // parameters { - // For parameters, check into .jenkins/dsl/jobs.groovy file - // } - environment { - // Some generated env is also defined into .jenkins/dsl/jobs.groovy file - OPTAPLANNER_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}") PR_BRANCH_HASH = "${util.generateHash(10)}" @@ -48,10 +40,7 @@ pipeline { // Verify version is set and if on right release branch assert getProjectVersion() - assert getBuildBranch() == util.getReleaseBranchFromVersion(getProjectVersion()) - - installGithubCLI() } } } @@ -232,15 +221,6 @@ void commitAndForcePushBranch(String repo, String branch) { } } -void installGithubCLI() { - sh """ - wget https://github.com/cli/cli/releases/download/v${env.GITHUB_CLI_VERSION}/gh_${env.GITHUB_CLI_VERSION}_linux_amd64.tar.gz - tar xzf gh_${env.GITHUB_CLI_VERSION}_linux_amd64.tar.gz - mv gh_${env.GITHUB_CLI_VERSION}_linux_amd64/bin/gh . - rm -r gh_${env.GITHUB_CLI_VERSION}_linux_amd64* - """ -} - void uploadDistribution(String directory) { if (isNotTestingBuild()) { echo "uploadDistribution for ${directory}" diff --git a/.ci/jenkins/project/Jenkinsfile.release b/.ci/jenkins/project/Jenkinsfile.release index 6f2ffb845cc..7d76f8639ed 100644 --- a/.ci/jenkins/project/Jenkinsfile.release +++ b/.ci/jenkins/project/Jenkinsfile.release @@ -21,13 +21,7 @@ pipeline { label 'ubuntu' } - // parameters { - // For parameters, check into ./dsl/jobs.groovy file - // } - environment { - // Some generated env is also defined into ./dsl/jobs.groovy file - CI_EMAIL = credentials("${JENKINS_EMAIL_CREDS_ID}") } diff --git a/.ci/jenkins/project/Jenkinsfile.setup-branch b/.ci/jenkins/project/Jenkinsfile.setup-branch index bfa1a3da021..11d417b8350 100644 --- a/.ci/jenkins/project/Jenkinsfile.setup-branch +++ b/.ci/jenkins/project/Jenkinsfile.setup-branch @@ -10,7 +10,6 @@ JOBS = [:] FAILED_STAGES = [:] UNSTABLE_STAGES = [:] -// Should be multibranch pipeline pipeline { agent { label 'ubuntu' @@ -20,13 +19,7 @@ pipeline { timeout(time: 360, unit: 'MINUTES') } - // parameters { - // For parameters, check into ./dsl/jobs.groovy file - // } - environment { - // Some generated env is also defined into ./dsl/jobs.groovy file - OPTAPLANNER_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}") // Use branch name in nightly tag as we may have parallel main and release branch builds From 703b27248fe84814ed77af6c658a71f8e4fdf3c8 Mon Sep 17 00:00:00 2001 From: radtriste Date: Fri, 8 Sep 2023 16:18:44 +0200 Subject: [PATCH 2/2] Update kiegroup repository references to apache --- .ci/buildchain-config.yaml | 4 ++-- .ci/buildchain-project-dependencies.yaml | 6 +++--- .ci/environments/common/update_quarkus.sh | 2 +- .ci/jenkins/Jenkinsfile | 4 ++-- .ci/jenkins/Jenkinsfile.deploy | 8 ++++---- .ci/jenkins/Jenkinsfile.promote | 2 +- .ci/jenkins/config/branch.yaml | 8 +++++--- .ci/jenkins/config/main.yaml | 6 +++--- .ci/jenkins/dsl/jobs.groovy | 4 ++-- .ci/jenkins/dsl/test.sh | 4 ++-- .ci/jenkins/project/Jenkinsfile.drools | 2 +- .ci/jenkins/project/Jenkinsfile.post-release | 2 +- .ci/jenkins/project/Jenkinsfile.release | 4 ++-- .github/pull_request_template.md | 6 +++--- .github/workflows/full-downstream.yml | 2 +- .github/workflows/generate_status_page.yaml | 4 ++-- .github/workflows/generate_status_page_data.yaml | 6 +++--- .github/workflows/jenkins-tests-PR.yml | 4 ++-- .github/workflows/pull_request.yml | 4 ++-- 19 files changed, 42 insertions(+), 40 deletions(-) diff --git a/.ci/buildchain-config.yaml b/.ci/buildchain-config.yaml index 7de9ecc2901..65f1c86b477 100644 --- a/.ci/buildchain-config.yaml +++ b/.ci/buildchain-config.yaml @@ -25,7 +25,7 @@ default: docker system prune -f build: - - project: kiegroup/optaplanner + - project: apache/optaplanner build-command: before: upstream: | @@ -35,7 +35,7 @@ build: upstream: | mvn clean install -Dquickly ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.OPTAPLANNER_BUILD_MVN_OPTS_UPSTREAM }} - - project: kiegroup/optaplanner-quickstarts + - project: apache/optaplanner-quickstarts build-command: current: | mvn clean install ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.OPTAPLANNER_QUICKSTARTS_BUILD_MVN_OPTS }} diff --git a/.ci/buildchain-project-dependencies.yaml b/.ci/buildchain-project-dependencies.yaml index f4c6113d2a2..a54bec35e88 100644 --- a/.ci/buildchain-project-dependencies.yaml +++ b/.ci/buildchain-project-dependencies.yaml @@ -1,9 +1,9 @@ version: "2.1" dependencies: - - project: kiegroup/optaplanner - - project: kiegroup/optaplanner-quickstarts + - project: apache/optaplanner + - project: apache/optaplanner-quickstarts dependencies: - - project: kiegroup/optaplanner + - project: apache/optaplanner mapping: dependencies: default: diff --git a/.ci/environments/common/update_quarkus.sh b/.ci/environments/common/update_quarkus.sh index a78863f4ee1..596840d7f86 100755 --- a/.ci/environments/common/update_quarkus.sh +++ b/.ci/environments/common/update_quarkus.sh @@ -3,7 +3,7 @@ set -euo pipefail mvn_cmd="mvn ${BUILD_MVN_OPTS:-} ${BUILD_MVN_OPTS_QUARKUS_UPDATE:-}" -source <(curl -s https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/dsl/seed/scripts/install_quarkus.sh) +source <(curl -s https://raw.githubusercontent.com/apache/kogito-pipelines/main/dsl/seed/scripts/install_quarkus.sh) echo "Update project with Quarkus version ${QUARKUS_VERSION}" diff --git a/.ci/jenkins/Jenkinsfile b/.ci/jenkins/Jenkinsfile index bd14a10ad77..c4d40805dcf 100644 --- a/.ci/jenkins/Jenkinsfile +++ b/.ci/jenkins/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { timeout(time: '720', unit: 'MINUTES') } environment { - BUILDCHAIN_PROJECT = 'kiegroup/optaplanner' + BUILDCHAIN_PROJECT = 'apache/optaplanner' BUILDCHAIN_CONFIG_REPO = 'optaplanner' BUILDCHAIN_CONFIG_FILE_PATH = '.ci/buildchain-config.yaml' @@ -25,7 +25,7 @@ pipeline { script { // load `pr_check.groovy` file from kogito-pipelines:main dir('kogito-pipelines') { - checkout(githubscm.resolveRepository('kogito-pipelines', 'kiegroup', 'apache_migration', false, 'kie-ci')) // TODO to change back to kiegroup:main + checkout(githubscm.resolveRepository('kogito-pipelines', 'apache', 'main', false, 'ASF_Cloudbees_Jenkins_ci-builds')) pr_check_script = load 'dsl/scripts/pr_check.groovy' } } diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index f7e98f36944..a424d855356 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -307,7 +307,7 @@ void checkoutRepo(String repo, String dirName = repo) { dir(dirName) { deleteDir() if (params.PR_TARGET_BRANCH) { - githubscm.checkoutIfExists(repo, getGitAuthor(), getBuildBranch(), 'kiegroup', getFallbackBranch(repo), true) + githubscm.checkoutIfExists(repo, getGitAuthor(), getBuildBranch(), 'apache', getFallbackBranch(repo), true) } else { checkout(githubscm.resolveRepository(repo, getGitAuthor(), getBuildBranch(), false)) } @@ -318,7 +318,7 @@ void checkoutQuickstarts(String dirName = quickstartsRepository) { dir(dirName) { deleteDir() if (params.PR_TARGET_BRANCH) { - githubscm.checkoutIfExists(quickstartsRepository, getGitAuthor(), getBuildBranch(), 'kiegroup', getQuickStartsBranch(), true) + githubscm.checkoutIfExists(quickstartsRepository, getGitAuthor(), getBuildBranch(), 'apache', getQuickStartsBranch(), true) } else { checkout(githubscm.resolveRepository(quickstartsRepository, getGitAuthor(), getQuickStartsBranch(), false)) } @@ -326,7 +326,7 @@ void checkoutQuickstarts(String dirName = quickstartsRepository) { } String getFallbackBranch(String repo) { - def repositoryScm = githubscm.getRepositoryScm(repo, 'kiegroup', params.PR_TARGET_BRANCH) + def repositoryScm = githubscm.getRepositoryScm(repo, 'apache', params.PR_TARGET_BRANCH) return repositoryScm ? params.PR_TARGET_BRANCH : 'main' } @@ -439,7 +439,7 @@ boolean shouldDeployToRepository() { } boolean isNotTestingBuild() { - return getGitAuthor() == 'kiegroup' + return getGitAuthor() == 'apache' } boolean isRelease() { diff --git a/.ci/jenkins/Jenkinsfile.promote b/.ci/jenkins/Jenkinsfile.promote index cf6651d7dfa..1650f97a068 100644 --- a/.ci/jenkins/Jenkinsfile.promote +++ b/.ci/jenkins/Jenkinsfile.promote @@ -173,7 +173,7 @@ String getParamOrDeployProperty(String paramKey, String deployPropertyKey) { ////////////////////////////////////////////////////////////////////////////// boolean isNotTestingBuild() { - return getGitAuthor() == 'kiegroup' + return getGitAuthor() == 'apache' } String getProjectVersion() { diff --git a/.ci/jenkins/config/branch.yaml b/.ci/jenkins/config/branch.yaml index 413e6d94a61..50201a8a83c 100644 --- a/.ci/jenkins/config/branch.yaml +++ b/.ci/jenkins/config/branch.yaml @@ -32,9 +32,11 @@ repositories: name: radtriste # TODO set back. Could not push to kiegroup git: author: - name: kiegroup - credentials_id: kie-ci5 - token_credentials_id: kie-ci5-token + name: apache + # Taken from https://ci-builds.apache.org/credentials/ + # Need to be verified + credentials_id: 399061d0-5ab5-4142-a186-a52081fef742 + token_credentials_id: ci-builds fork_author: name: kie-ci credentials_id: kie-ci diff --git a/.ci/jenkins/config/main.yaml b/.ci/jenkins/config/main.yaml index 749c71f3c5d..c2bd171b93a 100644 --- a/.ci/jenkins/config/main.yaml +++ b/.ci/jenkins/config/main.yaml @@ -10,16 +10,16 @@ ecosystem: - kie-benchmarks.* git: branches: - - name: apache_migration + - name: main main_branch: true seed: config_file: git: repository: optaplanner author: - name: kiegroup + name: apache credentials_id: kie-ci5 - branch: apache_migration + branch: main path: .ci/jenkins/config/branch.yaml jenkins: email_creds_id: KOGITO_CI_NOTIFICATION_EMAILS diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 3fd7968a24e..b066d8a5960 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -2,10 +2,10 @@ * This file is describing all the Jenkins jobs in the DSL format (see https://plugins.jenkins.io/job-dsl/) * needed by the Kogito pipelines. * -* The main part of Jenkins job generation is defined into the https://github.com/kiegroup/kogito-pipelines repository. +* The main part of Jenkins job generation is defined into the https://github.com/apache/kogito-pipelines repository. * * This file is making use of shared libraries defined in -* https://github.com/kiegroup/kogito-pipelines/tree/main/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl. +* https://github.com/apache/kogito-pipelines/tree/main/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl. */ import org.kie.jenkins.jobdsl.model.JenkinsFolder diff --git a/.ci/jenkins/dsl/test.sh b/.ci/jenkins/dsl/test.sh index 1dd3b10fe1f..05cc5e16063 100755 --- a/.ci/jenkins/dsl/test.sh +++ b/.ci/jenkins/dsl/test.sh @@ -23,12 +23,12 @@ fi git_author="$(echo ${git_url} | awk -F"${git_server_url}" '{print $2}' | awk -F. '{print $1}' | awk -F/ '{print $1}')" export DSL_DEFAULT_MAIN_CONFIG_FILE_REPO="${git_author}"/optaplanner -export DSL_DEFAULT_FALLBACK_MAIN_CONFIG_FILE_REPO=kiegroup/optaplanner +export DSL_DEFAULT_FALLBACK_MAIN_CONFIG_FILE_REPO=apache/optaplanner export DSL_DEFAULT_MAIN_CONFIG_FILE_PATH=.ci/jenkins/config/main.yaml export DSL_DEFAULT_BRANCH_CONFIG_FILE_REPO="${git_author}"/optaplanner file=$(mktemp) # For more usage of the script, use ./test.sh -h -curl -o ${file} https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/dsl/seed/scripts/seed_test.sh +curl -o ${file} https://raw.githubusercontent.com/apache/kogito-pipelines/main/dsl/seed/scripts/seed_test.sh chmod u+x ${file} ${file} $@ \ No newline at end of file diff --git a/.ci/jenkins/project/Jenkinsfile.drools b/.ci/jenkins/project/Jenkinsfile.drools index e3824c19b49..a9c7f5fd5b4 100644 --- a/.ci/jenkins/project/Jenkinsfile.drools +++ b/.ci/jenkins/project/Jenkinsfile.drools @@ -140,7 +140,7 @@ void checkoutOptaplannerQuickstartsRepo() { void checkoutDroolsRepo() { dir(droolsRepo) { - checkout(githubscm.resolveRepository(droolsRepo, 'kiegroup', getDroolsBranch(), false)) + checkout(githubscm.resolveRepository(droolsRepo, 'apache', getDroolsBranch(), false)) } } diff --git a/.ci/jenkins/project/Jenkinsfile.post-release b/.ci/jenkins/project/Jenkinsfile.post-release index b0edb0cc47d..bde6c8c5c17 100644 --- a/.ci/jenkins/project/Jenkinsfile.post-release +++ b/.ci/jenkins/project/Jenkinsfile.post-release @@ -139,7 +139,7 @@ void sendErrorNotification() { ////////////////////////////////////////////////////////////////////////////// boolean isNotTestingBuild() { - return getGitAuthor() == 'kiegroup' + return getGitAuthor() == 'apache' } String getProjectVersion() { diff --git a/.ci/jenkins/project/Jenkinsfile.release b/.ci/jenkins/project/Jenkinsfile.release index 7d76f8639ed..50b036cb0a3 100644 --- a/.ci/jenkins/project/Jenkinsfile.release +++ b/.ci/jenkins/project/Jenkinsfile.release @@ -42,8 +42,8 @@ pipeline { sendNotification("Release Pipeline has started...\nOptaplanner version = ${getOptaPlannerVersion()}\n=> ${env.BUILD_URL}") // Safety measure to not publish to main JBoss - if (getGitAuthor() != 'kiegroup' && !getArtifactsRepositoryParam()) { - sendNotification("Git Author is different from `kiegroup` and no `ARTIFACTS_REPOSITORY` parameter has been provided. Are you sure you want to continue ? => ${env.BUILD_URL}input") + if (getGitAuthor() != 'apache' && !getArtifactsRepositoryParam()) { + sendNotification("Git Author is different from `apache` and no `ARTIFACTS_REPOSITORY` parameter has been provided. Are you sure you want to continue ? => ${env.BUILD_URL}input") input message: 'Should the pipeline continue with no `ARTIFACTS_REPOSITORY` defined ?', ok: 'Yes' } } diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b76b3608fa5..56a2b8908f1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -13,11 +13,11 @@ a section if that type of information is not available. ### Referenced pull requests +changes that span multiple apache repositories and depend on each other. --> diff --git a/.github/workflows/full-downstream.yml b/.github/workflows/full-downstream.yml index edb2bc13f15..f6189555d48 100644 --- a/.github/workflows/full-downstream.yml +++ b/.github/workflows/full-downstream.yml @@ -43,7 +43,7 @@ jobs: - name: Build Chain uses: kiegroup/kie-ci/.ci/actions/build-chain@main with: - definition-file: https://raw.githubusercontent.com/${GROUP:kiegroup}/optaplanner/${BRANCH:main}/.ci/buildchain-config.yaml + definition-file: https://raw.githubusercontent.com/${GROUP:apache}/optaplanner/${BRANCH:main}/.ci/buildchain-config.yaml annotations-prefix: ${{ runner.os }}-${{ matrix.java-version }}/${{ matrix.maven-version }} github-token: "${{ secrets.GITHUB_TOKEN }}" flow-type: full-downstream diff --git a/.github/workflows/generate_status_page.yaml b/.github/workflows/generate_status_page.yaml index 041fbdd694f..be314052f38 100644 --- a/.github/workflows/generate_status_page.yaml +++ b/.github/workflows/generate_status_page.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch jobs: generate-status-page: - if: github.repository == 'kiegroup/optaplanner' + if: github.repository == 'apache/optaplanner' concurrency: group: generate-status-page cancel-in-progress: true @@ -18,6 +18,6 @@ jobs: - name: Generate status page uses: kiegroup/chain-status/.ci/actions/generate-app@main with: - info-md-url: "https://raw.githubusercontent.com/kiegroup/optaplanner/main/.ci/chain-status-info.md" + info-md-url: "https://raw.githubusercontent.com/apache/optaplanner/main/.ci/chain-status-info.md" github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/generate_status_page_data.yaml b/.github/workflows/generate_status_page_data.yaml index 65aeb72291d..bfd1a974317 100644 --- a/.github/workflows/generate_status_page_data.yaml +++ b/.github/workflows/generate_status_page_data.yaml @@ -6,7 +6,7 @@ on: - cron: '0 * * * *' jobs: generate-status-page-data: - if: github.repository == 'kiegroup/optaplanner' + if: github.repository == 'apache/optaplanner' concurrency: group: generate-status-page-data cancel-in-progress: true @@ -20,11 +20,11 @@ jobs: - name: Generate status page data uses: kiegroup/chain-status/.ci/actions/generate-data@main with: - definition-file: https://raw.githubusercontent.com/kiegroup/optaplanner/main/.ci/builchain-config.yaml + definition-file: https://raw.githubusercontent.com/apache/optaplanner/main/.ci/builchain-config.yaml title: Pull Request Status subtitle: OptaPlanner organization repositories CI Status base-branch-filter: main,8\.* - project-filter: kiegroup/opta.*$ + project-filter: apache/opta.*$ created-by: GitHub Action created-url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/jenkins-tests-PR.yml b/.github/workflows/jenkins-tests-PR.yml index 09ff92f65c2..644bfeff006 100644 --- a/.github/workflows/jenkins-tests-PR.yml +++ b/.github/workflows/jenkins-tests-PR.yml @@ -20,6 +20,6 @@ jobs: uses: kiegroup/kie-ci/.ci/actions/dsl-tests@main with: project: optaplanner - main-config-file-repo: kiegroup/optaplanner + main-config-file-repo: apache/optaplanner main-config-file-path: .ci/jenkins/config/main.yaml - branch-config-file-repo: kiegroup/optaplanner + branch-config-file-repo: apache/optaplanner diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index c64e99628fb..20e193046ff 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -59,9 +59,9 @@ jobs: # maven-assembly-plugin occasionally fails on heap space when building the ZIP in optaplanner-docs MAVEN_OPTS: "-Xmx2048m" with: - definition-file: https://raw.githubusercontent.com/${GROUP:kiegroup}/optaplanner/${BRANCH:main}/.ci/buildchain-config.yaml + definition-file: https://raw.githubusercontent.com/${GROUP:apache}/optaplanner/${BRANCH:main}/.ci/buildchain-config.yaml annotations-prefix: ${{ runner.os }}-${{ matrix.java-version }}/${{ matrix.maven-version }} - starting-project: kiegroup/optaplanner + starting-project: apache/optaplanner flow-type: ${{ env.FLOW_TYPE }} github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Surefire Report