Avoid eager getByName in pom validation plugin#19974
Avoid eager getByName in pom validation plugin#19974andrross merged 1 commit intoopensearch-project:mainfrom
Conversation
The `getByName()` call is eager, which means this can fail non-deterministically if the dependent gradle tasks have not yet been configured. I ran into this error when doing other gradle refactorings. This change avoids the eager call while also avoiding the nested publications.all() call. Signed-off-by: Andrew Ross <andrross@amazon.com>
|
@cwperks @zelinh Can you take a look? You were both involved in the original change here. I did test this locally by removing the lines here in the geospatial plugin and verified that |
Any idea what changed in gradle? I ran into issues updating the security plugin to gradle 9 due to eager loading as well. |
@cwperks I think this is just fragile because there is an implicit dependency between tasks/projects that isn't fully modeled. As I understand it, you need to make sure every thing is lazy to avoid these issues. Alternatively, you can add |
|
❌ Gradle check result for 448b4db: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19974 +/- ##
============================================
+ Coverage 73.25% 73.28% +0.03%
+ Complexity 71612 71602 -10
============================================
Files 5785 5785
Lines 326905 326900 -5
Branches 47280 47280
============================================
+ Hits 239480 239584 +104
+ Misses 68220 68090 -130
- Partials 19205 19226 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
) The `getByName()` call is eager, which means this can fail non-deterministically if the dependent gradle tasks have not yet been configured. I ran into this error when doing other gradle refactorings. This change avoids the eager call while also avoiding the nested publications.all() call. Signed-off-by: Andrew Ross <andrross@amazon.com>
) The `getByName()` call is eager, which means this can fail non-deterministically if the dependent gradle tasks have not yet been configured. I ran into this error when doing other gradle refactorings. This change avoids the eager call while also avoiding the nested publications.all() call. Signed-off-by: Andrew Ross <andrross@amazon.com>
The
getByName()call is eager, which means this can fail non-deterministically if the dependent gradle tasks have not yet been configured. I ran into this error when doing other gradle refactorings. This change avoids the eager call while also avoiding the nested publications.all() call.Check List
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.