From 7067210718f7055e846aafdce20cfd4f5bf1b40d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Novotn=C3=BD?= Date: Thu, 1 Feb 2024 16:30:38 +0100 Subject: [PATCH] cleaned Quarkus 3 jobs and configs --- .ci/jenkins/Jenkinsfile.quarkus-3.rewrite.pr | 99 ---------- .../Jenkinsfile.quarkus-3.rewrite.standalone | 178 ------------------ .ci/jenkins/dsl/jobs.groovy | 45 +---- .github/dependabot.yml | 9 - .github/pull_request_template.md | 31 +-- .../workflows/nightly-quarkus-ecosystem.yaml | 2 +- 6 files changed, 4 insertions(+), 360 deletions(-) delete mode 100644 .ci/jenkins/Jenkinsfile.quarkus-3.rewrite.pr delete mode 100644 .ci/jenkins/Jenkinsfile.quarkus-3.rewrite.standalone diff --git a/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.pr b/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.pr deleted file mode 100644 index 7b3691f9d83..00000000000 --- a/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.pr +++ /dev/null @@ -1,99 +0,0 @@ -@Library('jenkins-pipeline-shared-libraries')_ - -import org.kie.jenkins.MavenCommand - -changeAuthor = env.ghprbAuthorRepoGitUrl ? util.getGroup(env.ghprbAuthorRepoGitUrl) : (env.ghprbPullAuthorLogin ?: CHANGE_AUTHOR) -changeBranch = env.ghprbSourceBranch ?: CHANGE_BRANCH -changeTarget = env.ghprbTargetBranch ?: CHANGE_TARGET - -pipeline { - agent { - label 'kie-rhel8 && kie-mem16g && !built-in' - } - tools { - maven env.BUILD_MAVEN_TOOL - jdk env.BUILD_JDK_TOOL - } - options { - timestamps() - timeout(time: 180, unit: 'MINUTES') - } - stages { - stage('Initialization') { - steps { - script { - cleanWs() - - sh 'printenv > env_props' - archiveArtifacts artifacts: 'env_props' - - dir(getRepoName()) { - checkout(githubscm.resolveRepository(getRepoName(), changeAuthor, changeBranch, false)) - // need to manually checkout branch since on a detached branch after checkout command - sh "git checkout ${changeBranch}" - } - } - } - } - stage('Build Drools') { - steps { - script { - dir('drools') { - githubscm.checkoutIfExists('drools', changeAuthor, changeBranch, 'kiegroup', changeTarget, true) - util.runWithPythonVirtualEnv('.ci/environments/update.sh quarkus-3', 'swf') - util.runWithPythonVirtualEnv(getMavenCommand().withProperty('quickly').getFullRunCommand('clean install'), 'swf') - } - } - } - } - stage('Generate rewrite patch') { - steps { - script { - dir(getRepoName()) { - configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) { - env.BUILD_MVN_OPTS = "${env.BUILD_MVN_OPTS ?: ''} -s ${MAVEN_SETTINGS_FILE} -Dmaven.wagon.http.ssl.insecure=true -Dmaven.test.failure.ignore=true" - echo "BUILD_MVN_OPTS = ${BUILD_MVN_OPTS}" - - util.runWithPythonVirtualEnv('.ci/environments/quarkus-3/before.sh rewrite', 'swf') - } - } - } - } - } - stage('Push changes') { - steps { - script { - dir(getRepoName()) { - githubscm.pushObject('origin', changeBranch, getGitAuthorCredsId()) - } - } - } - } - } - post { - always { - script { - cleanWs() - } - } - unsuccessful { - script { - pullrequest.postComment(util.getMarkdownTestSummary('Rewrite quarkus-3 before.sh patch file', '', "${BUILD_URL}", 'GITHUB')) - } - } - } -} - -String getRepoName() { - return env.REPO_NAME -} - -String getGitAuthorCredsId() { - return env.AUTHOR_CREDS_ID -} - -MavenCommand getMavenCommand() { - return new MavenCommand(this, ['-fae', '-ntp']) - .withSettingsXmlId(env.MAVEN_SETTINGS_CONFIG_FILE_ID) - .withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : []) -} diff --git a/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.standalone b/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.standalone deleted file mode 100644 index 33aae1e1d43..00000000000 --- a/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.standalone +++ /dev/null @@ -1,178 +0,0 @@ -import org.jenkinsci.plugins.workflow.libs.Library -@Library('jenkins-pipeline-shared-libraries')_ - -import org.kie.jenkins.MavenCommand - -previousHash = '' - -pipeline { - agent { - label 'kie-rhel8 && kie-mem16g && !built-in' - } - - tools { - maven env.BUILD_MAVEN_TOOL - jdk env.BUILD_JDK_TOOL - } - - options { - timestamps() - timeout(time: 180, unit: 'MINUTES') - } - - environment { - KOGITO_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}") - - PR_BRANCH_HASH = "${util.generateHash(10)}" - } - - stages { - stage('Initialize') { - steps { - script { - clean() - - if (params.DISPLAY_NAME) { - currentBuild.displayName = params.DISPLAY_NAME - } - dir(getRepoName()) { - checkoutRepo(getRepoName(), getBuildBranch()) - } - } - } - } - stage('Prepare for PR') { - when { - expression { !isPRSourceBranch() } - } - steps { - script { - dir(getRepoName()) { - githubscm.createBranch(getPRBranch()) - previousHash = githubscm.getCommitHash() - } - } - } - } - stage('Build Drools') { - steps { - script { - dir('drools') { - githubscm.checkoutIfExists('drools', getGitAuthor(), getBuildBranch(), getBaseAuthor(), getBaseBranch(), true) - util.runWithPythonVirtualEnv('.ci/environments/update.sh quarkus-3', 'swf') - util.runWithPythonVirtualEnv(getMavenCommand().withProperty('quickly').getFullRunCommand('clean install'), 'swf') - } - } - } - } - stage('Generate rewrite patch') { - steps { - script { - dir(getRepoName()) { - configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) { - env.BUILD_MVN_OPTS = "${env.BUILD_MVN_OPTS ?: ''} -s ${MAVEN_SETTINGS_FILE} -Dmaven.wagon.http.ssl.insecure=true -Dmaven.test.failure.ignore=true" - echo "BUILD_MVN_OPTS = ${BUILD_MVN_OPTS}" - - util.runWithPythonVirtualEnv('.ci/environments/quarkus-3/before.sh rewrite', 'swf') - } - } - } - } - stage('Push changes') { - steps { - script { - dir(getRepoName()) { - githubscm.pushObject('origin', isPRSourceBranch() ? getBuildBranch() : getPRBranch(), getGitAuthorCredsId()) - } - } - } - } - stage('Create PR') { - when { - expression { !isPRSourceBranch() } - } - steps { - script { - dir(getRepoName()) { - if (githubscm.getCommitHash() != previousHash) { - def prTitle = '[Quarkus 3 migration] Updated Openrewrite patch' - def prBody = "Please review and merge.\n\nGenerated by build ${BUILD_TAG}: ${BUILD_URL}." - prLink = githubscm.createPR(prTitle, prBody, getBuildBranch(), getGitAuthorCredsId()) - sendNotification("PR to update Quarkus 3 environment has been created.\nHere is the PR link: ${prLink}") - } - } - } - } - } - } - post { - unsuccessful { - sendErrorNotification() - } - cleanup { - script { - clean() - } - } - } -} - -void clean() { - sh 'rm -rf ~/.rewrite-cache/' - util.cleanNode('docker') -} - -void sendErrorNotification() { - mailer.sendMarkdownTestSummaryNotification('quarkus-3', "[${getBuildBranch()}] Kogito Runtimes", [env.KOGITO_CI_EMAIL_TO]) -} - -void sendNotification(String body) { - emailext body: "${body}", - subject: "[${getBuildBranch()}] Kogito Runtimes - quarkus-3", - to: env.KOGITO_CI_EMAIL_TO -} - -void checkoutRepo(String repository, String branch) { - checkout(githubscm.resolveRepository(repository, getGitAuthor(), branch, false)) - // need to manually checkout branch since on a detached branch after checkout command - sh "git checkout ${branch}" -} - -String getRepoName() { - return env.REPO_NAME -} - -String getGitAuthor() { - // GIT_AUTHOR can be env or param - return "${GIT_AUTHOR}" -} - -String getBuildBranch() { - return params.BUILD_BRANCH_NAME -} - -String getBaseAuthor() { - return env.BASE_AUTHOR -} - -String getBaseBranch() { - return env.BASE_BRANCH -} - -boolean isPRSourceBranch() { - return params.IS_PR_SOURCE_BRANCH -} - -String getGitAuthorCredsId() { - return env.AUTHOR_CREDS_ID -} - -String getPRBranch() { - return "${getBuildBranch()}-${env.PR_BRANCH_HASH}" -} - -MavenCommand getMavenCommand() { - return new MavenCommand(this, ['-fae', '-ntp']) - .withSettingsXmlId(env.MAVEN_SETTINGS_CONFIG_FILE_ID) - .withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : []) -} diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 1f1e319a6bd..2b6f3bd579e 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -107,8 +107,6 @@ setupSpecificBuildChainNightlyJob('sonarcloud', nightlyJobParamsGetter) setupSpecificBuildChainNightlyJob('native', nightlyJobParamsGetter) setupNightlyQuarkusIntegrationJob('quarkus-main', nightlyJobParamsGetter) setupNightlyQuarkusIntegrationJob('quarkus-branch', nightlyJobParamsGetter) -setupNightlyQuarkusIntegrationJob('quarkus-lts', nightlyJobParamsGetter) -setupNightlyQuarkusIntegrationJob('native-lts', nightlyJobParamsGetter) // Release jobs setupReleaseDeployJob() @@ -244,45 +242,4 @@ void setupReleasePromoteJob() { booleanParam('SEND_NOTIFICATION', false, 'In case you want the pipeline to send a notification on CI channel for this run.') } } -} - -void setupPrQuarkus3RewriteJob() { - def jobParams = JobParamsUtils.getBasicJobParamsWithEnv(this, 'kogito-runtimes.rewrite', JobType.PULL_REQUEST, 'quarkus-3', "${jenkins_path}/Jenkinsfile.quarkus-3.rewrite.pr", 'Kogito Runtimes Quarkus 3 rewrite patch regeneration') - JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams) - jobParams.jenkinsfile = "${jenkins_path}/Jenkinsfile.quarkus-3.rewrite.pr" - jobParams.pr.putAll([ - run_only_for_branches: [ "${GIT_BRANCH}" ], - disable_status_message_error: true, - disable_status_message_failure: true, - trigger_phrase: '.*[j|J]enkins,?.*(rewrite|write) [Q|q]uarkus-3.*', - trigger_phrase_only: true, - commitContext: 'Quarkus 3 rewrite', - ]) - jobParams.env.putAll([ - AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", - ]) - KogitoJobTemplate.createPRJob(this, jobParams) -} - -void setupStandaloneQuarkus3RewriteJob() { - def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-runtimes.quarkus-3.rewrite', JobType.TOOLS, "${jenkins_path}/Jenkinsfile.quarkus-3.rewrite.standalone", 'Kogito Runtimes Quarkus 3 rewrite patch regeneration') - jobParams.env.putAll(EnvUtils.getEnvironmentEnvVars(this, 'quarkus-3')) - JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams) - jobParams.env.putAll([ - AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", - JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - BASE_BRANCH: Utils.getGitBranch(this), - BASE_AUTHOR: Utils.getGitAuthor(this), - MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", - ]) - KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { - parameters { - stringParam('DISPLAY_NAME', '', 'Setup a specific build display name') - stringParam('GIT_AUTHOR', "${GIT_AUTHOR_NAME}", 'Set the Git author to checkout') - stringParam('BUILD_BRANCH_NAME', "${GIT_BRANCH}", 'Set the Git branch to checkout') - booleanParam('IS_PR_SOURCE_BRANCH', false, 'Set to true if you are launching the job for a PR source branch') - booleanParam('SEND_NOTIFICATION', false, 'In case you want the pipeline to send a notification on CI channel for this run.') - } - } -} +} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2dcf0d8f54f..935257cd38d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,14 +1,5 @@ version: 2 updates: -- package-ecosystem: maven - directory: "/" - schedule: - interval: daily - time: '03:00' - open-pull-requests-limit: 0 - target-branch: "main" - commit-message: - prefix: "[bot][main]" - package-ecosystem: maven directory: "/" schedule: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 8d9ffd4d835..a4745e07bde 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,4 +1,4 @@ -Many thanks for submitting your Pull Request :heart:! +This is MIDSTREAM if you want to send your PR to UPSTREAM use https://github.com/apache/incubator-kie-kogito-runtimes Please make sure that your PR meets the following requirements: @@ -52,10 +52,6 @@ How to retest this PR or trigger a specific build: Run checks against Quarkus lts branch Please add comment: Jenkins run quarkus-lts -- for a specific quarkus lts check - Run checks against Quarkus lts branch - Please add comment: Jenkins (re)run [kogito-runtimes|kogito-apps|kogito-examples] quarkus-lts - - for native checks Run native checks Please add comment: Jenkins run native @@ -64,13 +60,6 @@ How to retest this PR or trigger a specific build: Run native checks Please add comment: Jenkins (re)run [kogito-runtimes|kogito-apps|kogito-examples] native -- for native lts checks - Run native checks against quarkus lts branch - Please add comment: Jenkins run native-lts - -- for a specific native lts check - Run native checks against quarkus lts branch - Please add comment: Jenkins (re)run [kogito-runtimes|kogito-apps|kogito-examples] native-lts
@@ -87,20 +76,4 @@ Once the original pull request is successfully merged, the automated action will If something goes wrong, the author will be notified and at this point a manual backporting is needed. > **NOTE**: this automated backporting is triggered whenever a pull request on `main` branch is labeled or closed, but both conditions must be satisfied to get the new PR created. -
- -
- -Quarkus-3 PR check is failing ... what to do ? - -The Quarkus 3 check is applying patches from the `.ci/environments/quarkus-3/patches`. - -The first patch, called `0001_before_sh.patch`, is generated from Openrewrite `.ci/environments/quarkus-3/quarkus3.yml` recipe. The patch is created to speed up the check. But it may be that some changes in the PR broke this patch. -No panic, there is an easy way to regenerate it. You just need to comment on the PR: -``` -jenkins rewrite quarkus-3 -``` -and it should, after some minutes (~20/30min) apply a commit on the PR with the patch regenerated. - -Other patches were generated manually. If any of it fails, you will need to manually update it... and push your changes. -
+ \ No newline at end of file diff --git a/.github/workflows/nightly-quarkus-ecosystem.yaml b/.github/workflows/nightly-quarkus-ecosystem.yaml index 3b8f2b90b80..6bba3ac3103 100644 --- a/.github/workflows/nightly-quarkus-ecosystem.yaml +++ b/.github/workflows/nightly-quarkus-ecosystem.yaml @@ -9,7 +9,7 @@ on: env: ECOSYSTEM_CI_REPO: quarkusio/quarkus-ecosystem-ci ECOSYSTEM_CI_REPO_FILE: context.yaml - JAVA_VERSION: 11 + JAVA_VERSION: 17 ######################### # Repo specific setting #