Skip to content

Conversation

@dbwiddis
Copy link
Member

@dbwiddis dbwiddis commented Dec 14, 2025

Description

Modified OpenSearchNode binary execution directory from getDistroDir() to workingDir.toFile() so that all OpenSearch bin scripts run from the node's working directory instead of the Gradle cache directory.

Changed the Unix executable to use absolute paths since we changed the working directory.

Related Issues

Check List

  • Functionality includes testing.
  • [ ] API changes companion pull request created, if applicable.
  • [ ] Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed test cluster startup to run tools from the node working directory and use explicit bin script paths, preventing failures when run in immutable or cached build directories.

✏️ Tip: You can customize this high-level summary in your review settings.

@dbwiddis dbwiddis requested a review from a team as a code owner December 14, 2025 01:02
@dbwiddis dbwiddis added the Build Build Tasks/Gradle Plugin, groovy scripts, build tools, Javadoc enforcement. label Dec 14, 2025
@github-actions github-actions bot added the bug Something isn't working label Dec 14, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 14, 2025

Walkthrough

Adjusted OpenSearchNode's script execution so the binary is resolved from the distribution's bin directory and the process runs from the node's working directory instead of the distro/Gradle cache directory, preventing writes into the immutable Gradle transform cache.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md
Added changelog entry noting the fix: OpenSearchNode now avoids executing in the immutable Gradle cache directory.
Script execution logic
buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java
Resolve tools from getDistroDir()/bin and change process working directory to the node's workingDir; on Windows use cmd with the resolved .bat absolute path and pass that path as an argument.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify Unix and Windows path construction uses the correct distro bin directory and produces absolute paths.
  • Confirm process is launched with workingDir set to the node's working directory and that no files are written to the distro/Gradle cache.
  • Run integ tests on Linux/macOS to ensure Gradle immutable workspace is no longer modified.

Poem

🐰 I hopped where scripts once wandered free,

Now they run in burrows made for me.
No more scratches in the cache so deep,
Logs stay home — the transform keeps.
A tiny fix, a tidy leap! 🥕

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the primary fix: adjusting OpenSearchNode's working directory to prevent executing in the immutable Gradle cache directory.
Description check ✅ Passed The PR description follows the template structure, clearly explaining the changes made, related issues, and confirming testing is included and licensing terms are accepted.
Linked Issues check ✅ Passed The PR correctly addresses issue #20226 by changing the working directory from the immutable Gradle cache (getDistroDir) to the node's working directory, eliminating the root cause of cache corruption when executing OpenSearch bin scripts.
Out of Scope Changes check ✅ Passed All code changes are directly related to fixing the issue: modifying the working directory and updating Unix executable paths to use absolute paths, with no unrelated changes introduced.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c0e7db and 35c5865.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: gradle-check
  • GitHub Check: detect-breaking-change
  • GitHub Check: assemble (21, windows-latest)
  • GitHub Check: assemble (25, ubuntu-24.04-arm)
  • GitHub Check: Analyze (java)
  • GitHub Check: assemble (25, windows-latest)
  • GitHub Check: assemble (25, ubuntu-latest)
  • GitHub Check: assemble (21, ubuntu-latest)
  • GitHub Check: assemble (21, ubuntu-24.04-arm)
  • GitHub Check: precommit (25, ubuntu-24.04-arm)
  • GitHub Check: precommit (25, windows-latest)
  • GitHub Check: precommit (21, windows-2025, true)
  • GitHub Check: precommit (25, macos-15-intel)
  • GitHub Check: precommit (21, ubuntu-24.04-arm)
  • GitHub Check: precommit (21, ubuntu-latest)
  • GitHub Check: precommit (21, macos-15)
  • GitHub Check: precommit (25, ubuntu-latest)
  • GitHub Check: precommit (21, macos-15-intel)
  • GitHub Check: precommit (25, macos-15)
  • GitHub Check: precommit (21, windows-latest)

Comment @coderabbitai help to get the list of available commands and usage tips.

…ble Gradle cache directory

Signed-off-by: Daniel Widdis <[email protected]>
@github-actions
Copy link
Contributor

✅ Gradle check result for 35c5865: SUCCESS

@codecov
Copy link

codecov bot commented Dec 14, 2025

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.18%. Comparing base (66ed5cb) to head (35c5865).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...opensearch/gradle/testclusters/OpenSearchNode.java 0.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #20229      +/-   ##
============================================
+ Coverage     72.82%   73.18%   +0.35%     
- Complexity    71315    71771     +456     
============================================
  Files          5795     5795              
  Lines        328297   328306       +9     
  Branches      47282    47283       +1     
============================================
+ Hits         239089   240276    +1187     
+ Misses        69893    68787    -1106     
+ Partials      19315    19243      -72     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Build Build Tasks/Gradle Plugin, groovy scripts, build tools, Javadoc enforcement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] TestClusters plugin corrupts Gradle 9.x transform cache when canUseSharedDistribution() is true

1 participant