Keep Maven Central out of Renovate's lookup path - #29
Merged
Conversation
Renovate runs have been aborting with "External host error causing abort - skipping", so no dependency updates land. Renovate's maven manager appends Maven Central to every Maven dependency's registryUrls unconditionally, regardless of the repositories declared in the poms (modules/manager/maven/extract.js, cleanResult). The maven datasource uses registryStrategy "merge", so Central is queried for every dep, and a 429 or 5xx from Central is turned into an ExternalHostError that can take the whole run down (modules/datasource/maven/util.js). Every dependency in this repo is org.cyclops.*, served by GitHub Packages, so pinning that groupId to its real registry removes Central from the lookup path entirely. Rules for the commented-out mekanism and refinedstorage deps are included so re-enabling them does not reintroduce the problem. Also applies the config migration Renovate reports: matchPackagePrefixes becomes matchPackageNames with a glob. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MahadNA3gehFpLYemERXRn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the same fix in packtests#73, infobook-html#54, infobook-html-evilcraft#11 and infobook-html-integrateddynamics#20.
Why this repo is affected
It is not obvious, because no pom here declares Maven Central. Every pom declares only
https://maven.pkg.github.com/CyclopsMC/packages. Central gets added anyway:modules/manager/maven/extract.js,cleanResult(line 353 in 44.82.3) pushesMAVEN_REPOonto every Maven dep'sregistryUrls, unconditionally.modules/datasource/maven/index.jssetsregistryStrategy = "merge", so every registry in that list is queried for every dep.modules/datasource/maven/util.jsturns a 429 or 5xx specifically from Central's host intomaven-central-temporary-errorand throws it as anExternalHostError(line 150).workers/repository/error.jslogsExternal host error causing abort - skippingfor anExternalHostErrorthat reaches it.So Central is queried 150 times per run here purely to 404, and its rate limiting can abort the run.
Changes
packageRuleswithregistryUrls, pinning each groupId to the registry that actually serves it. Every active dependency in this repo isorg.cyclops.*, so there is one rule that matters, mapping it to GitHub Packages. Two extra rules cover themekanismandcom.refinedmods.refinedstoragedeps that are currently commented out in the poms, so re-enabling them does not reintroduce a Central lookup.hostRulesentry forrepo.maven.apache.org. This does not work and is not a safety net, see the caveat below. It carries an in-filedescriptionsaying so."matchPackagePrefixes": ["org.cyclops."]becomes"matchPackageNames": ["org.cyclops.{/,}**"].Nothing else changes. The
config:recommendedpreset,enabledManagers, both automerge rules, theCyclops packagesgroupName, and theRENOVATE_GITHUB_COM_TOKENhostRule are untouched.Caveat on the hostRule, please do not mistake it for protection
{"abortOnError": false, "abortIgnoreStatusCodes": [429]}is a no-op. Inutil/http/http.js:abortOnErroris already falsy by default, so setting it tofalsechanges nothing, andabortIgnoreStatusCodesis only consulted whenabortOnErroris true. More importantly, the abort does not come through that path at all: it comes from the Maven datasource's own unconditional Central special case inmodules/datasource/maven/util.js, which no hostRule suppresses. It is included only for consistency with the four sibling repos.The mechanism that would give a hard guarantee is:
{"matchHost": "repo.maven.apache.org", "enabled": false}A disabled host raises a plain
host-disablederror, which the Maven datasource classifies as unknown and swallows. I have deliberately not added this, because its failure mode is silent: any dep that genuinely needed Central would just stop updating with no signal. Raising it as an option, not applying it unilaterally.One correction to the stated root cause
The
mergeRegistriesbehaviour is milder in current Renovate than in the original diagnosis. In 44.82.3 (modules/datasource/index.js) anExternalHostErrorfrom one registry is caught, logged asdatasource merge: external host error from registry; continuing so releases from other registries are not discarded, and the loop continues. It is rethrown only if no registry returned any releases:I bisected this across published versions: 44.0.0, 44.10.0, 44.20.0 and 44.30.0 rethrow unconditionally; 44.35.0 and later have the
continue. So on a recent Renovate the abort needs Central to error and the GitHub Packages lookup to come up empty for at least one dep, rather than Central erroring alone. That narrows the window but does not close it, and it depends on which version Mend is running, which I cannot see from here. This change removes the exposure regardless of version, and also stops 150 pointless requests to Central per run.postprocessReleaseis not an additional abort path:modules/datasource/postprocess-release.jscatches everything and returns the release unchanged.Not an org-level config
Worth stating since this is the
.githubrepo. Thisrenovate.jsonis this repo's own config only, not an org default that other CyclopsMC repos inherit. Renovate's inherited config is a self-hosted admin setting:inheritConfigisglobalOnlyand defaults tofalse, and it readsorg-inherited-config.jsonfrom{{parentOrg}}/renovate-config, notrenovate.jsonfrom.github. So this fix has to be per-repo, which matches the four sibling PRs.Validation
npx --yes --package renovate -- renovate-config-validator --strictfrom the repo root, no path argument. Before: exit 1,WARN: Config migration necessary. After: exit 0,INFO: Config validated successfully.curl -sSL, exact.pomfor the version in the repo:modmaven.devmekanism:Mekanism:1.21.1-10.7.17.83-> 200maven.creeperhost.netcom.refinedmods.refinedstorage:refinedstorage-neoforge:3.2.0-> 200repo.maven.apache.orgfororg.cyclops.cyclopscore:cyclopscore-26.2-neoforge:1.30.0-1038-> 404, confirming Central does not serve thesemaven.pkg.github.comreturns 401 for these poms without a token, so I could not confirm 200 for theorg.cyclops.*mapping. It is inferred from the<repositories>block every pom already declares and from the existingRENOVATE_GITHUB_COM_TOKENhostRule, not measured.matchRegexOrGlobListfromdist/util/string-match.js, over all 150 activegroupId:artifactIdpairs extracted from the 13 poms. Each matches exactly one registry rule, none double-matches, and the migratedorg.cyclops.{/,}**glob matches exactly the same set the oldmatchPackagePrefixesdid, so theCyclops packagesgrouping is unchanged. The two commented-out coordinates also resolve to one rule each.🤖 Generated with Claude Code
https://claude.ai/code/session_01MahadNA3gehFpLYemERXRn
Generated by Claude Code