From e50f260103567e8707fedab3511f29efccd6f7c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Fri, 17 Jul 2026 14:15:59 +0200 Subject: [PATCH 1/2] chore(pipeline): rollback prep archive --- Jenkinsfile | 110 +++++----------------------------------------------- 1 file changed, 10 insertions(+), 100 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9474b9f7d..dbc023686 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -83,20 +83,9 @@ final String[] limitedPluginSet = [ ] mavenEnv(jdk: 21) { - String prepArchiveName stage('init') { Map scmVars = checkout scm - // Ensure prep archive corresponds to the current state - commitId = scmVars.GIT_COMMIT.substring(0, 7) - prepArchiveName = "bom-prep-${commitId}.tar.gz" - if (fixedPrepArchiveName) { - echo "[WARNING] Using fixed prep archive name ${fixedPrepArchiveName} instead of ${prepArchiveName}" - prepArchiveName = fixedPrepArchiveName - } else { - echo "[INFO] Using prep archive name ${prepArchiveName}" - } - // Collect flags from marker files flags.each { name, sources -> if (fileExists(name)) { @@ -109,36 +98,18 @@ mavenEnv(jdk: 21) { }.join('\n') } - stage('retrieve prep archive') { - prepFoundInBuildNumber = retrieveArtifactsFromPreviousBuilds(prepArchiveName, env.JOB_NAME) - if (prepFoundInBuildNumber == 0) { - catchError(buildResult: 'SUCCESS', stageResult: 'NOT_BUILT') { error("[SKIP] ${prepArchiveName} not found") } - return - } - } - stage('prep') { - if (prepFoundInBuildNumber == 0) { - withChecks(name: 'Tests', includeStage: true) { - withEnv(['SAMPLE_PLUGIN_OPTS=-Dset.changelist']) { - sh ''' - mvn -v - bash prep.sh - ''' - if (junit(testResults: '**/target/surefire-reports/TEST-*.xml,**/target/failsafe-reports/TEST-*.xml').failCount > 0) { - error 'Some test failures during prep.sh, not going to continue' - } - // Publish incrementals before prep archive preparation to avoid dirty git status - infra.prepareToPublishIncrementals() - } - } - } else { - withEnv(["ARCHIVE_NAME=${prepArchiveName}"]) { + withChecks(name: 'Tests', includeStage: true) { + withEnv(['SAMPLE_PLUGIN_OPTS=-Dset.changelist']) { sh ''' - tar xzfv "${ARCHIVE_NAME}" - rm "${ARCHIVE_NAME}" + mvn -v + bash prep.sh ''' - echo "[INFO] ${prepArchiveName} retrieved and extracted, no need to run prep.sh" + if (junit(testResults: '**/target/surefire-reports/TEST-*.xml,**/target/failsafe-reports/TEST-*.xml').failCount > 0) { + error 'Some test failures during prep.sh, not going to continue' + } + // Publish incrementals before prep archive preparation to avoid dirty git status + infra.prepareToPublishIncrementals() } } } @@ -170,10 +141,7 @@ mavenEnv(jdk: 21) { echo "[INFO] ${allLines.size()} lines retrieved from lines.txt: ${allLines.join(' ')} " - // For archival, keeping track of newest and oldest lines as PR labels may change accross builds - // For stashes, we only care about the final lines of the current build - newestAndOldestLines = [allLines.first(), allLines.last()] // Save resources by running PCT only on newest and oldest lines - lines = newestAndOldestLines + lines = [allLines.first(), allLines.last()] // Save resources by running PCT only on newest and oldest lines echo "[INFO] Keeping only newest and oldest lines to save resources: ${lines.join(' ')} " if (flagEnabled(flags, 'weekly-test')) { lines = ['weekly'] @@ -189,25 +157,6 @@ mavenEnv(jdk: 21) { } } - stage('archive new prep') { - if (prepFoundInBuildNumber > 0) { - catchError(buildResult: 'SUCCESS', stageResult: 'NOT_BUILT') { error("[SKIP] No new prep to archive") } - return - } - - String prepArchiveGlob = 'pct.sh excludes.txt bom-*/excludes.txt target/pct.jar target/plugins.txt target/lines.txt' - // Both newest and oldest lines in the prep archive, in case labels change on PR accross builds - // ex: from weekly-test to full-test - newestAndOldestLines.each { line -> - prepArchiveGlob += " target/megawar-${line}.war" - } - withEnv(["ARCHIVE_NAME=${prepArchiveName}", "ARCHIVE_GLOB=${prepArchiveGlob}",]) { - sh 'tar czfv "${ARCHIVE_NAME}" ${ARCHIVE_GLOB}' - archiveArtifacts artifacts: prepArchiveName, fingerprint: true - echo "[INFO] New ${prepArchiveName} archived" - } - } - stage('stash prep lines') { if (lines.isEmpty()) { catchError(buildResult: 'SUCCESS', stageResult: 'NOT_BUILT') { error('[SKIP] No line to stash') } @@ -377,42 +326,3 @@ Map parsePlugins(plugins) { boolean flagEnabled(Map flags, String flag, String source = null) { source ? source in flags[flag] : !flags[flag].isEmpty() } - -// Search and copy an artifact from builds of a job -// Returns the build number where it has been found, zero otherwise -int retrieveArtifactsFromPreviousBuilds(String archiveName, String jobName) { - int foundInBuildNumber = 0 - boolean archiveExists = false - final int buildNumber = env.BUILD_NUMBER.toInteger() - if (buildNumber == 1) { - echo "[INFO] First build of ${jobName}, no ${archiveName} available yet" - return 0 - } - - // Loop over builds to retrieve the prep archive as previous build can have (only) other archive(s) - int checkBuildNumber = buildNumber - 1 - // Don't loop until the first build of master '^^ - final int limit = jobName.endsWith('master') ? buildNumber - 50 : 0 - while (!archiveExists && checkBuildNumber > limit) { - echo "[INFO] Trying to retrieve ${archiveName} from ${jobName}#${checkBuildNumber}..." - try { - copyArtifacts(projectName: jobName, - selector: specific("${checkBuildNumber}"), - filter: archiveName, - fingerprintArtifacts: true, - optional: false, - ) - archiveExists = true - } catch(e) {} - if (!archiveExists) { - checkBuildNumber = checkBuildNumber - 1 - } - } - if (!archiveExists) { - echo "[INFO] No ${archiveName} found in any build of ${jobName}" - } else { - foundInBuildNumber = checkBuildNumber - echo "[INFO] ${archiveName} found in ${jobName}#${checkBuildNumber}" - } - return foundInBuildNumber -} From 043fce29857e8b8958ee4a1cd0136e20aef3d0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Fri, 17 Jul 2026 14:24:51 +0200 Subject: [PATCH 2/2] rollback CONTRIBUTING.md too --- CONTRIBUTING.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c2296194..b3c8577b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -106,11 +106,6 @@ if you have switched the version in `bom-weekly/pom.xml` to a `*-SNAPSHOT`. To minimize cloud resources, PCT is not run at all by default on pull requests, only some basic sanity checks. -> [!TIP] -> If you need to restart a build without any change and if you can (ex: you're a maintainer), -> prefer using replays and reruns from GitHub over empty commits to benefit from the prep archive built and saved in the previous builds. -> It saves about half an hour of total build time, and resources. - ### Running weekly tests Add the label `weekly-test` to run the tests against the latest weekly Jenkins version - This is what you want most of the time.