ci: add Java 17 Maven verification - #2
Conversation
Align AccountData with the UltiTools BaseDataEntity<String> data operator contract so Java 17 verification passes.
📝 WalkthroughWalkthroughThis PR adds Maven CI/CD infrastructure and refactors the ChangesMaven CI Workflow
AccountData String ID Migration
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/maven-ci.yml (1)
27-28: ⚡ Quick winRedundant test execution increases CI time.
The workflow runs
mvn -B testseparately, but the subsequentmvn -B packagestep already includes the test phase by default. This means tests run twice, doubling the test execution time.If separate test reporting is not required, consider removing this step.
♻️ Remove redundant test step
If you only need the package artifact and test results once:
- - name: Run tests - run: mvn -B test - - name: Build package run: mvn -B packageAlternatively, if you want to skip tests during packaging (after running them separately):
- name: Run tests run: mvn -B test - - name: Build package - run: mvn -B package + - name: Build package (skip tests) + run: mvn -B package -DskipTests🤖 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 27 - 28, The "Run tests" step that executes "mvn -B test" is redundant because the later "mvn -B package" already runs the test phase; remove the entire "Run tests" step (the job/step named "Run tests" that runs "mvn -B test") to avoid double execution, or if you intentionally want a separate test run, change the packaging step ("mvn -B package") to skip tests by adding -DskipTests=true so tests only run once.
🤖 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 20-25: Update the CI workflow to explicitly document that the
build uses JDK 17 but targets Java 8 bytecode (matching pom.xml's
<java.version>1.8</java.version> and maven-compiler-plugin source/target) by
adding a short comment or job step description near the Setup JDK step, and
confirm tests are intended to run under JDK 17; additionally replace the
unpinned actions referenced (actions/checkout@v4 and actions/setup-java@v4) with
their corresponding full commit SHAs to satisfy the unpinned-action policy so
the workflow pins exact commits.
---
Nitpick comments:
In @.github/workflows/maven-ci.yml:
- Around line 27-28: The "Run tests" step that executes "mvn -B test" is
redundant because the later "mvn -B package" already runs the test phase; remove
the entire "Run tests" step (the job/step named "Run tests" that runs "mvn -B
test") to avoid double execution, or if you intentionally want a separate test
run, change the packaging step ("mvn -B package") to skip tests by adding
-DskipTests=true so tests only run once.
🪄 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: 779607a6-a9b3-4fa7-90d5-0c7e79d8b47d
📒 Files selected for processing (4)
.github/workflows/maven-ci.ymlsrc/main/java/com/ultikits/plugins/login/entity/AccountData.javasrc/test/java/com/ultikits/plugins/login/UltiLoginTestHelper.javasrc/test/java/com/ultikits/plugins/login/entity/AccountDataTest.java
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| java-version: '17' | ||
| cache: maven |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify the Java version configuration in pom.xml and confirm JDK 17 compatibility
echo "=== Java version property in pom.xml ==="
grep -A 2 "<java.version>" pom.xml
echo -e "\n=== Maven compiler plugin configuration ==="
grep -A 10 "maven-compiler-plugin" pom.xml | grep -E "(source|target|release)"
echo -e "\n=== Verification ==="
echo "CI uses JDK 17 but pom.xml specifies java.version=1.8"
echo "This will compile to Java 8 bytecode using JDK 17 toolchain"
echo "Confirm this is the intended configuration"Repository: UltiKits/UltiLogin
Length of output: 602
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== CI workflow: .github/workflows/maven-ci.yml uses/actions ==="
sed -n '1,120p' .github/workflows/maven-ci.yml | rg -n "uses:"
echo -e "\n=== CI workflow: JDK step context (around line 20-25) ==="
nl -ba .github/workflows/maven-ci.yml | sed -n '15,35p'
echo -e "\n=== pom.xml: java.version + compiler plugin block ==="
nl -ba pom.xml | rg -n "<java\.version>|maven-compiler-plugin|<source>|\<target\>|<release>|<toolchain>|maven\.compiler\." -n | head -n 80 || true
echo -e "\n=== pom.xml: show compiler plugin section (best-effort) ==="
# Try to print a bounded region around maven-compiler-plugin if present
line=$(rg -n "maven-compiler-plugin" pom.xml | head -n1 | cut -d: -f1 || true)
if [[ -n "${line}" ]]; then
start=$((line-20))
end=$((line+80))
nl -ba pom.xml | sed -n "${start},${end}p"
else
echo "maven-compiler-plugin not found in pom.xml"
fiRepository: UltiKits/UltiLogin
Length of output: 323
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== CI workflow: .github/workflows/maven-ci.yml uses/actions ==="
sed -n '1,120p' .github/workflows/maven-ci.yml | rg -n "uses:"
echo -e "\n=== CI workflow: show lines ~15-40 ==="
cat -n .github/workflows/maven-ci.yml | sed -n '15,45p'
echo -e "\n=== pom.xml: relevant Java/version/compiler settings (best-effort) ==="
cat -n pom.xml | rg -n "<java\.version>|maven-compiler-plugin|<source>|\<target\>|<release>|<toolchain>|maven\.compiler\."Repository: UltiKits/UltiLogin
Length of output: 1002
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== pom.xml: java.version property ==="
rg -n "<java\.version>" pom.xml
echo
rg -n "maven-compiler-plugin" pom.xml
echo
echo "=== pom.xml: compiler source/target/release/toolchain sections (context) ==="
for pat in "<source>" "<target>" "<release>" "toolchain" "<maven.compiler" "maven.compiler"; do
echo "--- pattern: $pat ---"
rg -nF "$pat" pom.xml || true
done
echo
echo "=== pom.xml: show around first maven-compiler-plugin occurrence ==="
line=$(rg -n "maven-compiler-plugin" pom.xml | head -n1 | cut -d: -f1 || true)
if [[ -n "${line}" ]]; then
start=$((line-25))
end=$((line+120))
sed -n "${start},${end}p" pom.xml | nl -ba | head -n 170
else
echo "maven-compiler-plugin not found in pom.xml"
fiRepository: UltiKits/UltiLogin
Length of output: 707
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Workflow actions in .github/workflows/maven-ci.yml ==="
sed -n '1,120p' .github/workflows/maven-ci.yml | rg -n "uses:"
echo
echo "=== pom.xml: show maven-compiler-plugin section with line numbers (bounded) ==="
line=$(rg -n "maven-compiler-plugin" pom.xml | head -n1 | cut -d: -f1)
start=$((line-20))
end=$((line+60))
if [[ "$start" -lt 1 ]]; then start=1; fi
sed -n "${start},${end}p" pom.xml | cat -nRepository: UltiKits/UltiLogin
Length of output: 2871
Document the Java strategy (JDK 17 build targeting Java 8) and pin GitHub Actions
.github/workflows/maven-ci.ymluses JDK 17, whilepom.xmlsets<java.version>1.8</java.version>andmaven-compiler-plugincompiles with<source>${java.version}</source>/<target>${java.version}</target>—this should be explicitly documented as “build with JDK 17, target Java 8 bytecode” (and ensure running tests on JDK 17 is intended).- Both
actions/checkout@v4andactions/setup-java@v4are only pinned to major tags; pin them to full commit SHAs to satisfy the “unpinned action” policy/static analysis.
🧰 Tools
🪛 zizmor (1.25.2)
[error] 21-21: 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 20 - 25, Update the CI workflow
to explicitly document that the build uses JDK 17 but targets Java 8 bytecode
(matching pom.xml's <java.version>1.8</java.version> and maven-compiler-plugin
source/target) by adding a short comment or job step description near the Setup
JDK step, and confirm tests are intended to run under JDK 17; additionally
replace the unpinned actions referenced (actions/checkout@v4 and
actions/setup-java@v4) with their corresponding full commit SHAs to satisfy the
unpinned-action policy so the workflow pins exact commits.
Summary
Verification
Scope
Summary by CodeRabbit
Chores
Tests