Skip to content

Order the source guard after planned POM regeneration (fix flaky CI) - #18

Merged
perNyfelt merged 1 commit into
mainfrom
fix/guard-pom-race
Nov 15, 2026
Merged

perNyfelt merged 1 commit into
mainfrom
fix/guard-pom-race

Conversation

@perNyfelt

Copy link
Copy Markdown
Member

Fixes the intermittent CI failures on main since #15. The same failures appeared in #15's later runs, in #16, and back on 2026-11-05 on #13/#14 branches.

Cause

The failing tests (embeddedProjectsMustAlsoBeRemovedFromGradleMetadata [1]/[2] and namedSubsetPlansBuildsSignsAndBundlesRealPublications) all failed with:

> Task :releaseAllGuard FAILED
> Task :core:generatePomFileForMavenPublication
> Stale manifest input: <module>/build/publications/maven/pom-default.xml

releaseAllGuard hashes the POM files that releaseAllPlan recorded. Staging for bundleAll regenerates those POMs in the same build, and nothing ordered the guard after that regeneration. With the configuration cache, tasks run in parallel, so the guard could read a POM that was missing or only partly written.

Fix

releaseAllGuard now mustRunAfter the planned POM tasks (the same tasks releaseAllPlan already depends on).

  • This is ordering only: it applies when both are in the build and never adds the POM tasks to a build.
  • Existing-bundle uploads and status-only resume are unaffected.
  • The guard now also checks the POM that is actually staged, rather than whatever was on disk before regeneration.

Test

guardHashesPomsOnlyAfterPomRegenerationFinishes forces POM regeneration and keeps the POM missing for 1.5 s during the rewrite. It failed reliably before the fix with the CI error above, and passed three runs in a row after it.

Validation

./gradlew check on macOS: 194 tests, 0 failures. The original failures were intermittent on CI runners, so CI on this PR is the real confirmation.

🤖 Generated with Claude Code

releaseAllGuard hashes the POM files recorded by releaseAllPlan, but had no
ordering against the generatePomFile tasks that bundleAll staging runs in
the same build. With the configuration cache, tasks run in parallel, so the
guard could hash a POM while it was being rewritten and fail with
"Stale manifest input: <module>/build/publications/maven/pom-default.xml".
This made embeddedProjectsMustAlsoBeRemovedFromGradleMetadata and
namedSubsetPlansBuildsSignsAndBundlesRealPublications fail intermittently
in CI, including on main after #15.

Make the guard mustRunAfter the planned POM tasks. The ordering only
applies when both are scheduled, so existing-bundle uploads and resume
are unaffected. A regression test forces POM regeneration with a delayed
rewrite; it failed reliably before this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@perNyfelt
perNyfelt merged commit fe1422d into main Nov 15, 2026
5 checks passed
@perNyfelt
perNyfelt deleted the fix/guard-pom-race branch November 15, 2026 18:55
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.

1 participant