Docker: revert rewrite-docker to its state before #8583 - #8636
Merged
Conversation
This was referenced Aug 24, 2026
Closed
timtebeek
added a commit
to openrewrite/rewrite-migrate-java
that referenced
this pull request
Aug 24, 2026
…#1220) openrewrite/rewrite#8636 reverts `rewrite-docker` to its state before #8583, taking `org.openrewrite.docker.internal.ArgumentContents` and `org.openrewrite.docker.trait.ImageName` with it. This recipe imports both, so main stops compiling the moment a snapshot carrying that revert lands. Both were thin. `text`, `textWithVariables` and `containsVariable` walk an argument's contents, and only `getPath()` and `getRegistry()` of `ImageName` were ever read, so they move here as private helpers, registry detection rule and all. Nothing else the recipe reaches for moves in the revert: the tree types, `Docker.File.getGlobalArgs()` and `DockerFrom`'s `getImageName`, `getTag`, `withImageReference` and `withTag` all predate #8583. That also finishes what #1216 started. The recipe now links against no `internal` package and no trait helper, so the Moderne CLI classloader split that #1215 came from has nothing left to split on. Two things the reverted grammar no longer does needed answering: An `ARG` default value's quotes sit inside the text of its literal rather than in the literal's quote style, so `ARG JAVA_VERSION="11"` read back as `"11"` and matched no version. They are taken off on read and put back on write, both no-ops against a version that models the quotes, so this holds either way. `FROM eclipse-temurin:` no longer round-trips, printing as `FROM eclipse-temurin` and failing the parser's own idempotency check. That is upstream and unrelated to this recipe, so the case leaves the no-change rows. Verified against openrewrite/rewrite at 63b15b0b07 built and published locally: all 78 tests of `UpgradeDockerImageVersionTest` pass.
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.
rewrite-docker/to the version merged in Go: stopRemoveUnusedImportsdeleting imports a repository name spells #8582, reverting the 32 commits from Remove unreachable COMMENT handling fromparseText#8583 through Docker: the=that binds a pair is not what ends its value #8629 — the ANTLR grammar rework, the line-scoped lexer flags and theiremit()invariant, argument and heredoc modeling, the image-reference traits (ImageName,DockerImageReference), the parse-time tree assertions, and theUseBuildKitCacheMountsrecipe. No files outsiderewrite-dockerare touched;rewrite-core's only reference to the module is theorg.openrewrite.docker.tree.Docker$Fileclasspath string, which still resolves../gradlew :rewrite-docker:testpasses on the reverted tree. This clears the slate so the work can be reintroduced under review in a separate PR.