Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,24 @@ Keep the PR in draft until tests pass and this file can be deleted.
To further minimize build time, tests are run only on Linux, against Java 11, and without Docker support.
It is unusual but possible for cross-component incompatibilities to only be visible in more specialized environments (such as Windows).

### Running on a limited plugin set

To run on a limited plugin set, add the label `limited-plugin-set` to run PCT in a PR - You would do this when debugging pipeline changes.

> [!NOTE]
> By default the set contains 10 plugins to consume a low amount of cloud resources.

If you lack triage permission and so cannot add this label, or if you want to run on your own set of plugins, then you may instead

```bash
# One per line
echo 'jenkinsci/variant-plugin variant' > limited-plugin-set
git add limited-plugin-set
git commit -m 'Run limited plugin set'
```

Keep the PR in draft until tests pass and this file can be deleted.

## LTS lines

A separate BOM artifact is available for the latest weekly, current LTS line and a few historical lines.
Expand Down
59 changes: 53 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ env.MAVEN_NTP = true

def fullTestLabel
def weeklyTestLabel
def limitedPluginSetLabel
if (env.CHANGE_ID) {
fullTestLabel = pullRequest.labels.contains('full-test')
weeklyTestLabel = pullRequest.labels.contains('weekly-test')
limitedPluginSetLabel = pullRequest.labels.contains('limited-plugin-set')
}

def fixedPrepArchiveName = '' // can be set to a specific prep archive name in case last commits aren't impacting it
Expand Down Expand Up @@ -65,14 +67,28 @@ def pluginsByRepository
def lines
def fullTestMarkerFile
def weeklyTestMarkerFile
def limitedPluginSetMarkerFile
def limitedPluginSet = [
'jenkinsci/aws-credentials-plugin aws-credentials',
'jenkinsci/aws-global-configuration-plugin aws-global-configuration',
'jenkinsci/azure-credentials-plugin azure-credentials',
'jenkinsci/azure-keyvault-plugin azure-keyvault',
'jenkinsci/azure-sdk-plugin azure-sdk',
'jenkinsci/azure-storage-plugin windows-azure-storage',
'jenkinsci/badge-plugin badge',
'jenkinsci/basic-branch-build-strategies-plugin basic-branch-build-strategies',
'jenkinsci/cron_column-plugin cron_column',
'jenkinsci/pipeline-maven-plugin pipeline-maven,pipeline-maven-api,pipeline-maven-database',
]
def durations = [:]

mavenEnv(jdk: 21) {
def scmVars = checkout scm
commitId = scmVars.GIT_COMMIT
def commitId = scmVars.GIT_COMMIT

fullTestMarkerFile = fileExists 'full-test'
weeklyTestMarkerFile = fileExists 'weekly-test'
limitedPluginSetMarkerFile = fileExists 'limited-plugin-set'

// Ensure prep archive corresponds to the current state
def prepArchiveName = "bom-prep-${commitId}.tar.gz"
Expand Down Expand Up @@ -120,14 +136,37 @@ mavenEnv(jdk: 21) {

stage('parse prep') {
dir('target') {
def plugins = readFile('plugins.txt').split('\n')
def plugins = []
def allLines = []
def from = 'plugins.txt'
if (limitedPluginSetLabel || limitedPluginSetMarkerFile) {
from = 'a limited set of plugins'
echo('[WARNING] Running on a limited set of plugins')

// Limited set
plugins = limitedPluginSet
if (limitedPluginSetMarkerFile) {
plugins = readFile('../limited-plugin-set').split('\n')
}
// Lines from sample-plugin
allLines = sh (
script: '''
echo "weekly $(grep -F '.x</bom>' ../sample-plugin/pom.xml | sed -E 's, *<bom>(.+)</bom>,\\1,g' | sort -rn | xargs)"
''',
returnStdout: true
).trim().split(' ')
} else {
plugins = readFile('plugins.txt').split('\n')
allLines = readFile('lines.txt').split('\n')
}
pluginsByRepository = parsePlugins(plugins)
echo "[INFO] ${pluginsByRepository.size()} repositories retrieved from ${from}"
echo "[INFO] List of repositories and their plugins:\n${plugins.join('\n')}"

def allLines = readFile('lines.txt').split('\n')
newestAndOldestLines = [allLines[0], allLines[-1]] // Save resources by running PCT only on newest and oldest lines
echo "[INFO] ${allLines.size()} lines retrieved from lines.txt: ${allLines.join(' ')} "

// For archival, keep track of newest and oldest lines as PR labels may change accross builds
// For archival, keeping track of newest and oldest lines as PR labels may change accross builds
// For stashes, we only care about the lines of the current build
lines = newestAndOldestLines
if (weeklyTestMarkerFile || weeklyTestLabel) {
Expand Down Expand Up @@ -236,8 +275,16 @@ if (BRANCH_NAME == 'master' || fullTestMarkerFile || weeklyTestMarkerFile || env
}
}

if (fullTestMarkerFile) {
error 'Remember to `git rm full-test` before taking out of draft'
stage('checks') {
if (fullTestMarkerFile) {
error 'Remember to `git rm full-test` before taking out of draft'
}
if (limitedPluginSetMarkerFile) {
error 'Remember to `git rm limited-plugin-set` before taking out of draft'
}
if (limitedPluginSetLabel) {
error 'Remember to remove `limited-plugin-set` label before taking out of draft'
}
}

infra.maybePublishIncrementals()
Expand Down