Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: build with java 11? [spike] #104

Draft
wants to merge 2 commits into
base: release/v7.x
Choose a base branch
from
Draft

Conversation

keturn
Copy link
Member

@keturn keturn commented Apr 25, 2021

Experimenting to see how we could keep building with whatever lowest-common-denominator JDK we need, but also run the test suite under a newer JDK.

Comment on lines +6 to +13
axes {
axis {
name 'JAVA_VERSION'
values 'java8', 'neo-java'
}
}
agent {
label env.JAVA_VERSION
Copy link
Member Author

Choose a reason for hiding this comment

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

I ended up using the labels as the axis values, but that doesn't feel great.

How would I do a map from values to labels in a declarative pipeline?

Or maybe this is the way to go, and it's just a matter of naming labels consistently?

javaDoc(),
taskScanner(includePattern: '**/*.java,**/*.groovy,**/*.gradle,**/*.kts', lowTags: 'WIBNIF', normalTags: 'TODO, FIXME', highTags: 'ASAP')
javaDoc(id:"javaDoc-$JAVA_VERSION", name: "JavaDoc $JAVA_VERSION"),
taskScanner(id:"tasks-$JAVA_VERSION", name: "Tasks $JAVA_VERSION", includePattern: '**/*.java,**/*.groovy,**/*.gradle,**/*.kts', lowTags: 'WIBNIF', normalTags: 'TODO, FIXME', highTags: 'ASAP')
Copy link
Member Author

Choose a reason for hiding this comment

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

taskScanner works purely on the source text so it's not really useful to include in the matrix. Doing it once would be sufficient.

@@ -33,6 +46,7 @@ pipeline {
}
stage('Publish') {
when {
expression { env.JAVA_VERSION == 'java8' }
Copy link
Member Author

Choose a reason for hiding this comment

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

I put this in the matrix so it can keep going on the java8 node it used to build.

(Not publishing a java11 build because that sounds like a different kettle of worms.)

But maybe this should be outside the matrix so it doesn't happen unless the java11 tests succeed?

Base automatically changed from v7/ci/jenkinsfile to release/v7.x April 25, 2021 22:28
@Cervator
Copy link
Member

@Cervator
Copy link
Member

This is interesting, nice work 👍

I haven't tried using matrix in pipeline land at all, be it declarative or scripted. Additionally I've started using multiple labels as requirements, and I'm not sure how those two approaches would get along. Not that we can't just go to single (perhaps more detailed) labels. I need more time to dig into this some to really be able to contribute much of anything sensible I think, and there are a few things in front of it :-)

@keturn
Copy link
Member Author

keturn commented Apr 26, 2021

Additionally I've started using multiple labels as requirements, and I'm not sure how those two approaches would get along.

Using label "lib && light && $JAVA_VERSION" seems to work. At least for java8 where it can actually find something that fits. Presumably we could make a java11 to fit as well.

@Cervator
Copy link
Member

This deserves more time from me but I dunno when that'll be. I only remember matrix from way long ago, where it had some warts. Without really having the knowledge to judge its state today - I do wonder if it would be the best approach, especially if there are some stages where it doesn't make sense to spread across the full matrix. The main alternative I can think of is just clever use of stages and parallel but with hard coded targets (dunno if scripted would have more flexibility there or not needed). Not sure if we're likely to go much past feeding 2 JDKs to the matrix?

@Cervator
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

None yet

2 participants