Point TestKit test fixtures at the Code Genome Project - #472
Merged
Conversation
The main build resolves org.openrewrite from CGP, but the builds TestKit launches still resolved the versions it pinned from Maven Central and the Sonatype snapshots repository, which breaks once rewrite stops publishing snapshots there. Thread the codegenome credentials into the test JVMs, render the fixture repositories from them, and collapse the 34 inline repository blocks onto that one fixture. Without the credentials, as on fork pull requests, the fixtures fall back to Maven Central plus Sonatype snapshots. Fixes #471
Maven Central was still asked for every org.openrewrite snapshot before the fallthrough to CGP, 234 misses in the last run. Order CGP first and, where the Gradle under test supports repository content filtering, scope it to org.openrewrite so everything else still comes from Central.
On Gradle 4.10 the repository cannot be scoped to org.openrewrite, so putting it first sends every third-party lookup to CGP; that suite ran 37% slower. Order it first only where the content filter applies.
timtebeek
marked this pull request as ready for review
August 26, 2026 08:25
MBoegers
approved these changes
Aug 26, 2026
| maven { | ||
| url = uri("https://central.sonatype.com/repository/maven-snapshots") | ||
| } | ||
| ${TestKitRepositories.declarations(24)} |
There was a problem hiding this comment.
I don't like the magic number here. But its is only build tool logic that is invisible to normal users.
Member
Author
There was a problem hiding this comment.
I'll go a step further and say I don't like how Gradle does interpolation in text blocks, which is why we need this. :)
2 tasks
timtebeek
pushed a commit
that referenced
this pull request
Aug 26, 2026
…473) The CGP repository #472 added to the TestKit fixtures is scoped to org[.]openrewrite.*, so io.moderne artifacts are only looked up on Maven Central. jsonrpc 1.0.13 is the first jsonrpc release published only to CGP, and rewrite-core 8.92.0-SNAPSHOT pins it via latest.release, which failed 39 of 58 TestKit tests on the scheduled run with 'Could not find io.moderne:jsonrpc:1.0.13'. Widen the content filter to both groups, matching what plugin/build.gradle.kts already does for the main build.
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 #471.
The main build already resolves
org.openrewritefrom CGP, but the builds TestKit launches resolved the versions it pinned from Maven Central plus the Sonatype snapshots repository. That works only whilerewritedual-publishes; once it stops publishing snapshots to Sonatype, the pinned version exists in no repository the fixtures know about.What changed
plugin/build.gradle.ktspassescodegenomeUsername/codegenomePasswordto everyTesttask as system properties. It uses aCommandLineArgumentProviderwith no annotated inputs, so the credentials stay out of the task input fingerprint. CI already exports both asORG_GRADLE_PROJECT_*, so no workflow change was needed.GradleFixtures.REPOSITORIESis credential-aware. With the properties present it emits the credentialed CGP repository; without them it emits today's Maven Central plus Sonatype snapshots, which keeps fork pull requests building.mavenLocal()stays first either way, so a locally publishedrewritebuild still wins.org[.]openrewrite.*and goes ahead of Central. Ordering it after Central left 234 requests in place as 404s in the first run on this branch. The Gradle 4.10 suite has no filtering API, so there CGP goes last instead; putting an unscoped credentialed repository first sent every third-party lookup through it and ran that suite 37% slower.TestKitRepositoriesnext toGradleProjectSpec, which lets thesettings.gradlethatGradleProjectSpecgenerates use it too. That was the last remaining Sonatype reference in the test tree.What the green run shows
Gradle's own resolution in the sub-builds now goes to CGP: 458 requests to
artifacts.codegenomeproject.org, and the 11 remaining Sonatype snapshot requests all come from the main build's ownorg.openrewrite.tools:jgitandrewrite-polyglotdependencies, not from the fixtures.Maven Central still sees 238
org/openrewrite/requests, down from 443, and they are no longer Gradle resolving the fixture repositories::rewriteRun/:rewriteDryRun, OpenRewrite's own pom downloader probes Central for the same snapshots and 404s; it does not go through Gradle's repository content filters. The tasks succeed regardless, and this is untouched by the fixture change.latest.release/latest.integrationcrawl also has to list versions on every repository, Central included.Verification
Locally with CGP credentials,
RewriteRunTest.gradleDependencyManagement, which asserts the exact text of the generatedbuild.gradle, passes; that confirms the rendered block matches at both indents and that the emitted repository DSL is valid. The rest of the suite hits Maven CentralHTTP 429from my machine for third-party artifacts (AGP, Lombok, Checkstyle,rewrite-testing-frameworks), so those were left to CI, which is green.Both long CI runs on this branch stalled for 47 and 64 minutes storing a build cache entry, on
community.develocity.cloudconnection timeouts. That is unrelated to this change; the per-suite times are in line with the baseline.Left out
The three fixtures that request recipe artifacts at
latest.release/latest.integrationstill do. Pinning them would cut request volume sharply, as the issue notes, but it also freezes each one against a rewrite runtime that keeps moving, so it seemed worth a separate decision.