Skip to content

OF-3326 - Default to Java 21 in Docker, add Java 25 variant#3419

Open
Fishbowler wants to merge 1 commit into
igniterealtime:mainfrom
Fishbowler:docker-java-25
Open

OF-3326 - Default to Java 21 in Docker, add Java 25 variant#3419
Fishbowler wants to merge 1 commit into
igniterealtime:mainfrom
Fishbowler:docker-java-25

Conversation

@Fishbowler

Copy link
Copy Markdown
Member

Stacked on #3418

Java 21 is LTS, and we've got users using it. This upgrades our default container images to use it.

Changes to Java make a jump to 25 by default too risky for plugins at this point in time, but this adds a 25 variant to our publishing to allow experimentation.

This adds -java21 and -java25 suffixes to image tags, and defaults the "suffixless" version to Java 21.

     Resulting published tags:                                                                                                                                                                                                     
                                                                                                                                                                                                                                   
     ┌────────────────┬───────────────────────┬───────────────┐                                                                                                                                                                    
     │    Trigger     │     Java 21 tags      │  Java 25 tag  │                                                                                                                                                                    
     ├────────────────┼───────────────────────┼───────────────┤                                                                                                                                                                    
     │ push to main   │ main, main-java21     │ main-java25   │                                                                                                                                                                    
     ├────────────────┼───────────────────────┼───────────────┤                                                                                                                                                                    
     │ push to 5.1    │ 5.1, 5.1-java21       │ 5.1-java25    │                                                                                                                                                                    
     ├────────────────┼───────────────────────┼───────────────┤                                                                                                                                                                    
     │ push of v5.1.0 │ v5.1.0, v5.1.0-java21 │ v5.1.0-java25 │                                                                                                                                                                    
     └────────────────┴───────────────────────┴───────────────┘     

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

This pull request parameterizes the Docker build process to support multiple Java runtime versions (21 and 25). The Dockerfile introduces a JAVA_VERSION build argument used across the poms, build, skeleton-runtime, and runtime stages, replacing hardcoded Java 17 base images. The CI workflow's build-docker job now builds against a Java version matrix, tagging and uploading images per Java version. The integration job downloads and retags the Java 21 image specifically. The publish-docker job runs across the same matrix, generating both plain tags (for Java 21 only) and versioned tags (suffixed by Java version) via two metadata-action invocations, then aggregates and pushes images under all resulting tags.

Sequence Diagram(s)

Not applicable — changes are primarily CI workflow configuration and Dockerfile parameterization without new runtime component interactions.

Related PRs: None identified.

Suggested labels: ci, docker, build

Suggested reviewers: Not determinable from provided information.

🐰 A hop through matrices, twenty-one and twenty-five,
Each Java version now gets its tag alive,
Docker images built, published side by side,
No more fixed seventeen, versions now abide.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Description check ✅ Passed The description matches the PR’s Docker and tagging changes, including Java 21 as default and a Java 25 variant.

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.

@Fishbowler Fishbowler marked this pull request as ready for review July 7, 2026 18:41
@Fishbowler Fishbowler changed the title Docker - Default to Java 21, add Java 25 OF-3326 - Default to Java 21 in Docker, add Java 25 variant Jul 7, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/continuous-integration-workflow.yml (1)

1299-1303: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Move the generated tags into env. Line 1302 splices multiline step outputs directly into the shell script; pass them through environment variables first so the script only expands $PLAIN_TAGS and $VERSIONED_TAGS.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/continuous-integration-workflow.yml around lines 1299 -
1303, The tag-pushing shell step is expanding multiline step outputs directly
inside the script, which should be moved into environment variables instead.
Update the Tag and push image step to pass the values from
steps.meta.outputs.tags and steps.meta-versioned.outputs.tags through env (for
example as PLAIN_TAGS and VERSIONED_TAGS), then build ALL_TAGS from those
variables inside the run block; use the existing push step to locate it.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/continuous-integration-workflow.yml:
- Around line 1285-1297: The two docker/metadata-action@v6 steps in the workflow
metadata setup need the semver minor alias added so release images publish both
full tags and minor-version tags. Update the metadata configuration in the
“Extract metadata (plain tags, default Java version only)” step and the “Extract
metadata (versioned tags)” step to include a semver rule using
pattern={{major}}.{{minor}}, and keep the existing java suffix behavior in the
meta-versioned step so it produces tags like 5.1 and 5.1-java25.

---

Nitpick comments:
In @.github/workflows/continuous-integration-workflow.yml:
- Around line 1299-1303: The tag-pushing shell step is expanding multiline step
outputs directly inside the script, which should be moved into environment
variables instead. Update the Tag and push image step to pass the values from
steps.meta.outputs.tags and steps.meta-versioned.outputs.tags through env (for
example as PLAIN_TAGS and VERSIONED_TAGS), then build ALL_TAGS from those
variables inside the run block; use the existing push step to locate it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 48c4c722-8e72-401c-b755-2c1be4d01eaf

📥 Commits

Reviewing files that changed from the base of the PR and between 9c2279d and b5154ab.

📒 Files selected for processing (2)
  • .github/workflows/continuous-integration-workflow.yml
  • Dockerfile

Comment on lines +1285 to +1297
- name: Extract metadata (plain tags, default Java version only)
id: meta
if: ${{ matrix.java == 21 }}
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/igniterealtime/${{ env.IMAGE_NAME }}

- name: Extract metadata (versioned tags)
id: meta-versioned
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/igniterealtime/${{ env.IMAGE_NAME }}
flavor: suffix=-java${{ matrix.java }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify both metadata-action invocations declare the minor semver alias.
python - <<'PY'
from pathlib import Path
text = Path(".github/workflows/continuous-integration-workflow.yml").read_text()
needle = "type=semver,pattern={{major}}.{{minor}}"
count = text.count(needle)
print(f"{needle}: {count}")
raise SystemExit(0 if count >= 2 else 1)
PY

Repository: igniterealtime/Openfire

Length of output: 204


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the workflow around the referenced lines and search for all metadata-action tag definitions.
python3 - <<'PY'
from pathlib import Path
p = Path(".github/workflows/continuous-integration-workflow.yml")
lines = p.read_text().splitlines()
start, end = 1260, 1325
for i in range(start, min(end, len(lines)) + 1):
    print(f"{i:4d}: {lines[i-1]}")
PY

printf '\n--- SEARCH: metadata-action tag patterns ---\n'
rg -n -C 3 'docker/metadata-action@v6|type=semver|flavor:|type=ref,event=tag|type=ref,event=branch' .github/workflows/continuous-integration-workflow.yml

Repository: igniterealtime/Openfire

Length of output: 3793


🌐 Web query:

docker/metadata-action v6 default tags semver minor pattern explicit tags documentation

💡 Result:

In docker/metadata-action v6, the tags input is used to define image tags dynamically [1][2]. Default Tags If the tags input is left empty, the action automatically generates the following tags [1][2]: type=schedule type=ref,event=branch type=ref,event=tag type=ref,event=pr Semver Pattern The type=semver attribute uses Handlebars templates to extract version components from Git tags [3][4]. Common patterns include [2][3]: pattern={{version}}: Uses the full version (e.g., 1.2.3). pattern={{major}}.{{minor}}: Uses the major and minor versions (e.g., 1.2). pattern={{major}}: Uses only the major version (e.g., 1). Explicit Tags You can define explicit (static or custom) tags using the type=raw attribute [2][5]. For example: tags: | type=raw,value=latest type=raw,value=stable # Or simply by listing them: my-custom-tag another-tag Configuration Example The following snippet demonstrates how to combine these in a workflow [1]: steps: - name: Docker meta id: meta uses: docker/metadata-action@v6 with: images: name/app tags: | type=schedule type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=ref,event=branch type=raw,value=latest

Citations:


Add the semver minor alias to both metadata steps. The release images need type=semver,pattern={{major}}.{{minor}} so the workflow publishes 5.1 and 5.1-java25, not just the full version tags.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/continuous-integration-workflow.yml around lines 1285 -
1297, The two docker/metadata-action@v6 steps in the workflow metadata setup
need the semver minor alias added so release images publish both full tags and
minor-version tags. Update the metadata configuration in the “Extract metadata
(plain tags, default Java version only)” step and the “Extract metadata
(versioned tags)” step to include a semver rule using
pattern={{major}}.{{minor}}, and keep the existing java suffix behavior in the
meta-versioned step so it produces tags like 5.1 and 5.1-java25.

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