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

Publish CCR zip to maven repo #399

Merged
merged 1 commit into from
Jun 27, 2022
Merged

Publish CCR zip to maven repo #399

merged 1 commit into from
Jun 27, 2022

Conversation

ankitkala
Copy link
Member

@ankitkala ankitkala commented May 17, 2022

Signed-off-by: Ankit Kala ankikala@amazon.com

Description

Publish CCR zip to maven repo

Depends on https://github.com/opensearch-project/cross-cluster-replication/pull/398/files

Issues Resolved

#384

###Testing done.
Verifed the zips in build/local-staging-repo/org/opensearch/plugin/opensearch-cross-cluster-replication

88665a0f606e:cross-cluster-replication ankikala$ ls build/local-staging-repo/org/opensearch/plugin/opensearch-cross-cluster-replication/2.0.0.0-SNAPSHOT/
maven-metadata.xml
maven-metadata.xml.md5
maven-metadata.xml.sha1
maven-metadata.xml.sha256
maven-metadata.xml.sha512
opensearch-cross-cluster-replication-2.0.0.0-20220517.115038-1.pom
opensearch-cross-cluster-replication-2.0.0.0-20220517.115038-1.pom.md5
opensearch-cross-cluster-replication-2.0.0.0-20220517.115038-1.pom.sha1
opensearch-cross-cluster-replication-2.0.0.0-20220517.115038-1.pom.sha256
opensearch-cross-cluster-replication-2.0.0.0-20220517.115038-1.pom.sha512
opensearch-cross-cluster-replication-2.0.0.0-20220517.115038-1.zip
opensearch-cross-cluster-replication-2.0.0.0-20220517.115038-1.zip.md5
opensearch-cross-cluster-replication-2.0.0.0-20220517.115038-1.zip.sha1
opensearch-cross-cluster-replication-2.0.0.0-20220517.115038-1.zip.sha256
opensearch-cross-cluster-replication-2.0.0.0-20220517.115038-1.zip.sha512
opensearch-cross-cluster-replication-2.0.0.0-20220517.115758-2.pom
opensearch-cross-cluster-replication-2.0.0.0-20220517.115758-2.pom.md5
opensearch-cross-cluster-replication-2.0.0.0-20220517.115758-2.pom.sha1
opensearch-cross-cluster-replication-2.0.0.0-20220517.115758-2.pom.sha256
opensearch-cross-cluster-replication-2.0.0.0-20220517.115758-2.pom.sha512
opensearch-cross-cluster-replication-2.0.0.0-20220517.115758-2.zip
opensearch-cross-cluster-replication-2.0.0.0-20220517.115758-2.zip.md5
opensearch-cross-cluster-replication-2.0.0.0-20220517.115758-2.zip.sha1
opensearch-cross-cluster-replication-2.0.0.0-20220517.115758-2.zip.sha256
opensearch-cross-cluster-replication-2.0.0.0-20220517.115758-2.zip.sha512
opensearch-cross-cluster-replication-2.0.0.0-20220517.121842-3.pom
opensearch-cross-cluster-replication-2.0.0.0-20220517.121842-3.pom.md5
opensearch-cross-cluster-replication-2.0.0.0-20220517.121842-3.pom.sha1
opensearch-cross-cluster-replication-2.0.0.0-20220517.121842-3.pom.sha256
opensearch-cross-cluster-replication-2.0.0.0-20220517.121842-3.pom.sha512
opensearch-cross-cluster-replication-2.0.0.0-20220517.121842-3.zip
opensearch-cross-cluster-replication-2.0.0.0-20220517.121842-3.zip.md5
opensearch-cross-cluster-replication-2.0.0.0-20220517.121842-3.zip.sha1
opensearch-cross-cluster-replication-2.0.0.0-20220517.121842-3.zip.sha256
opensearch-cross-cluster-replication-2.0.0.0-20220517.121842-3.zip.sha512

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

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.

@ankitkala ankitkala requested a review from a team May 17, 2022 12:52
@ankitkala ankitkala changed the base branch from 2.0 to main May 17, 2022 13:36
@ankitkala
Copy link
Member Author

@prudhvigodithi
Copy link
Member

Hey @ankitkala, please verify the published zips have right POM coordinates, you should be adding

    publications {
        pluginZip(MavenPublication) { publication ->
            pom {
                name = opensearchplugin.name
                description = opensearchplugin.description
                licenses {
                    license {
                        name = "The Apache License, Version 2.0"
                        url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
                    }
                }
                developers {
                    developer {
                        name = "OpenSearch"
                        url = "https://github.com/opensearch-project/cross-cluster-replication"
                    }
                }
            }
        }
    }
}

Example PR: opensearch-project/index-management#366

@ankitkala
Copy link
Member Author

ankitkala commented Jun 17, 2022

Hey @ankitkala, please verify the published zips have right POM coordinates, you should be adding

    publications {
        pluginZip(MavenPublication) { publication ->
            pom {
                name = opensearchplugin.name
                description = opensearchplugin.description
                licenses {
                    license {
                        name = "The Apache License, Version 2.0"
                        url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
                    }
                }
                developers {
                    developer {
                        name = "OpenSearch"
                        url = "https://github.com/opensearch-project/cross-cluster-replication"
                    }
                }
            }
        }
    }
}

Example PR: opensearch-project/index-management#366

@prudhvigodithi
The build fails as the publishing pluginZip already exists.

Cannot add a Publication with name 'pluginZip' as a Publication with that name already exists.

I tried changing the publication name but it again failed with

> Task :validatePluginZipCCRPom FAILED
Execution optimizations have been disabled for task ':validatePluginZipCCRPom' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/Volumes/ws/cross-cluster-replication/build/distributions/opensearch-cross-cluster-replication-2.0.0.0-rc1-SNAPSHOT.pom'. Reason: Task ':validatePluginZipCCRPom' uses this output of task ':generatePomFileForNebulaPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
description is missing in [/Volumes/ws/cross-cluster-replication/build/distributions/opensearch-cross-cluster-replication-2.0.0.0-rc1-SNAPSHOT.pom]

@ankitkala
Copy link
Member Author

Also, do we need to add custom POM extension? Can't the opensearch.pluginzip infer the name,description,license,etc by itself?

Signed-off-by: Ankit Kala <ankikala@amazon.com>
@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2022

Codecov Report

Merging #399 (f1bdb93) into main (cd02e1f) will decrease coverage by 3.72%.
The diff coverage is n/a.

❗ Current head f1bdb93 differs from pull request most recent head 026cfdb. Consider uploading reports for the commit 026cfdb to get more accurate results

@@             Coverage Diff              @@
##               main     #399      +/-   ##
============================================
- Coverage     74.37%   70.64%   -3.73%     
+ Complexity      996      940      -56     
============================================
  Files           141      141              
  Lines          4562     4562              
  Branches        504      504              
============================================
- Hits           3393     3223     -170     
- Misses          849     1022     +173     
+ Partials        320      317       -3     
Impacted Files Coverage Δ
...earch/replication/action/stats/NodeStatsRequest.kt 33.33% <0.00%> (-66.67%) ⬇️
...eplication/action/stats/LeaderNodeStatsResponse.kt 42.85% <0.00%> (-57.15%) ⬇️
.../replication/action/replay/ReplayChangesRequest.kt 50.00% <0.00%> (-50.00%) ⬇️
...arch/replication/metadata/UpdateMetadataRequest.kt 40.90% <0.00%> (-36.37%) ⬇️
...replication/action/index/ReplicateIndexResponse.kt 33.33% <0.00%> (-33.34%) ⬇️
...tion/action/index/block/UpdateIndexBlockRequest.kt 35.00% <0.00%> (-30.00%) ⬇️
...replication/action/stats/AutoFollowStatsRequest.kt 71.42% <0.00%> (-28.58%) ⬇️
...opensearch/replication/seqno/RemoteClusterStats.kt 73.01% <0.00%> (-26.99%) ⬇️
...n/index/ReplicateIndexClusterManagerNodeRequest.kt 29.16% <0.00%> (-25.01%) ⬇️
.../replication/action/index/ReplicateIndexRequest.kt 38.82% <0.00%> (-24.71%) ⬇️
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd02e1f...026cfdb. Read the comment docs.

@ankitkala ankitkala merged commit 0803b86 into opensearch-project:main Jun 27, 2022
@ankitkala ankitkala deleted the plugin_zip branch June 27, 2022 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants