Skip to content

Fix Sonar analysis by using JDK 21 - #367

Merged
Prafulrakhade merged 1 commit into
mosip:developfrom
amanbh321:aman-fix-sonar-java21
Jul 23, 2026
Merged

Fix Sonar analysis by using JDK 21#367
Prafulrakhade merged 1 commit into
mosip:developfrom
amanbh321:aman-fix-sonar-java21

Conversation

@amanbh321

@amanbh321 amanbh321 commented Jul 23, 2026

Copy link
Copy Markdown

Root cause: gradlew-sonar-analysis.yml did not explicitly configure a JDK, so Sonar analysis ran with the GitHub runner's default Java 17. SonarCloud now requires Java 21+ for analysis.

Fix: Added an explicit actions/setup-java step to configure Temurin JDK 21 before running ./gradlew build sonarqube

Summary by CodeRabbit

  • Chores
    • Updated the code analysis workflow to use Java 21.
    • Enabled Gradle dependency caching during analysis.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@amanbh321, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c2c29c26-15be-4e0d-b905-4bcb97fcabc6

📥 Commits

Reviewing files that changed from the base of the PR and between 5479c3f and 418d66e.

📒 Files selected for processing (1)
  • .github/workflows/gradlew-sonar-analysis.yml

Walkthrough

The Sonar analysis workflow now explicitly installs Temurin JDK 21 through actions/setup-java@v4 and enables Gradle caching for subsequent tasks.

Changes

Sonar Analysis Workflow

Layer / File(s) Summary
Configure JDK 21 for Sonar analysis
.github/workflows/gradlew-sonar-analysis.yml
Adds a Java 21 setup step using Temurin distribution and enables Gradle caching before Gradle/Sonar execution.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

Java twenty-one takes flight,
Sonar scans in cached delight.
Temurin stands ready and bright,
Gradle rolls through the build tonight.

🚥 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 clearly matches the main change: configuring JDK 21 for Sonar analysis.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@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/gradlew-sonar-analysis.yml:
- Line 41: Update the actions/setup-java step in the workflow to reference a
reviewed 40-character commit SHA instead of the mutable `@v4` tag, and add an
inline comment identifying the corresponding action version for traceability.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 43a4afb0-b40a-4646-8b3b-d78873466a20

📥 Commits

Reviewing files that changed from the base of the PR and between db0740a and 5479c3f.

📒 Files selected for processing (1)
  • .github/workflows/gradlew-sonar-analysis.yml

Comment thread .github/workflows/gradlew-sonar-analysis.yml
Signed-off-by: amanbh321 <Aman.Bahuguna@iiitb.ac.in>
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.

2 participants