Skip to content

Pass -P-consume-incrementals unless a PR specifically includes marker file consume-incrementals#991

Draft
jglick wants to merge 7 commits intojenkins-infra:masterfrom
jglick:disable-consume-incrementals
Draft

Pass -P-consume-incrementals unless a PR specifically includes marker file consume-incrementals#991
jglick wants to merge 7 commits intojenkins-infra:masterfrom
jglick:disable-consume-incrementals

Conversation

@jglick
Copy link
Contributor

@jglick jglick commented Feb 9, 2026

Block usage of Incrementals dependencies not just during releases as jenkins-infra/jenkins-maven-cd-action#3 does, but “shifting left” into branch builds (master) as well as all PR builds by default including those used by both Dependabot and Renovate, so that the consume-incrementals profile would be active only locally (due to .mvn/maven.config) and in PR builds that specifically request it. Should offer a first line of defense against problems like jenkins-infra/helpdesk#4990 (comment).

Required by jenkins-infra/helpdesk#4998. Probably harmless to merge first, but useless because as seen in jenkinsci/jenkins-infra-test-plugin#212 the Incrementals deps are loaded anyway, pending jenkins-infra/helpdesk#4998.

@jglick jglick requested a review from a team as a code owner February 9, 2026 15:40
@jglick

This comment was marked as outdated.

@jglick

This comment was marked as outdated.

@jglick

This comment was marked as outdated.

@jglick

This comment was marked as outdated.

@jglick

This comment was marked as outdated.

@jglick

This comment was marked as outdated.

@lemeurherve
Copy link
Contributor

lemeurherve commented Feb 10, 2026

https://github.com/search?q=org%3Ajenkins-infra%20ARTIFACT_CACHING_PROXY_SERVERID&type=code cannot find where it is defined

I don't trust GitHub search.

Recommanding https://github.com/gabrie30/ghorg to search across a local copy of @jenkins-infra and/or @jenkinsci1

$ rg ARTIFACT_CACHING_PROXY_SERVERID
jenkins-infra/dist/profile/templates/jenkinscontroller/casc/clouds-kubernetes.yaml.erb
64:                  key: "ARTIFACT_CACHING_PROXY_SERVERID"

jenkins-infra/dist/profile/templates/jenkinscontroller/casc/clouds-azurevm.yaml.erb
39:          [System.Environment]::SetEnvironmentVariable("ARTIFACT_CACHING_PROXY_SERVERID", "<%= @jcasc['artifact_caching_proxy']['servers'][cloudsetup['acpServerId']]['url'] %>", "Machine")
40:          $Env:ARTIFACT_CACHING_PROXY_SERVERID = "<%= @jcasc['artifact_caching_proxy']['servers'][cloudsetup['acpServerId']]['url'] %>"
124:            export ARTIFACT_CACHING_PROXY_SERVERID='<%= @jcasc['artifact_caching_proxy']['servers'][cloudsetup['acpServerId']]['url'] %>'
148:            Environment="ARTIFACT_CACHING_PROXY_SERVERID=^${ARTIFACT_CACHING_PROXY_SERVERID}"

jenkins-infra/dist/profile/templates/jenkinscontroller/casc/clouds-ec2.yaml.erb
82:            - key: "ARTIFACT_CACHING_PROXY_SERVERID"

pipeline-library/test/groovy/InfraStepTests.groovy
194:    env.ARTIFACT_CACHING_PROXY_SERVERID = 'https://foo:1313'
205:    assertTrue(assertMethodCallContainsPattern('echo', "INFO: using artifact caching proxy server '${env.ARTIFACT_CACHING_PROXY_SERVERID}'."))
207:    assertTrue(assertMethodCallContainsPattern('configFile', "fileId=${env.ARTIFACT_CACHING_PROXY_SERVERID}"))
226:    assertTrue(assertMethodCallContainsPattern('echo', "WARNING: artifact caching proxy is enabled but the provided 'ARTIFACT_CACHING_PROXY_SERVERID' setup on the agent is empty, will use repo.jenkins-ci.org."))
254:    env.ARTIFACT_CACHING_PROXY_SERVERID = 'https://foo:1313'
268:    assertTrue(assertMethodCallContainsPattern('configFile', "fileId=${env.ARTIFACT_CACHING_PROXY_SERVERID}"))
279:    env.ARTIFACT_CACHING_PROXY_SERVERID = 'https://foo:1313'
293:    assertFalse(assertMethodCallContainsPattern('configFile', "fileId=${env.ARTIFACT_CACHING_PROXY_SERVERID}"))
304:    env.ARTIFACT_CACHING_PROXY_SERVERID = 'https://foo:1313'
317:    assertTrue(assertMethodCallContainsPattern('configFile', "fileId=${env.ARTIFACT_CACHING_PROXY_SERVERID}"))
327:    env.ARTIFACT_CACHING_PROXY_SERVERID = 'https://foo:1313'
341:    assertTrue(assertMethodCallContainsPattern('echo', "WARNING: the artifact caching proxy server '${env.ARTIFACT_CACHING_PROXY_SERVERID}' isn't reachable, will use repo.jenkins-ci.org."))
343:    assertFalse(assertMethodCallContainsPattern('echo', "INFO: using artifact caching proxy server '${env.ARTIFACT_CACHING_PROXY_SERVERID}'."))
345:    assertFalse(assertMethodCallContainsPattern('configFile', "fileId=${env.ARTIFACT_CACHING_PROXY_SERVERID}"))
357:    env.ARTIFACT_CACHING_PROXY_SERVERID = 'https://foo:1313'

pipeline-library/vars/infra.groovy
185: * Artifact Caching Proxy server defined in agent's env.ARTIFACT_CACHING_PROXY_SERVERID variable.
191:  final String acpServerId = env.ARTIFACT_CACHING_PROXY_SERVERID
194:    echo "WARNING: artifact caching proxy is enabled but the provided 'ARTIFACT_CACHING_PROXY_SERVERID' setup on the agent is empty, will use repo.jenkins-ci.org."

pipeline-library/vars/infra.txt
44:     Artifact Caching Proxy server defined in agent's env.ARTIFACT_CACHING_PROXY_SERVERID variable.

Footnotes

  1. took less than 4 minutes to clone its 2716 public repos (14.5GB) on my mac mini m4

@lemeurherve
Copy link
Contributor

lemeurherve commented Feb 10, 2026

@lemeurherve given jenkinsci/jenkins-infra-test-plugin#207 (comment) can we make sure the proxy ignores the incrementals repo? Or is there some way to adjust the Maven config? Like

<mirrorOf>*,!incrementals</mirrorOf>

Most probably, here is the current config of ACP for our controllers on VMs (ci.jenkins.io, trusted.ci.jenkins.io & cert.ci.jenkins.io): https://github.com/jenkins-infra/jenkins-infra/blob/dcd24c38d6a61d2d0596f1dc6d84819a16e5ee75/dist/profile/templates/jenkinscontroller/casc/artifact-caching-proxy.yaml.erb

See blame for evolution and links to the corresponding helpdesk issues. (incrementals has been discussed previously AFAIR, but details are a bit fuzzy to me atm)

@jglick

This comment was marked as outdated.

@jglick

This comment was marked as outdated.

@jglick
Copy link
Contributor Author

jglick commented Feb 11, 2026

@lemeurherve @dduportal I think I need help here, since I do not really know how the ACP is set up, and jenkins-infra/jenkins-infra#4669 did not work—it is apparently still serving artifacts from the incrementals repo, which makes me think jenkins-infra/jenkins-infra#3350 was wrong in this regard at least: ACP should be caching artifacts from Jenkins releases as well as Central. It is actually fine if ACP caches incrementals (mainly for negative lookups, so we do not hit maven_metadata.xml for dependencies which do not actually exist yet which do not fail the build) but it needs to do so under a distinct repository id, like it did prior to jenkins-infra/jenkins-infra#3350 (AFAICT) so that you can turn this repo on or off.

@timja
Copy link
Member

timja commented Feb 11, 2026

Context in here:

jenkins-infra/helpdesk#3969 (comment)

and Basil explaining consequence here:
jenkins-infra/helpdesk#3969 (comment)

@dduportal
Copy link
Contributor

Context in here:

jenkins-infra/helpdesk#3969 (comment)

and Basil explaining consequence here: jenkins-infra/helpdesk#3969 (comment)

Please note that the gain of caching incrementals has been surprisingly huge in term of bandwidth consumed from repo.jenkins-ci.org.

If you are blocked by this, the config is here: https://github.com/jenkins-infra/helm-charts/blob/9d8ae214c001fa28598a7438556e0dcc73d828ca/charts/artifact-caching-proxy/templates/nginx-proxy-configmap.yaml#L133-L158

=> the fallback_jenkins_incrementals location should be removed (and https://github.com/jenkins-infra/helm-charts/blob/9d8ae214c001fa28598a7438556e0dcc73d828ca/charts/artifact-caching-proxy/templates/nginx-proxy-configmap.yaml#L134 must be adapted) since jenkins-infra/jenkins-infra#4669 has been set up.

Be careful. it WILL have side effect, I can't recall which ones.

@jglick

This comment was marked as resolved.

@timja

This comment was marked as resolved.

@jglick

This comment was marked as resolved.

@jglick jglick changed the title Pass -P-consume-incrementals on origin repo builds Pass -P-consume-incrementals unless a PR specifically requests them with marked file consume-incrementals Feb 13, 2026
@jglick jglick changed the title Pass -P-consume-incrementals unless a PR specifically requests them with marked file consume-incrementals Pass -P-consume-incrementals unless a PR specifically includes marker file consume-incrementals Feb 13, 2026
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants