Skip to content

Docker: revert rewrite-docker to its state before #8583 - #8636

Merged
timtebeek merged 1 commit into
mainfrom
tim/revert-work-for-later-pr
Aug 24, 2026
Merged

Docker: revert rewrite-docker to its state before #8583#8636
timtebeek merged 1 commit into
mainfrom
tim/revert-work-for-later-pr

Conversation

@timtebeek

@timtebeek timtebeek commented Aug 24, 2026

Copy link
Copy Markdown
Member

./gradlew :rewrite-docker:test passes on the reverted tree. This clears the slate so the work can be reintroduced under review in a separate PR.

Restores the module to the version merged in #8582, undoing the 32 commits
from #8583 through #8629: the ANTLR grammar rework, the line-scoped lexer
flags and their emit() invariant, argument/heredoc modeling, the image
reference traits, and the parse-time tree assertions.
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Aug 24, 2026
@timtebeek
timtebeek merged commit 63b15b0 into main Aug 24, 2026
1 check passed
@timtebeek
timtebeek deleted the tim/revert-work-for-later-pr branch August 24, 2026 08:18
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Aug 24, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant