OpenSearch icon indicating copy to clipboard operation
OpenSearch copied to clipboard

Further simplification of the ZIP publication implementation

Open lukas-vlcek opened this issue 3 years ago • 11 comments

Description

A follow-up of PR https://github.com/opensearch-project/OpenSearch/pull/4156 that brings in further simplification of the ZIP publication implementation and new tests.

It is possible to remove some of the initialization code because the work is already handled by other library under the hood (most likely by NebulaPublishPlugin).

For instance the condition to test the groupId presence: if (groupId == null) was pointless. It was never true. If the project.group is not defined the publication task fails with an exception, if there is a custom groupId value setup in publication config then it overrides the project.group as well. Tests are provided to cover these use cases.

As for the new tests they cover the following cases:

  • verify that the task "publishToMavenLocal" gets expected results. The inspiration for this comes from https://github.com/opensearch-project/opensearch-plugin-template-java/pull/35

  • verify that applying only the 'opensearch.pluginzip' is enough, because both the NebulaPublish and MavenPublishPlugin plugins are added explicitly and tasks are chained correctly

  • verify that if the plugin is applied but no publication is defined then a message is printed for the user

Check List

  • [x] New functionality includes testing.
    • [ ] All tests pass
  • [x] New functionality has been documented.
    • [x] New functionality has javadoc added
  • [x] Commits are signed per the DCO using --signoff
  • [x] 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: Lukáš Vlček [email protected]

lukas-vlcek avatar Aug 31 '22 16:08 lukas-vlcek

Gradle Check (Jenkins) Run Completed with:

  • RESULT: SUCCESS :white_check_mark:
  • URL: https://build.ci.opensearch.org/job/gradle-check/2355/
  • CommitID: cd66b1ca79c81b5a2bfcf2eeeff2cc558c30e071

github-actions[bot] avatar Aug 31 '22 17:08 github-actions[bot]

Gradle Check (Jenkins) Run Completed with:

  • RESULT: FAILURE :x:
  • URL: https://build.ci.opensearch.org/job/gradle-check/2357/
  • CommitID: e68289ef9e2629cbc7ac51a127423aea17eff34e

github-actions[bot] avatar Aug 31 '22 17:08 github-actions[bot]

Gradle Check (Jenkins) Run Completed with:

  • RESULT: FAILURE :x:
  • URL: https://build.ci.opensearch.org/job/gradle-check/2970/
  • CommitID: 91a3fac63e1188af61638bc339be396cfadc99d1

github-actions[bot] avatar Sep 12 '22 15:09 github-actions[bot]

Gradle Check (Jenkins) Run Completed with:

  • RESULT: FAILURE :x:
  • URL: https://build.ci.opensearch.org/job/gradle-check/2971/
  • CommitID: 0726375d8578137e98c0caff658e6733330add99

github-actions[bot] avatar Sep 12 '22 15:09 github-actions[bot]

I updated the PR, please have a look at it. I think I am getting very close to final shape. It has grown a bit bigger than I expected but hopefully it was worth it.

lukas-vlcek avatar Sep 13 '22 22:09 lukas-vlcek

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE :x:
  • URL: https://build.ci.opensearch.org/job/gradle-check/3047/
  • CommitID: 49ce45b02fce622bc59c39c53bfdb447d58c2fb6

github-actions[bot] avatar Sep 13 '22 22:09 github-actions[bot]

@reta @prudhvigodithi PTAL, I would like to get your review.

lukas-vlcek avatar Sep 21 '22 13:09 lukas-vlcek

Gradle Check (Jenkins) Run Completed with:

  • RESULT: FAILURE :x:
  • URL: https://build.ci.opensearch.org/job/gradle-check/3289/
  • CommitID: d80aa9bb06f77c5a94c56981a038eb3d661f9297

github-actions[bot] avatar Sep 21 '22 13:09 github-actions[bot]

Hey @lukas-vlcek Sure I will take at this shortly, thanks, we should keep in mind about this update https://github.com/opensearch-project/opensearch-build/issues/2521 :)

prudhvigodithi avatar Sep 21 '22 13:09 prudhvigodithi

Gradle Check (Jenkins) Run Completed with:

  • RESULT: SUCCESS :white_check_mark:
  • URL: https://build.ci.opensearch.org/job/gradle-check/3290/
  • CommitID: 9557b10a3755b8919fc87fb10473b9135cec350a

github-actions[bot] avatar Sep 21 '22 14:09 github-actions[bot]

Codecov Report

Merging #4360 (6fe9261) into main (bb47419) will increase coverage by 0.15%. The diff coverage is 8.33%.

@@             Coverage Diff              @@
##               main    #4360      +/-   ##
============================================
+ Coverage     70.55%   70.70%   +0.15%     
- Complexity    57432    57518      +86     
============================================
  Files          4635     4635              
  Lines        276645   276642       -3     
  Branches      40489    40489              
============================================
+ Hits         195180   195598     +418     
+ Misses        65094    64571     -523     
- Partials      16371    16473     +102     
Impacted Files Coverage Δ
.../java/org/opensearch/gradle/pluginzip/Publish.java 12.19% <8.33%> (+12.19%) :arrow_up:
.../opensearch/client/indices/CloseIndexResponse.java 42.50% <0.00%> (-48.75%) :arrow_down:
.../admin/cluster/reroute/ClusterRerouteResponse.java 60.00% <0.00%> (-40.00%) :arrow_down:
...h/action/ingest/SimulateDocumentVerboseResult.java 60.71% <0.00%> (-39.29%) :arrow_down:
...luster/routing/allocation/RoutingExplanations.java 62.06% <0.00%> (-37.94%) :arrow_down:
...ensearch/client/indices/DetailAnalyzeResponse.java 20.54% <0.00%> (-34.25%) :arrow_down:
...search/search/aggregations/pipeline/EwmaModel.java 24.44% <0.00%> (-33.34%) :arrow_down:
...cluster/routing/allocation/RerouteExplanation.java 70.00% <0.00%> (-30.00%) :arrow_down:
.../opensearch/client/indices/GetMappingsRequest.java 58.82% <0.00%> (-23.53%) :arrow_down:
...earch/client/indices/GetIndexTemplatesRequest.java 50.00% <0.00%> (-23.08%) :arrow_down:
... and 501 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Sep 21 '22 14:09 codecov-commenter

Gradle Check (Jenkins) Run Completed with:

  • RESULT: SUCCESS :white_check_mark:
  • URL: https://build.ci.opensearch.org/job/gradle-check/3392/
  • CommitID: 6fe9261bdfa98cb0ebeac6d6f4d9b3cff16dc1be

github-actions[bot] avatar Sep 26 '22 08:09 github-actions[bot]

Hey @lukas-vlcek thanks again, I have done few tests from my end as well https://github.com/opensearch-project/opensearch-build/issues/2664, I see there is a conflict for CHANGELOG.md, can you please take care? @dblock @reta you guys ok with this PR? @bbarani Thank you

prudhvigodithi avatar Sep 27 '22 16:09 prudhvigodithi

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE :x:
  • URL: https://build.ci.opensearch.org/job/gradle-check/3482/
  • CommitID: 0f9c4cbfc0090c925c8b201ac5a6853e95498bba

github-actions[bot] avatar Sep 27 '22 17:09 github-actions[bot]

Gradle Check (Jenkins) Run Completed with:

  • RESULT: SUCCESS :white_check_mark:
  • URL: https://build.ci.opensearch.org/job/gradle-check/3496/
  • CommitID: 0f9c4cbfc0090c925c8b201ac5a6853e95498bba

github-actions[bot] avatar Sep 27 '22 19:09 github-actions[bot]

Hey @lukas-vlcek can you please raise a back-port PR to 2.x, that includes changes related to this PR and https://github.com/opensearch-project/OpenSearch/pull/4156? Thank you

prudhvigodithi avatar Sep 27 '22 20:09 prudhvigodithi

@prudhvigodithi Thanks. I will raise back-port PRs very soon (we have holidays today).

lukas-vlcek avatar Sep 28 '22 06:09 lukas-vlcek