Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5a413e0
running per default on 2 last release series should be enough
olamy Feb 26, 2022
da1da5e
cleaning some tabs
olamy Feb 26, 2022
2a6fe1e
build site only one combination
olamy Feb 26, 2022
140cda6
remove maven.test.failure.ignore as default option add function new e…
olamy Feb 26, 2022
574be23
remove ignore test failure per default and add a param for extra mvn …
olamy Feb 26, 2022
6825fe6
site per default only only linux
olamy Feb 26, 2022
705abf8
fix siteOses loop
olamy Feb 26, 2022
c2ae6d4
add use ci-reporting try error prone and record results in Jenkins
olamy Feb 26, 2022
ad5a521
errorprone as configured can be run only with jdk 11
olamy Feb 26, 2022
3dca602
LOL
olamy Feb 26, 2022
3d7c1a6
jdk toInt
olamy Feb 26, 2022
ac4110b
typo
olamy Feb 26, 2022
5d038b8
fix boolean usage
olamy Feb 26, 2022
d967299
fix record analysis
olamy Feb 26, 2022
1894836
record jacoco results as well
olamy Feb 26, 2022
738320e
fix not valid id
olamy Feb 26, 2022
c7f5c96
add taglist parsing as well
olamy Feb 26, 2022
5169d37
Update asfMavenTlpPlgnBuild.groovy
olamy Feb 26, 2022
00a3048
run ci reporting only for master or if forced
olamy Feb 27, 2022
a7fc25d
log in console when CI Reporting triggered
olamy Feb 27, 2022
3b5d022
debug
olamy Feb 28, 2022
04f5c7d
debug
olamy Feb 28, 2022
f1068e9
arrghhhh ^&%&%$&^$^ typo!!
olamy Feb 28, 2022
b556d75
build with last maven 3.8.x
olamy Feb 28, 2022
c78fea7
enable run reporting
olamy Feb 28, 2022
0ae9ff7
fix bad copy/paste
olamy Feb 28, 2022
89339f3
force snapshots update for ci-reporting
olamy Feb 28, 2022
ddc14f0
force update snapshot for ci reporting
olamy Feb 28, 2022
32c0e47
Merge branch 'master' into reduce-to-only-2-last-mvn-series
olamy Mar 6, 2022
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
59 changes: 40 additions & 19 deletions vars/asfMavenTlpPlgnBuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,47 @@ def call(Map params = [:]) {
// minimum, LTS, current and next ea
def jdks = params.containsKey('jdks') ? params.jdks : params.containsKey('jdk') ? params.jdk : ['8','11','17']
def jdkMin = jdks[0];
def mavens = params.containsKey('maven') ? params.maven : ['3.2.x','3.6.x', '3.8.x']
def mavens = params.containsKey('maven') ? params.maven : ['3.6.x','3.8.x']
// def failFast = params.containsKey('failFast') ? params.failFast : true
// Just temporarily
def failFast = false;
def siteOses = params.containsKey('siteOs') ? params.siteOs : ['linux']
def siteJdks = params.containsKey('siteJdk') ? params.siteJdk : ['11']
def siteMvn = params.containsKey('siteMvn') ? params.siteMvn : '3.8.x'
def tmpWs = params.containsKey('tmpWs') ? params.tmpWs : false

def forceCiReporting = params.containsKey('forceCiReporting') ? params.forceCiReporting : false
def runCiReporting = forceCiReporting || env.BRANCH_NAME == 'master'
echo "runCiReporting: " + runCiReporting + ", forceCiReporting: "+ forceCiReporting

taskContext['failFast'] = failFast;
taskContext['tmpWs'] = tmpWs;
taskContext['archives'] = params.archives
taskContext['siteWithPackage'] = params.containsKey('siteWithPackage') ? params.siteWithPackage : false // workaround for MNG-7289
taskContext['extraCmd'] = params.containsKey('extraCmd') ? params.extraCmd : ''
taskContext['ciReportingRunned'] = false

Map tasks = [failFast: failFast]
boolean first = true
for (String os in oses) {
for (def mvn in mavens) {
def jdk = Math.max( jdkMin as Integer, jenkinsEnv.jdkForMaven( mvn ) as Integer) as String
jdks = jdks.findAll{ it != jdk }
doCreateTask( os, jdk, mvn, tasks, first, 'build', taskContext )
doCreateTask( os, jdk, mvn, tasks, first, 'build', taskContext, runCiReporting )
}
for (def jdk in jdks) {
def mvn = jenkinsEnv.mavenForJdk(jdk)
doCreateTask( os, jdk, mvn, tasks, first, 'build', taskContext )
doCreateTask( os, jdk, mvn, tasks, first, 'build', taskContext, runCiReporting )
}

for (def jdk in siteJdks) {
// doesn't work for multimodules yet
doCreateTask( os, jdk, siteMvn, tasks, first, 'site', taskContext )
}


// run with apache-release profile, consider it a dryRun with SNAPSHOTs
// doCreateTask( os, siteJdk, siteMvn, tasks, first, 'release', taskContext )
}
for (String os in siteOses) {
for (def jdk in siteJdks) {
// doesn't work for multimodules yet
doCreateTask( os, jdk, siteMvn, tasks, first, 'site', taskContext, false )
}
}
// run the parallel builds
parallel(tasks)

Expand Down Expand Up @@ -104,12 +111,12 @@ def call(Map params = [:]) {
echo "***** FAST FAILURE *****\n\nFast failure triggered by ${taskContext.failingFast}\n\n***** FAST FAILURE *****"
}
stage("Notifications") {
jenkinsNotify()
jenkinsNotify()
}
}
}

def doCreateTask( os, jdk, maven, tasks, first, plan, taskContext )
def doCreateTask( os, jdk, maven, tasks, first, plan, taskContext, runCiReporting )
{
String label = jenkinsEnv.labelForOS(os);
String jdkName = jenkinsEnv.jdkFromVersion(os, "${jdk}")
Expand All @@ -119,22 +126,25 @@ def doCreateTask( os, jdk, maven, tasks, first, plan, taskContext )
echo "Skipping ${os}-jdk${jdk} as unsupported by Jenkins Environment"
return;
}
def recordReporting = false
def cmd = [
'mvn', '-V',
'-P+run-its',
'-Dmaven.test.failure.ignore=true',
'-Dfindbugs.failOnError=false',
'-e',
taskContext.extraCmd
]
if (!first) {
cmd += '-Dfindbugs.skip=true'
// } else { // Requires authorization on SonarQube first
// cmd += 'sonar:sonar'
if (Integer.parseInt(jdk) >= 11 && !taskContext['ciReportingRunned'] && runCiReporting) {
cmd += "-Pci-reporting -Perrorprone -U"
taskContext['ciReportingRunned'] = true
recordReporting = true
echo "CI Reporting triggered for OS: ${os} JDK: ${jdk} Maven: ${maven}"
}


if (plan == 'build') {
cmd += 'clean'
if (env.BRANCH_NAME == 'master' && jdk == '17' && maven == '3.6.x' && os == 'linux' ) {
if (env.BRANCH_NAME == 'master' && jdk == '17' && maven == '3.8.x' && os == 'linux' ) {
cmd += 'deploy'
} else {
cmd += 'verify -Dpgpverify.skip'
Expand Down Expand Up @@ -213,6 +223,17 @@ def doCreateTask( os, jdk, maven, tasks, first, plan, taskContext )
}
}
}
if(recordReporting) {
recordIssues id: "${os}-jdk${jdk}", name: "Static Analysis",
aggregatingResults: true, enabledForFailure: true,
tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser(), errorProne(),tagList()]
jacoco inclusionPattern: '**/org/apache/maven/**/*.class',
exclusionPattern: '',
execPattern: '**/target/jacoco.exec',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jacoco-it.exec should also be included

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point to include IT test in coverage.
I have setup this to be in the same file with apache/maven-compiler-plugin@7e83e0d and covered lines increased from build #16 here https://ci-maven.apache.org/job/Maven/job/maven-compiler-plugin-test-olamy/job/ci-reporting/

classPattern: '**/target/classes',
sourcePattern: '**/src/main/java'
recordReporting = false;
}
} catch (Throwable e) {
archiveDirs(taskContext.archives, stageDir)
// First step to keep the workspace clean and safe disk space
Expand Down Expand Up @@ -241,6 +262,6 @@ def archiveDirs(archives, stageDir) {
archives.each { archivePrefix, pathToContent ->
zip(zipFile: "${archivePrefix}-${stageDir}.zip", dir: pathToContent, archive: true)
}
}
}
}
}
25 changes: 21 additions & 4 deletions vars/asfMavenTlpStdBuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ def call(Map params = [:]) {
def jdks = params.containsKey('jdks') ? params.jdks : params.containsKey('jdk') ? params.jdk : ['8','11','17']
def maven = params.containsKey('maven') ? params.maven : '3.8.x'
def tmpWs = params.containsKey('tmpWs') ? params.tmpWs : false
def extraCmd = params.containsKey('extraCmd') ? params.extraCmd : ''
// def failFast = params.containsKey('failFast') ? params.failFast : true
// Just temporarily
def forceCiReporting = params.containsKey('forceCiReporting') ? params.forceCiReporting : false
def runCiReporting = forceCiReporting || env.BRANCH_NAME == 'master'
echo "runCiReporting: " + runCiReporting + ", forceCiReporting: "+ forceCiReporting
def ciReportingRunned = false
def failFast = false;
Map tasks = [failFast: failFast]
boolean first = true
Expand All @@ -57,11 +62,13 @@ def call(Map params = [:]) {
def cmd = [
'mvn', '-V',
'-P+run-its',
'-Dmaven.test.failure.ignore=true',
'-Dfindbugs.failOnError=false',
extraCmd
]
if (!first) {
cmd += '-Dfindbugs.skip=true'
if (Integer.parseInt(jdk) >= 11 && !ciReportingRunned && runCiReporting) {
cmd += "-Pci-reporting -Perrorprone -U"
ciReportingRunned = true
echo "CI Reporting triggered for OS: ${os} JDK: ${jdk} Maven: ${maven}"
}
cmd += 'clean'
if (env.BRANCH_NAME == 'master' && jdk == '17' && os == 'linux' ) {
Expand Down Expand Up @@ -114,7 +121,6 @@ def call(Map params = [:]) {
findbugsPublisher(disabled: disablePublishers),
openTasksPublisher(disabled: disablePublishers),
dependenciesFingerprintPublisher(disabled: disablePublishers),
// DISABLED DUE TO INFRA-17514 invokerPublisher(),
pipelineGraphPublisher(disabled: disablePublishers)
], publisherStrategy: 'EXPLICIT') {
dir ('m') {
Expand All @@ -125,6 +131,17 @@ def call(Map params = [:]) {
}
}
}
if(!ciReportingRunned) {
recordIssues id: "${os}-jdk${jdk}", name: "Static Analysis",
aggregatingResults: true, enabledForFailure: true,
tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser(), errorProne(),tagList()]
jacoco inclusionPattern: '**/org/apache/maven/**/*.class',
exclusionPattern: '',
execPattern: '**/target/jacoco*.exec',
classPattern: '**/target/classes',
sourcePattern: '**/src/main/java'
ciReportingRunned = true;
}
} catch (Throwable e) {
echo "[FAILURE-004] ${e}"
// First step to keep the workspace clean and safe disk space
Expand Down