Skip to content

build: parameterise the version with Maven CI-friendly versions - #128

Merged
Mtze merged 1 commit into
mainfrom
phase5/ci-friendly-versions
Aug 26, 2026
Merged

Mtze merged 1 commit into
mainfrom
phase5/ci-friendly-versions

Conversation

@Mtze

@Mtze Mtze commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

The version was hardcoded as 1.2.0-SNAPSHOT in six poms and three Dockerfiles — in COPY paths and in entrypoint scripts. Releasing meant editing nine files by hand, which is why the tag 1.1.0 and the source version 1.2.0-SNAPSHOT had drifted apart entirely.

Now it is one flag:

mvn install                      # 1.2.0-SNAPSHOT, unchanged for local work
mvn install -Drevision=2.3.0     # 2.3.0
docker build --build-arg APP_VERSION=2.3.0 ...

CI passes it automatically via stamp-app-version (EduIDE/.github#2), using the tag the shared workflow already derives — so a release tagged v2.3.0 produces a jar reporting 2.3.0.

Verified by actually building

Not by reading the diff. docker build --build-arg APP_VERSION=9.9.9-test:

Implementation-Title: conversion-webhook
Implementation-Version: 9.9.9-test

and a default build with no --build-arg still succeeds.

That build test found three bugs I would otherwise have shipped:

  1. flatten-maven-plugin was missing. mvn install writes a pom that still contains the literal ${revision}, so the next module cannot resolve its parent:

    Failed to read artifact descriptor for org.eclipse.theia.cloud:common:jar
      Caused by: org.eclipse.theia.cloud:conf:pom:${revision} (absent)
    

    The Dockerfiles build module-by-module with separate mvn invocations, so every one hit this. I had assumed the plugin was unnecessary because nothing is published to a Maven repo; that was wrong.

  2. mvn clean package never received -Drevision. The jar would have been built at the default version while the COPY looked for the requested one.

  3. ARG is per stage. Removing it from the runtime stage broke the COPY --from=builder source path, which is build-time and resolves in the stage that declares it.

The version no longer reaches runtime at all

Each image now copies its jar to a stable name (operator.jar, service.jar, conversion-webhook.jar). That was not cosmetic:

  • the operator and service entrypoints are written by a RUN heredoc with a quoted delimiter, so ${APP_VERSION} would have been written literally into the script and expanded to empty at container start
  • the conversion-webhook ENTRYPOINT is JSON exec form, where Docker never expands variables

Either would have produced a container that builds fine and fails to start.

Also

stamp-app-version: true on the build workflow, and .flattened-pom.xml added to .gitignore.

🤖 Generated with Claude Code

https://claude.ai/code/session_019qeiQRFu8xAMRYWPdZewjG

Summary by CodeRabbit

  • Enhancements

    • Container images now consistently use the application version supplied during builds.
    • Packaged services launch independently of specific versioned filenames, improving compatibility across releases.
    • Version information is synchronized between published images and Java application artifacts.
  • Chores

    • Improved build metadata handling for reliable version management.
    • Added generated build metadata to ignored files to keep source changes clean.

The version was hardcoded as 1.2.0-SNAPSHOT in six poms and three
Dockerfiles, in COPY paths and entrypoint scripts. A release meant editing
nine files, which is why the tag 1.1.0 and the source version had drifted
apart entirely.

Now one flag: mvn -Drevision=2.3.0, or --build-arg APP_VERSION=2.3.0. The
default in the parent pom keeps plain mvn install working unchanged, and
CI passes the derived release tag automatically.

Each image also copies its jar to a stable name, so the version never
reaches runtime. That is not cosmetic: the operator and service
entrypoints are written by a RUN heredoc with a quoted delimiter, so
${APP_VERSION} would be written literally and expand to empty at container
start, and the conversion-webhook ENTRYPOINT is JSON exec form where
Docker never expands variables at all.

Verified by building, not by reading: docker build with
APP_VERSION=9.9.9-test produces a jar reporting
Implementation-Version: 9.9.9-test, and a default build still succeeds.

That test found three bugs. flatten-maven-plugin was missing, so the
installed pom kept the literal ${revision} and the next module could not
resolve its parent - I had wrongly assumed it was unnecessary because
nothing is published to a Maven repo. mvn clean package never received
-Drevision. And ARG is per stage, so removing it from the runtime stage
broke the COPY --from=builder source path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019qeiQRFu8xAMRYWPdZewjG
Copilot AI lite review requested due to automatic review settings August 25, 2026 16:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c640f0c-7690-45a1-b434-485ad5713ac4

📥 Commits

Reviewing files that changed from the base of the PR and between c5a5f62 and b74bdba.

📒 Files selected for processing (11)
  • .github/workflows/build.yml
  • .gitignore
  • dockerfiles/conversion-webhook/Dockerfile
  • dockerfiles/operator/Dockerfile
  • dockerfiles/service/Dockerfile
  • java/common/maven-conf/pom.xml
  • java/common/org.eclipse.theia.cloud.common/pom.xml
  • java/conversion/org.eclipse.theia.cloud.conversion/pom.xml
  • java/operator/org.eclipse.theia.cloud.defaultoperator/pom.xml
  • java/operator/org.eclipse.theia.cloud.operator/pom.xml
  • java/service/org.eclipse.theia.cloud.service/pom.xml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The build now uses a CI-overridable Maven revision. Dockerfiles pass APP_VERSION to Maven and launch stable JAR paths. The build workflow enables application-version stamping. Generated flattened Maven metadata is ignored.

Changes

Versioned build pipeline

Layer / File(s) Summary
Maven revision configuration
java/common/maven-conf/pom.xml, java/common/org.eclipse.theia.cloud.common/pom.xml, java/conversion/..., java/operator/..., java/service/..., .gitignore
The parent POM defines ${revision} and configures flattened metadata. Module versions and internal dependency versions use ${revision}. .flattened-pom.xml is ignored.
Docker version propagation
dockerfiles/conversion-webhook/Dockerfile, dockerfiles/operator/Dockerfile, dockerfiles/service/Dockerfile
Docker builds pass APP_VERSION as the Maven revision. Runtime stages copy versioned artifacts to stable JAR names and launch those names.
CI version stamping
.github/workflows/build.yml
The Docker build workflow receives stamp-app-version: true.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to b74bd

The PR centralizes Maven and Docker version handling while preserving the default build path; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: lukaskratzel

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: parameterizing project versions with Maven CI-friendly versioning. It is concise and related to the Maven, Docker, and CI version propagation changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (11 skipped: 11 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch phase5/ci-friendly-versions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Mtze
Mtze merged commit af30d85 into main Aug 26, 2026
6 checks passed
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.

2 participants