Skip to content
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

Extend publishXToMavenLocal explicit dependencies to all repo tasks #8823

Merged
merged 3 commits into from
Jul 25, 2023

Conversation

ccook-ibm
Copy link
Contributor

@ccook-ibm ccook-ibm commented Jul 21, 2023

Description

Unblocks Gradle publish which was failing due to an undeclared dependency:

> Task :modules:lang-painless:publishNebulaPublicationToTestRepository FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':modules:lang-painless:publishNebulaPublicationToTestRepository' (type 'PublishToMavenRepository').
  - Gradle detected a problem with the following location: '/Users/ccook/IdeaProjects/OpenSearch/modules/lang-painless/build/distributions/lang-painless-3.0.0-SNAPSHOT.pom'.
    
    Reason: Task ':modules:lang-painless:publishNebulaPublicationToTestRepository' uses this output of task ':modules:lang-painless:generatePomFileForShadowPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':modules:lang-painless:generatePomFileForShadowPublication' as an input of ':modules:lang-painless:publishNebulaPublicationToTestRepository'.
      2. Declare an explicit dependency on ':modules:lang-painless:generatePomFileForShadowPublication' from ':modules:lang-painless:publishNebulaPublicationToTestRepository' using Task#dependsOn.
      3. Declare an explicit dependency on ':modules:lang-painless:generatePomFileForShadowPublication' from ':modules:lang-painless:publishNebulaPublicationToTestRepository' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.2.1/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

modules/lang-painless/build.gradle had already expressed the appropriate dependencies for the publishXToMavenLocal tasks. This PR extends dependency expressions to cover all Maven repositories to which the build is configured to publish.

Related Issues

No issue was open for the Gradle publish failure.

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

Signed-off-by: Christopher Cook <ccook@ibm.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@ccook-ibm
Copy link
Contributor Author

ccook-ibm commented Jul 21, 2023

Build failed due to flaky test:

Tests with failures:
 - org.opensearch.index.query.IntervalQueryBuilderTests.testToQuery
REPRODUCE WITH: ./gradlew ':server:test' --tests "org.opensearch.index.query.IntervalQueryBuilderTests.testToQuery" -Dtests.seed=A1E5FA5E6C37D034 -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=es-ES -Dtests.timezone=Africa/Gaborone -Druntime.java=20

org.opensearch.index.query.IntervalQueryBuilderTests > testToQuery FAILED
    java.lang.IllegalArgumentException: Too many disjunctions to expand
        at __randomizedtesting.SeedInfo.seed([A1E5FA5E6C37D034:561EF8601DB415DE]:0)
        at org.apache.lucene.queries.intervals.Disjunctions.pullUp(Disjunctions.java:45)
        at org.apache.lucene.queries.intervals.UnorderedIntervalsSource.pullUpDisjunctions(UnorderedIntervalsSource.java:90)
        at org.apache.lucene.queries.intervals.FilteredIntervalsSource.maxGaps(FilteredIntervalsSource.java:33)
        at org.apache.lucene.queries.intervals.Intervals.maxgaps(Intervals.java:302)
        at org.opensearch.index.query.IntervalBuilder.combineSources(IntervalBuilder.java:173)
        at org.opensearch.index.query.IntervalsSourceProvider$Combine.getSource(IntervalsSourceProvider.java:444)
        at org.opensearch.index.query.IntervalQueryBuilder.doToQuery(IntervalQueryBuilder.java:164)
        at org.opensearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:117)
        at org.opensearch.test.AbstractQueryTestCase.testToQuery(AbstractQueryTestCase.java:448)
        at java.****/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.****/java.lang.reflect.Method.invoke(Method.java:578)
        at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1750)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:938)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:974)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:988)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:48)
        at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
        at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
        at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
        at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
        at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:817)
        at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:468)
        at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:947)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:832)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:883)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:894)
        at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
        at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
        at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
        at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
        at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
        at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
        at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
        at java.****/java.lang.Thread.run(Thread.java:1623)

Related known issue: #8823

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@reta
Copy link
Collaborator

reta commented Jul 25, 2023

@ccook-ibm I am not able to reproduce the issue on Linux:

./gradlew publishNebulaPublicationToTestRepository  --no-build-cache
=======================================                                                                                                                                                                                                                                                                                                               
OpenSearch Build Hamster says Hello!                                                                                                                                                                                                                                                                                                                  
  Gradle Version        : 8.2.1                                                                                                                                            
  OS Info               : Linux 6.2.0-25-generic (amd64)
  JDK Version           : 11 (Ubuntu JDK)               
  JAVA_HOME             : /usr/lib/jvm/java-11-openjdk-amd64                                                                                                                                                                                                                                                                                          
  Random Testing Seed   : 376F9D50D3ED30CA                                           
  In FIPS 140 mode      : false
=======================================                          
...

BUILD SUCCESSFUL in 2m 56s
848 actionable tasks: 839 executed, 9 up-to-date

./gradlew :modules:lang-painless:publishNebulaPublicationToTestRepository --no-build-cache
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.2.1
  OS Info               : Linux 6.2.0-25-generic (amd64)
  JDK Version           : 11 (Ubuntu JDK)
  JAVA_HOME             : /usr/lib/jvm/java-11-openjdk-amd64
  Random Testing Seed   : E4C65C9E3EE31A01
  In FIPS 140 mode      : false
=======================================
....

UILD SUCCESSFUL in 1m 4s
51 actionable tasks: 43 executed, 8 up-to-date

I will recheck Windows shortly

@ccook-ibm
Copy link
Contributor Author

@reta please try reproducing by invoking either the publish or publishAllPublicationsToTestRepository tasks. Those are two which fail on this error, for me. When invoked directly publishNebulaPublicationToTestRepository also succeeds for me.

@reta
Copy link
Collaborator

reta commented Jul 25, 2023

publishAllPublicationsToTestRepository

Fails indeed, confirming

@reta
Copy link
Collaborator

reta commented Jul 25, 2023

@ccook-ibm could you please fix the DCO check? (see please https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin), thank you

@ccook-ibm ccook-ibm force-pushed the fix_maven_publish_task branch from 7370d38 to bf02de3 Compare July 25, 2023 19:19
@ccook-ibm ccook-ibm requested a review from sohami as a code owner July 25, 2023 19:19
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@reta
Copy link
Collaborator

reta commented Jul 25, 2023

Seems like tests are failing, could you please also rebase against mian @ccook-ibm, when you have a chance.

Signed-off-by: Christopher Cook <ccook@ibm.com>
Signed-off-by: ccook-ibm <ccook@ibm.com>
@ccook-ibm
Copy link
Contributor Author

@reta do I need to take any additional steps to backport this to 2.x?

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Merging #8823 (b8a6f5b) into main (6786608) will decrease coverage by 0.05%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #8823      +/-   ##
============================================
- Coverage     71.05%   71.00%   -0.05%     
+ Complexity    57230    57202      -28     
============================================
  Files          4758     4758              
  Lines        269841   269841              
  Branches      39479    39479              
============================================
- Hits         191732   191598     -134     
- Misses        62014    62111      +97     
- Partials      16095    16132      +37     

see 467 files with indirect coverage changes

@reta
Copy link
Collaborator

reta commented Jul 25, 2023

@reta do I need to take any additional steps to backport this to 2.x?

No, it will be done automatically after merge

@reta reta merged commit 96ce9de into opensearch-project:main Jul 25, 2023
@reta reta added the backport 2.x Backport to 2.x branch label Jul 25, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 25, 2023
…8823)

* Extend publishXToMavenLocal explicit dependencies to all repo tasks

Signed-off-by: Christopher Cook <ccook@ibm.com>

* Simplify expression

Signed-off-by: Christopher Cook <ccook@ibm.com>
Signed-off-by: ccook-ibm <ccook@ibm.com>

---------

Signed-off-by: Christopher Cook <ccook@ibm.com>
Signed-off-by: ccook-ibm <ccook@ibm.com>
(cherry picked from commit 96ce9de)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
kotwanikunal pushed a commit that referenced this pull request Jul 25, 2023
…8823) (#8882)

* Extend publishXToMavenLocal explicit dependencies to all repo tasks



* Simplify expression




---------



(cherry picked from commit 96ce9de)

Signed-off-by: Christopher Cook <ccook@ibm.com>
Signed-off-by: ccook-ibm <ccook@ibm.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@ccook-ibm
Copy link
Contributor Author

Thank you @reta

@ccook-ibm ccook-ibm deleted the fix_maven_publish_task branch July 26, 2023 00:17
@reta
Copy link
Collaborator

reta commented Jul 26, 2023

Thank you @reta

Thanks to you @ccook-ibm for contribution!

baba-devv pushed a commit to baba-devv/OpenSearch that referenced this pull request Jul 29, 2023
…pensearch-project#8823)

* Extend publishXToMavenLocal explicit dependencies to all repo tasks

Signed-off-by: Christopher Cook <ccook@ibm.com>

* Simplify expression

Signed-off-by: Christopher Cook <ccook@ibm.com>
Signed-off-by: ccook-ibm <ccook@ibm.com>

---------

Signed-off-by: Christopher Cook <ccook@ibm.com>
Signed-off-by: ccook-ibm <ccook@ibm.com>
kaushalmahi12 pushed a commit to kaushalmahi12/OpenSearch that referenced this pull request Sep 12, 2023
…pensearch-project#8823)

* Extend publishXToMavenLocal explicit dependencies to all repo tasks

Signed-off-by: Christopher Cook <ccook@ibm.com>

* Simplify expression

Signed-off-by: Christopher Cook <ccook@ibm.com>
Signed-off-by: ccook-ibm <ccook@ibm.com>

---------

Signed-off-by: Christopher Cook <ccook@ibm.com>
Signed-off-by: ccook-ibm <ccook@ibm.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
brusic pushed a commit to brusic/OpenSearch that referenced this pull request Sep 25, 2023
…pensearch-project#8823)

* Extend publishXToMavenLocal explicit dependencies to all repo tasks

Signed-off-by: Christopher Cook <ccook@ibm.com>

* Simplify expression

Signed-off-by: Christopher Cook <ccook@ibm.com>
Signed-off-by: ccook-ibm <ccook@ibm.com>

---------

Signed-off-by: Christopher Cook <ccook@ibm.com>
Signed-off-by: ccook-ibm <ccook@ibm.com>
Signed-off-by: Ivan Brusic <ivan.brusic@flocksafety.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…pensearch-project#8823)

* Extend publishXToMavenLocal explicit dependencies to all repo tasks

Signed-off-by: Christopher Cook <ccook@ibm.com>

* Simplify expression

Signed-off-by: Christopher Cook <ccook@ibm.com>
Signed-off-by: ccook-ibm <ccook@ibm.com>

---------

Signed-off-by: Christopher Cook <ccook@ibm.com>
Signed-off-by: ccook-ibm <ccook@ibm.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants