Skip to content

ADFA-3224: ensure java is available in PATH when invoking D8#1052

Open
itsaky-adfa wants to merge 4 commits intostagefrom
fix/ADFA-3224
Open

ADFA-3224: ensure java is available in PATH when invoking D8#1052
itsaky-adfa wants to merge 4 commits intostagefrom
fix/ADFA-3224

Conversation

@itsaky-adfa
Copy link
Contributor

@itsaky-adfa itsaky-adfa commented Mar 9, 2026

See ADFA-3224 for more details.

Signed-off-by: Akash Yadav <akashyadav@appdevforall.org>
Signed-off-by: Akash Yadav <akashyadav@appdevforall.org>
@itsaky-adfa itsaky-adfa requested a review from a team March 9, 2026 14:08
@itsaky-adfa itsaky-adfa self-assigned this Mar 9, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 9, 2026

Warning

Rate limit exceeded

@itsaky-adfa has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 41 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9d4aa4f9-bc68-4b67-ae81-12d02dee1650

📥 Commits

Reviewing files that changed from the base of the PR and between 9a9024b and 1011956.

📒 Files selected for processing (1)
  • app/build.gradle.kts
📝 Walkthrough

Walkthrough

The build configuration file is modified to ensure D8 can locate Java by prepending JAVA_HOME/bin to the PATH environment variable during asset-creation operations. Whitespace and indentation adjustments are also made within the same file.

Changes

Cohort / File(s) Summary
Build Environment Configuration
app/build.gradle.kts
Adds PATH environment variable augmentation to include JAVA_HOME/bin before D8 invocations in the asset-creation flow, ensuring Java can be resolved on systems where it is not in the default PATH. Minor stylistic indentation changes included.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With JAVA_HOME in our PATH so clear,
D8 builds now without a fear,
No more lost binaries to find—
The gradle script is redesigned!
Hopping forward, smooth and bright,
Build configurations done just right! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: ensuring Java is available in PATH when invoking D8, which directly matches the implementation in the changeset.
Description check ✅ Passed The description references the associated JIRA ticket (ADFA-3224) which provides context for the change, maintaining relevance to the changeset.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ADFA-3224

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/build.gradle.kts (1)

506-515: Comment says "prepend" but code appends.

The comment on line 507 states "Prepend JAVA_HOME/bin to PATH", but the implementation appends java.home/bin to the end of the existing PATH:

<existing_PATH>:<java.home>/bin

For the stated goal of making java resolvable, this works fine. However, if the intent were to override a potentially incompatible system java, prepending would be necessary.

🔧 Proposed fix to actually prepend (if that's the intent)
 environment(
     "PATH",
-    (System.getenv("PATH")?.let { it + File.pathSeparator } ?: "") +
-        System.getProperty(
-            "java.home",
-        ) + File.separator + "bin",
+    System.getProperty("java.home") + File.separator + "bin" +
+        (System.getenv("PATH")?.let { File.pathSeparator + it } ?: ""),
 )

Alternatively, just fix the comment to say "append" if the current behavior is intentional.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/build.gradle.kts` around lines 506 - 515, The comment claims we "Prepend
JAVA_HOME/bin to PATH" but the environment(...) call currently appends
java.home/bin; either update the comment to "Append JAVA_HOME/bin to PATH" or
change the PATH expression to actually prepend: construct PATH as java.home +
File.separator + "bin" + (File.pathSeparator + existing PATH if present) inside
the environment("PATH", ...) call so that java.home/bin comes before the
existing System.getenv("PATH"); refer to the environment(...) invocation and the
"PATH" / System.getProperty("java.home") usages when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/build.gradle.kts`:
- Around line 506-515: The comment claims we "Prepend JAVA_HOME/bin to PATH" but
the environment(...) call currently appends java.home/bin; either update the
comment to "Append JAVA_HOME/bin to PATH" or change the PATH expression to
actually prepend: construct PATH as java.home + File.separator + "bin" +
(File.pathSeparator + existing PATH if present) inside the environment("PATH",
...) call so that java.home/bin comes before the existing System.getenv("PATH");
refer to the environment(...) invocation and the "PATH" /
System.getProperty("java.home") usages when making the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d0ceceae-e64d-46b3-bb44-bf5cebaa9de5

📥 Commits

Reviewing files that changed from the base of the PR and between 5a56a46 and 9a9024b.

📒 Files selected for processing (1)
  • app/build.gradle.kts

Signed-off-by: Akash Yadav <akashyadav@appdevforall.org>
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