-
Notifications
You must be signed in to change notification settings - Fork 601
fix: configure CodeQL with buildless extraction for java-kotlin #581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Use build-mode: none for java-kotlin to avoid Gradle build issues - Set up Java 17 to ensure Gradle compatibility if needed - Add javascript-typescript analysis for TypeScript source code Fixes CodeQL autobuild failure caused by Gradle 9.2.1 requiring JVM 17+ while autobuild incorrectly selected JVM 8 based on sourceCompatibility.
Greptile SummaryThis PR adds a custom CodeQL workflow configuration that fixes the autobuild failure by using buildless extraction ( Key changes:
The workflow uses matrix strategy with Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant GH as GitHub Actions
participant Runner as Ubuntu Runner
participant Java as Java 17 Setup
participant CodeQL as CodeQL Action
participant Repo as Repository Code
Note over GH,Repo: Triggered on push, PR, or weekly schedule
par Java-Kotlin Analysis
GH->>Runner: Start analyze job (java-kotlin)
Runner->>Repo: Checkout repository
Runner->>Java: Set up Java 17 (Temurin)
Java-->>Runner: Java 17 ready
Runner->>CodeQL: Initialize CodeQL (java-kotlin, build-mode: none)
CodeQL->>Repo: Scan source files without build
CodeQL-->>Runner: Analysis complete
Runner->>CodeQL: Perform CodeQL Analysis
CodeQL->>GH: Upload security events (category: /language:java-kotlin)
and JavaScript-TypeScript Analysis
GH->>Runner: Start analyze job (javascript-typescript)
Runner->>Repo: Checkout repository
Note over Runner,Java: Skip Java setup (not needed)
Runner->>CodeQL: Initialize CodeQL (javascript-typescript, build-mode: none)
CodeQL->>Repo: Scan TypeScript/JavaScript files
CodeQL-->>Runner: Analysis complete
Runner->>CodeQL: Perform CodeQL Analysis
CodeQL->>GH: Upload security events (category: /language:javascript-typescript)
end
GH->>GH: Store security scanning results
|
Greptile found no issues!From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
- Set up Node.js and install dependencies - Build from example/android which includes the library - This allows CodeQL to trace the Kotlin compilation
The gradle-wrapper.jar is not committed to the repo
- Add Gradle caching via setup-java - Add Yarn caching via setup-node - Use lts/* for latest LTS Node version - Use --frozen-lockfile for reproducible installs
The system Gradle 9.2.1 has Kotlin 2.2.x which is incompatible with React Native's gradle-plugin that requires Kotlin 1.9.x. Download the wrapper jar for Gradle 8.10.2 directly instead.
…aching Replaces manual wrapper jar download with the official Gradle action which handles wrapper installation and provides automatic caching.
The wrapper jar is not in the repo, so use the installed Gradle directly instead of relying on the wrapper.
…uild - Matrix strategy for java-kotlin, javascript-typescript, and ruby - Manual build mode for java-kotlin with proper Gradle setup - build-mode: none for JS/TS and Ruby - Updated to codeql-action v4
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
Summary
Fixes CodeQL autobuild failure for java-kotlin analysis.
Problem
The CodeQL autobuild was failing because:
sourceCompatibilitysetting inandroid/build.gradleSolution
.github/workflows/codeql.ymlbuild-mode: none(buildless extraction) which analyzes source code directly without requiring a Gradle buildNote
After merging, you may want to disable GitHub's default code scanning setup in Settings → Code security and analysis to avoid duplicate scans.