Skip to content
Draft
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
10 changes: 10 additions & 0 deletions vars/buildPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def call(Map params = [:]) {
timeoutValue = 180
}

boolean consumingIncrementals = false
boolean publishingIncrementals = false
boolean archivedArtifacts = false
Map tasks = [failFast: failFast]
Expand Down Expand Up @@ -125,6 +126,12 @@ def call(Map params = [:]) {
mavenOptions += "help:evaluate -Dexpression=changelist -Doutput=$changelistF"
}
}
if (fileExists('consume-incrementals')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alternately, we could just have a marker file incrementals which would gate both production and consumption of incrementals. Thus, when developing paired upstream/downstream PRs, you would need to create this file on both PRs, and delete it prior to merging. (Assuming CD, the upstream PR would deploy a release after merging. jenkins-infra/interesting-category-action#1 would make this friendlier.)

Copy link
Member

Choose a reason for hiding this comment

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

I'd rather avoid the production one unless its really needed.

consumingIncrementals = true
} else {
echo 'Forbidding use of Incremental dependencies. If you need to consume Incrementals, add a file named `consume-incrementals` to the repository root. (Contents arbitrary but conventionally a list of upstream PRs.) Then keep this PR in draft until the dependency has been switched to a release version and the marker file can be removed.'
mavenOptions += '-P-consume-incrementals'
}
if (jenkinsVersion) {
mavenOptions += "-Djenkins.version=${jenkinsVersion} -Daccess-modifier-checker.failOnError=false"
}
Expand Down Expand Up @@ -308,6 +315,9 @@ def call(Map params = [:]) {
if (publishingIncrementals) {
infra.maybePublishIncrementals()
}
if (consumingIncrementals) {
unstable "This build consumed Incremental dependencies. Remove the 'consume-incrementals' file before readying for review."
}
}

private void discoverReferenceBuild() {
Expand Down