fix(ci): force flatten on build-cache hits so installed POMs resolve (#36947) - #36972
Open
wezell wants to merge 1 commit into
Open
fix(ci): force flatten on build-cache hits so installed POMs resolve (#36947)#36972wezell wants to merge 1 commit into
wezell wants to merge 1 commit into
Conversation
…36947) A cache hit was publishing POMs with unresolved CI-friendly placeholders, breaking every downstream consumer: Could not find artifact com.dotcms.core.plugins:dotcms-core-plugins-parent :pom:${revision}${sha1}${changelist} parent/pom.xml uses Maven CI-friendly versions (<revision>1.0.0</revision>) with flatten-maven-plugin's updatePomFile=true, so flatten rewrites the project POM to the resolved version at process-resources and install publishes that. The build cache treats flatten:flatten as a cached execution and skips it on a hit, while alwaysRunPlugins forces install to run anyway -- so install faithfully published the raw pom instead. Observed on run 31235284253: 19 modules restored, 19 "Skipping plugin execution (cached): flatten:flatten", and the entire integration suite unable to resolve dotcms-core's dependencies. This only surfaced once the bucket had been populated by the first merge_group write, which is why every earlier run was green -- a 100% miss never exercises it. Reproduced and verified locally against :com.dotcms.tika-api: cold build -> <version>1.0.0-SNAPSHOT</version> cache hit, previous flags -> <version>${revision}${sha1}${changelist}</version> cache hit, flatten forced -> <version>1.0.0-SNAPSHOT</version> with flatten skipped 4x in the middle case and 0x after the fix. Worth naming the shape of this bug: alwaysRunPlugins is a hand-curated allowlist of "executions that must not be skipped", which is exactly the kind of hand-maintained predicate the caching proposal argued against. install was identified up front; flatten was not, because nothing fails until a hit actually happens. Any other plugin that mutates state install depends on has the same exposure. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014a2iJy9JXRBSVdKBbmoZ2S
Contributor
|
Claude finished @wezell's task in 57s —— View job Code Review
New IssuesNo issues found. The one-line change is correct and well-targeted. Why the fix is right
Minor / non-blocking
On the two follow-ups in the description — both are sound and worth doing, and neither belongs in this PR:
This is a correct, minimal hotfix for an active main outage. LGTM to merge. · branch |
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.
🔴 Fixes an active CI outage on main. Every PR and merge-queue build is currently publishing broken POMs into its own Maven repo.
Symptom
Cause
parent/pom.xmluses Maven CI-friendly versions (<revision>1.0.0</revision>) withflatten-maven-plugin'supdatePomFile=true. Flatten rewrites the project POM to the resolved version atprocess-resources, andinstallpublishes that.The build cache treats
flatten:flattenas a cached execution and skips it on a hit — whilealwaysRunPluginsforcesinstallto run anyway. Soinstallfaithfully published the rawpom.xml, placeholders and all.On run 31235284253: 19 modules restored, 19
Skipping plugin execution (cached): flatten:flatten, and the whole integration suite unable to resolvedotcms-core's dependencies.Why it passed every previous run
The bucket was empty until the first
merge_groupwrite on #36960's own merge. A 100% cache miss never exercises this path — so every run before that was legitimately green, including the one that merged the cache. The first run to get real hits was the first to break.Verified locally against
:com.dotcms.tika-api1.0.0-SNAPSHOT✅${revision}${sha1}${changelist}❌1.0.0-SNAPSHOT✅Immediate mitigation, independent of this PR
That kill switch (shipped in #36960) turns the cache off repo-wide with no revert and no deploy. Unset it once this lands.
The shape of this bug is worth naming
alwaysRunPluginsis a hand-curated allowlist of "executions that must not be skipped" — precisely the kind of hand-maintained predicate that the caching proposal argued content hashing should replace.installwas identified up front;flattenwas not, because nothing fails until a hit actually happens. Any other plugin that mutates stateinstalldepends on carries the same exposure, and a miss-only run will never reveal it.Two follow-ups worth considering, not done here:
BUILD_CACHE_DISABLED=trueuntil a merge-queue build demonstrates a green run with hits, rather than trusting this fix on a miss-only PR run.<flatten.skip>or narrowing what the cache is allowed to skip is a more durable answer than growing the allowlist.🤖 Generated with Claude Code
https://claude.ai/code/session_014a2iJy9JXRBSVdKBbmoZ2S
This PR fixes: #36947