ci: switch CodeQL java-kotlin analysis to manual build mode - #3328
Conversation
The CodeQL "Analyze (java-kotlin)" job was failing because the autobuild action could not build the Gradle/Kotlin project (Kotlin compiler crashed under CodeQL's build tracer). This adds an advanced CodeQL workflow that sets java-kotlin's build-mode to "manual", installs Temurin JDK 25 (matching test.yml), and explicitly runs `./gradlew testClasses` so CodeQL traces our own build instead of relying on autobuild's heuristics.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request adds a GitHub Actions CodeQL workflow for Java/Kotlin and JavaScript/TypeScript. It configures event and schedule triggers, language-specific build modes, Java setup, Gradle compilation, and analysis result categories. ChangesCodeQL analysis
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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
🤖 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/codeql.yml:
- Around line 42-43: Update the actions/checkout step in the CodeQL workflow to
set persist-credentials to false before the Gradle build, unless a later
workflow step explicitly requires authenticated Git access.
🪄 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 Plus
Run ID: a3de5be9-fcad-4bb7-b12a-278303ecea3a
📒 Files selected for processing (1)
.github/workflows/codeql.yml
|
|
||
| # Initializes the CodeQL tools for scanning. | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v4 |
There was a problem hiding this comment.
Pin the sha1 and set version in a comment at the end of the line
There was a problem hiding this comment.
Done! Pinned to the SHA (f205ea1c3313d32999d8d6a48b4f6530d4437b38) with the v4.37.4 version as a trailing comment in 532498b.
juherr
left a comment
There was a problem hiding this comment.
Pin sha1 on all actions.
Check coderabbit comments.
| jobs: | ||
| analyze: | ||
| name: Analyze (${{ matrix.language }}) | ||
| runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} |
…unused swift runner - Pin actions/checkout, actions/setup-java, and github/codeql-action/analyze to full commit SHAs with version comments (init was already pinned) - Set persist-credentials: false on the checkout step per CodeRabbit's review - Simplify runs-on to ubuntu-latest since swift is not in the language matrix
|
Thanks for the fix |
Problem
The
Analyze (java-kotlin)CodeQL job was failing onmasterwith:CodeQL's
autobuildmode tried to run./gradlew ... testClassesunder its build tracer, and theKotlin compiler crashed partway through (see the failed run:
Push on master #148). Autobuild'sheuristics aren't a great fit for this multi-module Gradle/Kotlin build.
Fix
This adds an advanced CodeQL workflow (
.github/workflows/codeql.yml) that switches thejava-kotlinlanguage frombuild-mode: autobuildtobuild-mode: manual, and builds theproject ourselves:
actions/setup-java, matching the JDK used to run Gradle intest.yml(jdkBuildVersion=25)../gradlew --no-daemon -PjdkBuildVersion=25 -Dorg.gradle.java.installations.auto-download=false testClassesdirectly as the manual build step, so CodeQL traces our own build instead of autobuild's
heuristics.
javascript-typescriptonbuild-mode: none(no build required), unchanged.Verification
Pushed this change to my fork and confirmed the workflow now completes successfully end to end:
JDK setup, the full Gradle build (all modules compile with only javadoc/lint warnings, no errors),
and the CodeQL analyze step, which finalizes the database and runs all Java queries. Both matrix
jobs (
java-kotlinandjavascript-typescript) finished with status Success in ~8.5 minutes.Summary by CodeRabbit