OF-3326 - Default to Java 21 in Docker, add Java 25 variant#3419
OF-3326 - Default to Java 21 in Docker, add Java 25 variant#3419Fishbowler wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughChangesThis 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, 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
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. Comment |
da6cfbc to
c53dc32
Compare
c53dc32 to
b5154ab
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/continuous-integration-workflow.yml (1)
1299-1303: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winMove 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_TAGSand$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
📒 Files selected for processing (2)
.github/workflows/continuous-integration-workflow.ymlDockerfile
| - 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 }} |
There was a problem hiding this comment.
🗄️ 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)
PYRepository: 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.ymlRepository: 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:
- 1: https://github.com/docker/metadata-action?tab=readme-ov-file
- 2: https://github.com/docker/metadata-action/tree/v6.0.0
- 3: https://github.com/docker/metadata-action/blob/v5/README.md
- 4: https://github.com/docker/metadata-action/blob/0f8c876bafbf5dbce05c36682ec68e9a0274a48a/README.md
- 5: https://github.com/docker/metadata-action/blob/v5.3.0/UPGRADE.md
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.
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
-java21and-java25suffixes to image tags, and defaults the "suffixless" version to Java 21.