Skip to content

ci: JDK 17+21 matrix verification stage - #3

Merged
wisdommen merged 2 commits into
masterfrom
feature/jdk21-verification-stage
May 26, 2026
Merged

ci: JDK 17+21 matrix verification stage#3
wisdommen merged 2 commits into
masterfrom
feature/jdk21-verification-stage

Conversation

@wisdommen

@wisdommen wisdommen commented May 26, 2026

Copy link
Copy Markdown
Contributor

应用 Phase 13 gate 13-02 定的 JDK 21 verification stage YAML 设计:在已有的 verify job 上加 strategy.matrix.java-version: ['17', '21'] + fail-fast: false。

  • 保留 name / on / permissions 块不动
  • Set up JDK 步骤改用 ${{ matrix.java-version }}
  • cache: maven 保留(跨版本 warm-cache)
  • mvn -B test 和 mvn -B package 都在两个 matrix entry 上跑

单文件 diff +7/-2,与已合并的 UltiCleaner #4 (PR merge commit 9324ae92e) 设计一致。

跟踪 gate: approve 13-03-ultilogin-jdk21-stage-impl

Summary by CodeRabbit

  • Chores
    • Enhanced continuous integration testing to validate application compatibility across multiple Java versions (17 and 21), ensuring broader platform support.

Review Change Stack

Apply the locked Phase 13 gate 13-02 JDK 21 verification-stage YAML design:
add strategy.matrix.java-version: ['17', '21'] with fail-fast: false to
the existing verify job. Preserves name, on, and permissions blocks
verbatim; uses cache: maven (cross-version warm-cache); both mvn -B test
and mvn -B package run on each matrix entry.
@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The Maven CI workflow is updated to run the verification job against multiple Java versions (17 and 21) using a matrix strategy. The actions/setup-java step now dynamically selects the Java version from the matrix instead of using a hardcoded value, and fail-fast is disabled to allow all matrix combinations to execute.

Changes

Maven CI Multi-Version Testing

Layer / File(s) Summary
Java version matrix and strategy configuration
.github/workflows/maven-ci.yml
The verify job strategy introduces a matrix for java-version: ['17', '21'], disables fail-fast, and updates the actions/setup-java step to use ${{ matrix.java-version }} instead of a hardcoded '17' value.

Estimated Code Review Effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly Related PRs

  • UltiKits/UltiLogin#2: Directly precedes this PR by establishing the initial Maven CI workflow with Java 17 setup; this PR expands that foundation to include Java 21 matrix testing.

Poem

A rabbit's workflows leap and bound,
Testing Java, version-round!
Seventeen and twenty-one align,
Matrix magic, oh so fine! 🐰🔄

🚥 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 'ci: JDK 17+21 matrix verification stage' accurately describes the main change: introducing a matrix-driven CI workflow that tests against multiple Java versions (17 and 21).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/jdk21-verification-stage

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 and usage tips.

@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

🤖 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/maven-ci.yml:
- Around line 22-23: The workflow uses floating action refs and leaves checkout
credentials persisted: replace actions/checkout@v4 with the corresponding full
commit SHA and add a "with: persist-credentials: false" option under the
Checkout step, and likewise pin actions/setup-java@v4 to its full commit SHA;
also update the other workflow (publish.yml) to pin actions/setup-java and
actions/setup-node to full commit SHAs so no floating refs remain.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: d812e813-0448-4380-83cc-7b553d6f8772

📥 Commits

Reviewing files that changed from the base of the PR and between 623271d and df49b15.

📒 Files selected for processing (1)
  • .github/workflows/maven-ci.yml

Comment on lines 22 to 23
- name: Checkout
uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Checking GitHub Action refs in workflow files..."
rg -n '^\s*uses:\s*[^@]+@' .github/workflows

echo
echo "Potentially unpinned refs (not 40-hex SHA):"
rg -nP '^\s*uses:\s*[^@]+@(?![a-f0-9]{40}\b).+' .github/workflows || true

echo
echo "Checkout steps missing persist-credentials:false:"
python - <<'PY'
import pathlib, re
for p in pathlib.Path(".github/workflows").glob("*.y*ml"):
    s = p.read_text(encoding="utf-8")
    for m in re.finditer(r'(?ms)^\s*-\s+name:\s*Checkout\b.*?(?=^\s*-\s+name:|\Z)', s):
        block = m.group(0)
        if "persist-credentials: false" not in block:
            line = s[:m.start()].count("\n") + 1
            print(f"{p}:{line}")
PY

Repository: UltiKits/UltiLogin

Length of output: 793


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Checking GitHub Action refs in workflow files..."
rg -n '^\s*uses:\s*[^@]+@' .github/workflows

echo
echo "Potentially unpinned refs (not 40-hex SHA):"
rg -nP '^\s*uses:\s*[^@]+@(?![a-f0-9]{40}\b).+' .github/workflows || true

echo
echo "Checkout steps missing persist-credentials:false:"
python - <<'PY'
import pathlib, re
for p in pathlib.Path(".github/workflows").glob("*.y*ml"):
    s = p.read_text(encoding="utf-8")
    for m in re.finditer(r'(?ms)^\s*-\s+name:\s*Checkout\b.*?(?=^\s*-\s+name:|\Z)', s):
        block = m.group(0)
        if "persist-credentials: false" not in block:
            line = s[:m.start()].count("\n") + 1
            print(f"{p}:{line}")
PY

Repository: UltiKits/UltiLogin

Length of output: 793


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Checking GitHub Action refs in workflow files..."
rg -n '^\s*uses:\s*[^@]+@' .github/workflows

echo
echo "Potentially unpinned refs (not 40-hex SHA):"
rg -nP '^\s*uses:\s*[^@]+@(?![a-f0-9]{40}\b).+' .github/workflows || true

echo
echo "Checkout steps missing persist-credentials:false:"
python - <<'PY'
import pathlib, re
for p in pathlib.Path(".github/workflows").glob("*.y*ml"):
    s = p.read_text(encoding="utf-8")
    for m in re.finditer(r'(?ms)^\s*-\s+name:\s*Checkout\b.*?(?=^\s*-\s+name:|\Z)', s):
        block = m.group(0)
        if "persist-credentials: false" not in block:
            line = s[:m.start()].count("\n") + 1
            print(f"{p}:{line}")
PY

Repository: UltiKits/UltiLogin

Length of output: 793


Harden GitHub Actions workflow action security (pin SHAs + disable checkout credential persistence).

  • .github/workflows/maven-ci.yml: floating actions/checkout@v4 + actions/setup-java@v4; Checkout step (line 22) is missing with: persist-credentials: false.
  • .github/workflows/publish.yml: floating actions/setup-java@v4 and actions/setup-node@v4.
Suggested patch (maven-ci.yml)
       - name: Checkout
-        uses: actions/checkout@v4
+        uses: actions/checkout@<FULL_LENGTH_COMMIT_SHA>
+        with:
+          persist-credentials: false

       - name: Set up JDK ${{ matrix.java-version }}
-        uses: actions/setup-java@v4
+        uses: actions/setup-java@<FULL_LENGTH_COMMIT_SHA>
         with:
           distribution: temurin
           java-version: ${{ matrix.java-version }}
           cache: maven

Pin actions/* in publish.yml to full commit SHAs as well to eliminate floating refs.

🧰 Tools
🪛 zizmor (1.25.2)

[warning] 22-23: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 23-23: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 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/maven-ci.yml around lines 22 - 23, The workflow uses
floating action refs and leaves checkout credentials persisted: replace
actions/checkout@v4 with the corresponding full commit SHA and add a "with:
persist-credentials: false" option under the Checkout step, and likewise pin
actions/setup-java@v4 to its full commit SHA; also update the other workflow
(publish.yml) to pin actions/setup-java and actions/setup-node to full commit
SHAs so no floating refs remain.

@wisdommen
wisdommen merged commit ac360f9 into master May 26, 2026
5 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.

1 participant