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

Fixing plugin installation URL to consume build qualifier #3193

Merged
merged 2 commits into from
May 6, 2022
Merged

Fixing plugin installation URL to consume build qualifier #3193

merged 2 commits into from
May 6, 2022

Conversation

saratvemulapalli
Copy link
Member

@saratvemulapalli saratvemulapalli commented May 4, 2022

Signed-off-by: Sarat Vemulapalli vemulapallisarat@gmail.com

Description

Plugin installation URL for official plugins do not consume build qualifier, causing problems with the folder structure we expose for artifacts.opensearch.org.
This PR fixes it and consumes the build qualifier while populating the URL for native plugins.

Unit tests already cover this, but added manual testing into PR for readability.

Before the fix:

opensearch-3.0.0-rc1 % ./bin/opensearch-plugin install repository-s3
-> Installing repository-s3
-> Downloading repository-s3 from opensearch
-> Failed installing repository-s3
-> Rolling back repository-s3
-> Rolled back repository-s3
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: https://artifacts.opensearch.org/releases/plugins/repository-s3/3.0.0/repository-s3-3.0.0-rc1.zip

After the fix:

opensearch-3.0.0-rc1 % ./bin/opensearch-plugin install repository-s3
-> Installing repository-s3
-> Downloading repository-s3 from opensearch
-> Failed installing repository-s3
-> Rolling back repository-s3
-> Rolled back repository-s3
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: https://artifacts.opensearch.org/releases/plugins/repository-s3/3.0.0-rc1/repository-s3-3.0.0-rc1.zip

Issues Resolved

Closes #3168

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.

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
@saratvemulapalli saratvemulapalli marked this pull request as ready for review May 4, 2022 22:55
@saratvemulapalli saratvemulapalli requested review from a team and reta as code owners May 4, 2022 22:55
@saratvemulapalli saratvemulapalli added Plugins v3.0.0 Issues and PRs related to version 3.0.0 backport 2.x Backport to 2.x branch v2.1.0 Issues and PRs related to version 2.1.0 bug Something isn't working labels May 4, 2022
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 4705010
Log 5023

Reports 5023

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
@saratvemulapalli
Copy link
Member Author

cc: @peterzhuamazon

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success f86308a
Log 5024

Reports 5024

@@ -1049,7 +1049,7 @@ public void assertInstallPluginFromUrl(

public void testOfficialPlugin() throws Exception {
String url = "https://artifacts.opensearch.org/releases/plugins/analysis-icu/"
+ Version.CURRENT
+ Build.CURRENT.getQualifiedVersion()
Copy link
Collaborator

Choose a reason for hiding this comment

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

@saratvemulapalli sorry, as far as I can tell, Version.CURRENT == Build.CURRENT.getQualifiedVersion() (at least, should be), why we are changing that?

Copy link
Collaborator

@reta reta May 5, 2022

Choose a reason for hiding this comment

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

Answering my own question: Version.CURRENT == Build.CURRENT.getQualifiedVersion() only in tests, otherwise taken from the JAR artifact ...

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you @reta for the review.
Version.CURRENT doesnt include the qualifier where as Build.CURRENT.getQualifiedVersion() does.
This helps us structuring artifacts in dedicated folders for releases like alpha1, beta1, rc1

peterzhuamazon added a commit to peterzhuamazon/opensearch-build that referenced this pull request May 6, 2022
peterzhuamazon added a commit to peterzhuamazon/opensearch-build that referenced this pull request May 6, 2022
@peterzhuamazon peterzhuamazon added the backport 2.0 Backport to 2.0 branch label May 6, 2022
@peterzhuamazon
Copy link
Member

Add backport-2.0 tag as this is needed for 2.0 branch.

@peterzhuamazon peterzhuamazon merged commit ba6dc5d into opensearch-project:main May 6, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 6, 2022
* Fixing the installation URL to consume build qualifier

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>

* Fixing spotless

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
(cherry picked from commit ba6dc5d)
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 6, 2022
* Fixing the installation URL to consume build qualifier

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>

* Fixing spotless

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
(cherry picked from commit ba6dc5d)
@saratvemulapalli saratvemulapalli deleted the plugin-build-qualifer-installation branch May 6, 2022 06:00
@saratvemulapalli
Copy link
Member Author

Add backport-2.0 tag as this is needed for 2.0 branch.

@peterzhuamazon do we plan to release 2.0.1?
Why are we backporting it to a past release?

saratvemulapalli added a commit that referenced this pull request May 6, 2022
)

* Fixing the installation URL to consume build qualifier

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>

* Fixing spotless

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
(cherry picked from commit ba6dc5d)

Co-authored-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
@dblock
Copy link
Member

dblock commented May 6, 2022

Add backport-2.0 tag as this is needed for 2.0 branch.

@peterzhuamazon do we plan to release 2.0.1? Why are we backporting it to a past release?

2.0 branch is 2.0 GA that hasn't shipped yet

peterzhuamazon added a commit to opensearch-project/opensearch-build that referenced this pull request May 11, 2022
* Tweak promotion pipeline to support rpm and qualifier

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Add qualifier tests

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Add signer tests

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Update core plugins path after Sarat PR merged opensearch-project/OpenSearch#3193

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Remove extra comments

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Rename promoteTarArtifacts promoteArtifacts

Signed-off-by: Peter Zhu <zhujiaxi@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 backport 2.0 Backport to 2.0 branch bug Something isn't working Plugins v2.1.0 Issues and PRs related to version 2.1.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Core-Plugins installation does not support qualifier fully
5 participants