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

Adding Maven publish WF #11

Merged
merged 4 commits into from
May 23, 2023
Merged

Adding Maven publish WF #11

merged 4 commits into from
May 23, 2023

Conversation

khushbr
Copy link
Collaborator

@khushbr khushbr commented May 23, 2023

Is your feature request related to a problem? Please provide an existing Issue # , or describe.
Adding Maven publish WF, following https://opensearch.org/blog/opensearch-plugin-zips-now-in-maven-repo/ and https://github.com/opensearch-project/opensearch-build/blob/main/ONBOARDING.md

% ./gradlew publishToMavenLocal
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
...
BUILD SUCCESSFUL in 1s
3 actionable tasks: 2 executed, 1 up-to-date

% ls /Users/khushbr/.m2/repository/org/opensearch/performance-analyzer-commons/1.0-SNAPSHOT
maven-metadata-local.xml			performance-analyzer-commons-1.0-SNAPSHOT.jar	performance-analyzer-commons-1.0-SNAPSHOT.pom

Following https://github.com/opensearch-project/opensearch-plugins/blob/main/WORKFLOWS.md#testing, set url to /Users/khushbr/test/

% ls /Users/khushbr/test/org/opensearch/performance-analyzer-commons/1.0.0.0-SNAPSHOT
maven-metadata.xml							performance-analyzer-commons-1.0.0.0-20230523.202721-1.jar.sha256
maven-metadata.xml.md5							performance-analyzer-commons-1.0.0.0-20230523.202721-1.jar.sha512
maven-metadata.xml.sha1							performance-analyzer-commons-1.0.0.0-20230523.202721-1.pom
maven-metadata.xml.sha256						performance-analyzer-commons-1.0.0.0-20230523.202721-1.pom.md5
maven-metadata.xml.sha512						performance-analyzer-commons-1.0.0.0-20230523.202721-1.pom.sha1
performance-analyzer-commons-1.0.0.0-20230523.202721-1.jar		performance-analyzer-commons-1.0.0.0-20230523.202721-1.pom.sha256
performance-analyzer-commons-1.0.0.0-20230523.202721-1.jar.md5		performance-analyzer-commons-1.0.0.0-20230523.202721-1.pom.sha512
performance-analyzer-commons-1.0.0.0-20230523.202721-1.jar.sha1

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.

khushbr added 2 commits May 23, 2023 12:04
Signed-off-by: Khushboo Rajput <khushbr@amazon.com>
Signed-off-by: Khushboo Rajput <khushbr@amazon.com>
Signed-off-by: Khushboo Rajput <khushbr@amazon.com>
@gaiksaya
Copy link
Member

Can you testing the changes? See https://github.com/opensearch-project/opensearch-plugins/blob/main/WORKFLOWS.md#testing for the steps

export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
echo "::add-mask::$SONATYPE_USERNAME"
echo "::add-mask::$SONATYPE_PASSWORD"
./gradlew publish
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should only publish to snapshots repository

@khushbr
Copy link
Collaborator Author

khushbr commented May 23, 2023

Can you testing the changes? See https://github.com/opensearch-project/opensearch-plugins/blob/main/WORKFLOWS.md#testing for the steps

@gaiksaya Wondering how is this different from publishToMavenLocal ?

Following https://github.com/opensearch-project/opensearch-plugins/blob/main/WORKFLOWS.md#testing, set url to
/Users/khushbr/test/


% ls /Users/khushbr/test/org/opensearch/performance-analyzer-commons/1.0-SNAPSHOT
maven-metadata.xml						performance-analyzer-commons-1.0-20230523.200158-1.jar		performance-analyzer-commons-1.0-20230523.200158-1.pom
maven-metadata.xml.md5						performance-analyzer-commons-1.0-20230523.200158-1.jar.md5	performance-analyzer-commons-1.0-20230523.200158-1.pom.md5
maven-metadata.xml.sha1						performance-analyzer-commons-1.0-20230523.200158-1.jar.sha1	performance-analyzer-commons-1.0-20230523.200158-1.pom.sha1
maven-metadata.xml.sha256					performance-analyzer-commons-1.0-20230523.200158-1.jar.sha256	performance-analyzer-commons-1.0-20230523.200158-1.pom.sha256
maven-metadata.xml.sha512					performance-analyzer-commons-1.0-20230523.200158-1.jar.sha512	performance-analyzer-commons-1.0-20230523.200158-1.pom.sha512

@gaiksaya
Copy link
Member

Can you testing the changes? See https://github.com/opensearch-project/opensearch-plugins/blob/main/WORKFLOWS.md#testing for the steps

@gaiksaya Wondering how is this different from publishToMavenLocal ?

Following https://github.com/opensearch-project/opensearch-plugins/blob/main/WORKFLOWS.md#testing, set url to /Users/khushbr/test/


% ls /Users/khushbr/test/org/opensearch/performance-analyzer-commons/1.0-SNAPSHOT
maven-metadata.xml						performance-analyzer-commons-1.0-20230523.200158-1.jar		performance-analyzer-commons-1.0-20230523.200158-1.pom
maven-metadata.xml.md5						performance-analyzer-commons-1.0-20230523.200158-1.jar.md5	performance-analyzer-commons-1.0-20230523.200158-1.pom.md5
maven-metadata.xml.sha1						performance-analyzer-commons-1.0-20230523.200158-1.jar.sha1	performance-analyzer-commons-1.0-20230523.200158-1.pom.sha1
maven-metadata.xml.sha256					performance-analyzer-commons-1.0-20230523.200158-1.jar.sha256	performance-analyzer-commons-1.0-20230523.200158-1.pom.sha256
maven-metadata.xml.sha512					performance-analyzer-commons-1.0-20230523.200158-1.jar.sha512	performance-analyzer-commons-1.0-20230523.200158-1.pom.sha512

Maven local also has generates different kind of metadata.xml. Also above artifacts are missing "SNAPSHOTS" keyword which might lead to failures during upload

…Repository

Signed-off-by: Khushboo Rajput <khushbr@amazon.com>
@khushbr
Copy link
Collaborator Author

khushbr commented May 23, 2023

Can you testing the changes? See https://github.com/opensearch-project/opensearch-plugins/blob/main/WORKFLOWS.md#testing for the steps

@gaiksaya Wondering how is this different from publishToMavenLocal ?
Following https://github.com/opensearch-project/opensearch-plugins/blob/main/WORKFLOWS.md#testing, set url to /Users/khushbr/test/


% ls /Users/khushbr/test/org/opensearch/performance-analyzer-commons/1.0-SNAPSHOT
maven-metadata.xml						performance-analyzer-commons-1.0-20230523.200158-1.jar		performance-analyzer-commons-1.0-20230523.200158-1.pom
maven-metadata.xml.md5						performance-analyzer-commons-1.0-20230523.200158-1.jar.md5	performance-analyzer-commons-1.0-20230523.200158-1.pom.md5
maven-metadata.xml.sha1						performance-analyzer-commons-1.0-20230523.200158-1.jar.sha1	performance-analyzer-commons-1.0-20230523.200158-1.pom.sha1
maven-metadata.xml.sha256					performance-analyzer-commons-1.0-20230523.200158-1.jar.sha256	performance-analyzer-commons-1.0-20230523.200158-1.pom.sha256
maven-metadata.xml.sha512					performance-analyzer-commons-1.0-20230523.200158-1.jar.sha512	performance-analyzer-commons-1.0-20230523.200158-1.pom.sha512

Maven local also has generates different kind of metadata.xml. Also above artifacts are missing "SNAPSHOTS" keyword which might lead to failures during upload

Thank you clarifying, @gaiksaya . Fixed the issue.

@gaiksaya
Copy link
Member

Thanks! Can you also update the comment with new snaphots that are being published? Also, just confirming org.opensearch.performance-analyzer-commons is the right maven coordinates right?
Adding @prudhvigodithi for one more pair of eyes

@prudhvigodithi
Copy link
Member

prudhvigodithi commented May 23, 2023

Does this plugin also generate a Zip file to install apart from the jar? As did notice the following is commented out

distZip {
    archiveName "performance-analyzer-commons-${version}.zip"
}

@khushbr

@khushbr
Copy link
Collaborator Author

khushbr commented May 23, 2023

Thanks! Can you also update the comment with new snaphots that are being published? Also, just confirming org.opensearch.performance-analyzer-commons is the right maven coordinates right? Adding @prudhvigodithi for one more pair of eyes

@gaiksaya The PR description has been updated with the latest snpashots getting published. Adding here as well.

And yes, org.opensearch.performance-analyzer-commons is the right maven location.

% ls /Users/khushbr/test/org/opensearch/performance-analyzer-commons/1.0.0.0-SNAPSHOT
maven-metadata.xml							performance-analyzer-commons-1.0.0.0-20230523.202721-1.jar.sha256
maven-metadata.xml.md5							performance-analyzer-commons-1.0.0.0-20230523.202721-1.jar.sha512
maven-metadata.xml.sha1							performance-analyzer-commons-1.0.0.0-20230523.202721-1.pom
maven-metadata.xml.sha256						performance-analyzer-commons-1.0.0.0-20230523.202721-1.pom.md5
maven-metadata.xml.sha512						performance-analyzer-commons-1.0.0.0-20230523.202721-1.pom.sha1
performance-analyzer-commons-1.0.0.0-20230523.202721-1.jar		performance-analyzer-commons-1.0.0.0-20230523.202721-1.pom.sha256
performance-analyzer-commons-1.0.0.0-20230523.202721-1.jar.md5		performance-analyzer-commons-1.0.0.0-20230523.202721-1.pom.sha512
performance-analyzer-commons-1.0.0.0-20230523.202721-1.jar.sha1

@khushbr
Copy link
Collaborator Author

khushbr commented May 23, 2023

Does this plugin also generate a Zip file to install apart from the jar? As did notice the following is commented out

distZip {
    archiveName "performance-analyzer-commons-${version}.zip"
}

@khushbr

@prudhvigodithi Only the source JAR is required from commons. Curious, any reason to publish a zip here that you are aware?

@khushbr khushbr merged commit 0df56b0 into opensearch-project:main May 23, 2023
@prudhvigodithi
Copy link
Member

Got it, plugins can be installed with zip file, so we are publishing the plugin zips also to maven along with jars, please check https://opensearch.org/blog/opensearch-plugin-zips-now-in-maven-repo/.

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.

3 participants