-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Override Default Distribution Download Url with Custom Distribution Url When User Passes a Url #2086
Merged
dblock
merged 5 commits into
opensearch-project:main
from
Rishikesh1159:override_ddpl_url
Feb 18, 2022
Merged
Override Default Distribution Download Url with Custom Distribution Url When User Passes a Url #2086
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1bd18b0
Override Default Distribution Download Url with Custom Distribution U…
Rishikesh1159 ae4806d
Adding test to check if correct IVY repos were added
Rishikesh1159 5944093
Adding another test case when custom url is not passed and documentin…
Rishikesh1159 00d8023
Adding TOC and making changes in DEVELOPER_GUIDE
Rishikesh1159 17bcb6a
Making changes in DEVELOPER_GUIDE about Distribution Download plugin
Rishikesh1159 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we still get 5 here? (And check for 4 below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of when we not pass customDistribution URL to setupDownloadService() it goes to else block and calls addIvyRepo() with releases and release-candidates as last two parameters for PATTERN LAYOUT. In case when we pass customDistributionUrl PATTERN LAYOUT will be empty.
code: in setupDownloadService() else block
addIvyRepo(
project,
DOWNLOAD_REPO_NAME,
"https://artifacts.opensearch.org",
FAKE_IVY_GROUP,
"/releases" + RELEASE_PATTERN_LAYOUT,
"/release-candidates" + RELEASE_PATTERN_LAYOUT
);
In addIvyRepo() method we have Arrays.stream() which iterates through PATTERN LAYOUT parameter for two times and create two separate repos one for releases and one for release-candidates but both having same url. So, this is why we have 5 repos added instead of 4 for case of not passing custom Distribution url.
code: in addIvyRepo()
private static void addIvyRepo(Project project, String name, String url, String group, String... patternLayout) {
final List repos = Arrays.stream(patternLayout).map(pattern -> project.getRepositories().ivy(repo -> {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My question is more what do we want to do about this? If the URL is the going to be the same all the time, the second one should be removed, shouldn't it? If not, adjust the test for now to check all values.
I hit approve, but consider fixing this before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes URL will be same both times. But I think either if we want to remove the second repo from repositories set or add a test check(opensearch-downloads2) again for same URL, we need to perform extra operation. Please correct me if I am wrong, adjusting the test to check all values would be like an extra safe step and better than removing repo. So, I will add test (checking opensearch-downloads2) to check all values as you mentioned in your previous suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for me.