Skip to content

Add regression test for fenced Eclipse step under configuration cache (#3119) - #3205

Open
Pankraz76 wants to merge 1 commit into
diffplug:mainfrom
Pankraz76:test/3119-fenced-eclipse-config-cache
Open

Pankraz76 wants to merge 1 commit into
diffplug:mainfrom
Pankraz76:test/3119-fenced-eclipse-config-cache

Conversation

@Pankraz76

Copy link
Copy Markdown

Adds a regression test for #3119.

What happened in #3119

The reporter's build (GTNH buildscript 2.0.29) pins Spotless 8.3.0. It configures eclipse("4.19.0") together with toggleOffOn(). When Gradle stores the configuration cache, it serializes the FenceStep, which serializes the Eclipse step nested inside it. On 8.3.0 that step resolved from the P2 update site for 4.19, which Eclipse has since moved to archive.eclipse.org. The serialization then failed with Failed to provision P2 dependencies.

Since 8.10.0 (#1996), every supported JDT version ships an embedded lockfile and resolves from Maven, so this no longer reproduces on main. GTNH buildscript 2.0.30 and later already pin Spotless 8.10.2.

What this PR adds

EclipseJdtFencedConfigurationCacheTest builds the reported setup: eclipse("4.19.0"), which the builder normalizes to 4.19, inside the default spotless:off / spotless:on fence. It uses a P2Provisioner that fails the same way as in the report. It covers both Gradle serialization paths:

  • Roundtrip (configuration cache): store and reload succeed, P2 is never queried, and the reloaded step formats outside the fence while leaving the fenced block untouched.
  • Equality (fingerprinting): P2 is never queried, and two identically configured steps produce the same bytes.

Verification

  • RED: with v4.19.lockfile removed (the behaviour before 8.10.0), both tests fail with java.io.IOException: Failed to provision P2 dependencies, the same error as in the report.
  • GREEN: both tests pass on main. The lib-extra *EclipseJdt* and *EquoBasedStepBuilder* tests (30) and the testlib *FenceStep* and *ConfigurationCacheHackList* tests (8) also pass.
  • :lib-extra:spotlessCheck passes.

CHANGES.md

There is no entry, because this PR only adds a test and changes nothing users can see. Happy to add one if you'd like.

Maintainer edits are allowed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MTr23yN6WXdCKzpsrh94vf

…diffplug#3119)

eclipse("4.19.0") wrapped in toggleOffOn() failed to store the Gradle
configuration cache with "Failed to provision P2 dependencies" on
Spotless 8.3.0: serializing the FenceStep serializes its nested Eclipse
step, which provisioned from the archived 4.19 P2 update site.

Embedded JDT lockfiles (8.10.0, diffplug#1996) route 4.9-4.41 through Maven, so
this no longer reproduces. Lock that in for both Gradle serialization
paths (roundtrip for the configuration cache, equality for
fingerprinting), using a P2 provisioner that fails like the reporter's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MTr23yN6WXdCKzpsrh94vf
@Pankraz76
Pankraz76 marked this pull request as ready for review November 23, 2026 19:04

This branch has not been deployed

No deployments
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