-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[Backport main] [3.4] Prevent use of shared distribution on gradle builds #20228
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
base: main
Are you sure you want to change the base?
Conversation
* Prevent use of shared distribution on gradle builds Signed-off-by: Daniel Widdis <[email protected]> * Test the new workaround condition Signed-off-by: Daniel Widdis <[email protected]> --------- Signed-off-by: Daniel Widdis <[email protected]> (cherry picked from commit 0033614) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
WalkthroughThe PR modifies test cluster and distro selection logic across two files: a test assertion for custom distro validation is inverted to check for existence rather than absence, and the shared distribution selection logic is disabled to unconditionally force usage of the working directory distro path. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
Seeing #20227 should we wait on this PR and have a permanent fix ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java (1)
590-596: Workaround disables shared distribution — consider cleanup and documentation.The unconditional
return falseprevents shared distribution usage on all platforms, forcing custom distro creation in the working directory. While the workaround addresses a Gradle 8.6+ JVM GC logging issue, consider:
- Commented code: Remove the commented logic or move it to a dedicated issue/TODO if this is temporary
- Performance note: Document that this increases disk I/O and space usage since each test cluster now receives its own distro copy
- Tracking: Ensure there's an issue to revisit this once the root cause is resolved
Apply this diff to clean up the commented code:
private boolean canUseSharedDistribution() { - // using original location can be too long due to MAX_PATH restrictions on windows CI - // TODO revisit when moving to shorter paths on CI by using Teamcity - // return OS.current() != OS.WINDOWS && extraJarFiles.size() == 0 && modules.size() == 0 && plugins.size() == 0; // Workaround on Gradle 8.6+ due to JVM GC logging to OpenSearch execution directory in immutable workspace + // TODO: Restore conditional logic once Gradle GC logging issue is resolved (see #20227) return false; }buildSrc/src/integTest/groovy/org/opensearch/gradle/TestClustersPluginFuncTest.groovy (1)
123-128: Method name contradicts its behavior — refactor for clarity.The method
assertNoCustomDistronow asserts that the custom distro folder exists, which is the opposite of what the name implies. This contradicts the method's intent and could confuse future maintainers.Consider one of these approaches:
Option 1: Rename the method to reflect current behavior
- boolean assertNoCustomDistro(String clusterName) { + boolean assertCustomDistro(String clusterName) { // Temporarily disabled, see https://github.com/opensearch-project/OpenSearch/pull/20227 // assert !customDistroFolder(clusterName).exists() assert customDistroFolder(clusterName).exists() true }And update the call site on line 82:
- assertNoCustomDistro('myCluster') + assertCustomDistro('myCluster')Option 2: Keep both behaviors and switch based on a flag
boolean assertNoCustomDistro(String clusterName) { // Temporarily expect custom distro due to shared distribution being disabled (PR #20227) boolean expectCustomDistro = true // TODO: Set to false once shared distribution is re-enabled if (expectCustomDistro) { assert customDistroFolder(clusterName).exists() } else { assert !customDistroFolder(clusterName).exists() } true }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
buildSrc/src/integTest/groovy/org/opensearch/gradle/TestClustersPluginFuncTest.groovy(1 hunks)buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java(1 hunks)
⏰ 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: precommit (25, windows-latest)
- GitHub Check: precommit (25, macos-15)
- GitHub Check: precommit (21, macos-15-intel)
- GitHub Check: precommit (25, macos-15-intel)
- GitHub Check: precommit (25, ubuntu-latest)
- GitHub Check: precommit (21, ubuntu-latest)
- GitHub Check: precommit (25, ubuntu-24.04-arm)
- GitHub Check: precommit (21, windows-2025, true)
- GitHub Check: precommit (21, windows-latest)
- GitHub Check: precommit (21, macos-15)
- GitHub Check: precommit (21, ubuntu-24.04-arm)
- GitHub Check: assemble (25, ubuntu-latest)
- GitHub Check: assemble (21, ubuntu-24.04-arm)
- GitHub Check: assemble (25, ubuntu-24.04-arm)
- GitHub Check: assemble (21, windows-latest)
- GitHub Check: assemble (25, windows-latest)
- GitHub Check: assemble (21, ubuntu-latest)
- GitHub Check: Analyze (java)
- GitHub Check: detect-breaking-change
Yes, that was what I was just coming here to say! Let's take our time and try to find a better solution by 3.5. My only thought on having this on main is to prevent future merge conflicts for the permanent fix if we ever have a need to backport to 3.4 for a patch release ... and to allow CCR integ tests (without security) to pass until we fix it. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #20228 +/- ##
============================================
+ Coverage 72.82% 73.28% +0.46%
- Complexity 71315 71814 +499
============================================
Files 5795 5795
Lines 328297 328302 +5
Branches 47282 47283 +1
============================================
+ Hits 239089 240612 +1523
+ Misses 69893 68431 -1462
+ Partials 19315 19259 -56 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dbwiddis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better fix: #20229
|
Put to draft to see if #20229 can be merged for permanent fix. Thanks. |
Backport 0033614 from #20227.
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.