-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Enable publishing of incremental builds #627
base: master
Are you sure you want to change the base?
Changes from all commits
c5b7dee
435ecdc
83d3ac4
1ed18bf
a1c1a13
b4a62ee
e2d1125
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd"> | ||
<extension> | ||
<groupId>io.jenkins.tools.incrementals</groupId> | ||
<artifactId>git-changelist-maven-extension</artifactId> | ||
<version>1.4</version> | ||
</extension> | ||
</extensions> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-Pconsume-incrementals | ||
-Pmight-produce-incrementals-with-minimal-flattening |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
properties([buildDiscarder(logRotator(numToKeepStr: '20'))]) | ||
properties([ | ||
buildDiscarder(logRotator(numToKeepStr: '10')), | ||
disableConcurrentBuilds(abortPrevious: true) | ||
]) | ||
|
||
node('maven-11') { | ||
checkout scm | ||
stage('Checkout') { | ||
infra.checkoutSCM() | ||
} | ||
|
||
stage('Build') { | ||
timeout(time: 1, unit: 'HOURS') { | ||
// TODO Azure mirror | ||
ansiColor('xterm') { | ||
withEnv(['MAVEN_OPTS=-Djansi.force=true']) { | ||
sh 'mvn -B -Dstyle.color=always -ntp clean verify' | ||
} | ||
} | ||
def mavenOptions = [ | ||
'-Dset.changelist', | ||
'clean', | ||
'install', | ||
] | ||
infra.runMaven(mavenOptions, 11) | ||
infra.prepareToPublishIncrementals() | ||
} | ||
} | ||
} | ||
|
||
infra.maybePublishIncrementals() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,18 +27,18 @@ | |
|
||
<groupId>org.jenkins-ci.plugins</groupId> | ||
<artifactId>plugin</artifactId> | ||
<version>4.50-SNAPSHOT</version> | ||
<version>${revision}${changelist}</version> | ||
<packaging>pom</packaging> | ||
|
||
<name>Jenkins Plugin Parent POM</name> | ||
<description>The Jenkins Plugins Parent POM Project</description> | ||
<inceptionYear>2016</inceptionYear> | ||
|
||
<scm> | ||
<connection>scm:git:https://github.com/jenkinsci/plugin-pom.git</connection> | ||
<developerConnection>scm:git:[email protected]:jenkinsci/plugin-pom.git</developerConnection> | ||
<tag>HEAD</tag> | ||
<url>https://github.com/jenkinsci/plugin-pom</url> | ||
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection> | ||
<developerConnection>scm:git:[email protected]:${gitHubRepo}.git</developerConnection> | ||
<tag>${scmTag}</tag> | ||
<url>https://github.com/${gitHubRepo}</url> | ||
</scm> | ||
|
||
<distributionManagement> | ||
|
@@ -54,6 +54,9 @@ | |
</distributionManagement> | ||
|
||
<properties> | ||
<revision>4.50</revision> | ||
<changelist>-SNAPSHOT</changelist> | ||
<gitHubRepo>jenkinsci/plugin-pom</gitHubRepo> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<project.build.outputEncoding>UTF-8</project.build.outputEncoding> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
|
@@ -1471,6 +1474,100 @@ | |
</plugins> | ||
</build> | ||
</profile> | ||
<!-- | ||
A profile that is identical to "might-produce-incrementals" but with "flatten-maven-plugin" | ||
configured to interpolate variables in the "scm", "url", and "version" elements and keep all | ||
other elements untouched. This is only intended to be used with repositories like "pom" and | ||
"plugin-pom". If the POM from these repositories were flattened with the "oss" flatten mode, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if upstream https://www.mojohaus.org/flatten-maven-plugin/flatten-mojo.html#flattenMode could use a new value, or is our usage just sufficiently weird to not be of interest to anyone else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I doubt anyone else would want to use this particular configuration. |
||
then the resulting incremental build would be missing critical sections and would not be | ||
suitable for consumers. If the "scm", "url", and "version" elements were not interpolated, | ||
then the resulting incremental build would contain e.g. an SCM tag of "${scmTag}" and could | ||
not be published to the incrementals repository. | ||
--> | ||
<profile> | ||
<id>might-produce-incrementals-with-minimal-flattening</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>flatten-maven-plugin</artifactId> | ||
<version>1.3.0</version> | ||
<configuration> | ||
<updatePomFile>true</updatePomFile> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>flatten</id> | ||
<goals> | ||
<goal>flatten</goal> | ||
</goals> | ||
<phase>process-resources</phase> | ||
<configuration> | ||
<keepCommentsInPom>true</keepCommentsInPom> | ||
<pomElements> | ||
<build>keep</build> | ||
<ciManagement>keep</ciManagement> | ||
<contributors>keep</contributors> | ||
<dependencies>keep</dependencies> | ||
<dependencyManagement>keep</dependencyManagement> | ||
<description>keep</description> | ||
<developers>keep</developers> | ||
<distributionManagement>keep</distributionManagement> | ||
<inceptionYear>keep</inceptionYear> | ||
<issueManagement>keep</issueManagement> | ||
<mailingLists>keep</mailingLists> | ||
<modules>keep</modules> | ||
<name>keep</name> | ||
<organization>keep</organization> | ||
<parent>keep</parent> | ||
<pluginManagement>keep</pluginManagement> | ||
<pluginRepositories>keep</pluginRepositories> | ||
<prerequisites>keep</prerequisites> | ||
<profiles>keep</profiles> | ||
<properties>keep</properties> | ||
<reporting>keep</reporting> | ||
<repositories>keep</repositories> | ||
<scm>interpolate</scm> | ||
<url>interpolate</url> | ||
<version>interpolate</version> | ||
</pomElements> | ||
<outputDirectory>${project.build.directory}</outputDirectory> | ||
<flattenedPomFilename>${project.artifactId}-${project.version}.pom</flattenedPomFilename> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-enforcer-plugin</artifactId> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.jenkins.tools.incrementals</groupId> | ||
<artifactId>incrementals-enforcer-rules</artifactId> | ||
<version>1.4</version> | ||
</dependency> | ||
</dependencies> | ||
<executions> | ||
<execution> | ||
<id>display-info</id> | ||
<configuration> | ||
<rules> | ||
<rule implementation="io.jenkins.tools.incrementals.enforcer.RequireExtensionVersion"> | ||
<version>[1.0-beta-4,)</version> | ||
Comment on lines
+1554
to
+1555
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could probably be dropped since I guess we do not expect this profile to ever be used inherited, only locally. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But that would increase the differential between this profile and the copypasta from which it originated, for no good reason I think. Better to keep all copies of this code as similar as possible I think. |
||
</rule> | ||
</rules> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-release-plugin</artifactId> | ||
<configuration> | ||
<completionGoals>incrementals:reincrementalify</completionGoals> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>produce-incrementals</id> | ||
<activation> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine but why not enable CD then? The only reason to hold off was the fear of regressions from incrementalification, not CD per se.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a fan of the version numbers used in JEP-229 releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷 well if this change is released and seems to cause no problems, I will propose CD at some point since the POMs are the last major thing that we have to release manually (Jenkins core being handled specially), and as developer-only artifacts their version aesthetics should be of the least concern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have mentioned that I am not a fan of JEP-229 more generally. The labeling scheme and automatically generated change logs have long been a source of frustration for me. If I have the choice between using JEP-229 and avoiding it, I will choose to avoid it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused by that comment in this context, as we already do the same in this repository:
plugin-pom/.github/workflows/release-drafter.yml
Lines 11 to 15 in 7a900a5
Anyway this is getting off topic; assuming that the testing done for this PR was sufficient, it seems like a clear benefit even while keeping the MRP flow. (On occasion I had tested against timestamped snapshots for proposed POM updates but it gets ugly.)