-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Add repository-url module and move URLRepository #22752
Conversation
Is there any reason FSRepository would need to be in the same module as URL repository, or could it be separate when it is eventually moved? In which case, this can be called |
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.
This looks good. I left a couple minor comments. The main thing I want to clear up is the name.
@@ -98,7 +91,8 @@ public void testRestoreOldSnapshots() throws Exception { | |||
for (Version v : VersionUtils.allReleasedVersions()) { | |||
if (VersionUtils.isSnapshot(v)) continue; // snapshots are unreleased, so there is no backcompat yet | |||
if (v.isRelease() == false) continue; // no guarantees for prereleases | |||
if (v.before(Version.CURRENT.minimumIndexCompatibilityVersion())) continue; // we only support versions N and N-1 | |||
if (v.before(Version.CURRENT.minimumIndexCompatibilityVersion())) |
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 this change? If you are going to move the continue to the next line (breaking with the convention of the other loop shortcut statements here...), please open a block.
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.
I'm not sure. I definitely did not intend that change. I'll revert that line.
classname 'org.elasticsearch.plugin.repositories.RepositoriesPlugin' | ||
} | ||
|
||
dependencies { |
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.
If there are no dependencies, you don't need a dependencies section.
compileJava.options.compilerArgs << "-Xlint:-unchecked,-rawtypes" | ||
compileTestJava.options.compilerArgs << "-Xlint:-unchecked,-rawtypes" | ||
|
||
thirdPartyAudit.excludes = [ |
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.
Not necessary.
|
||
@Override | ||
public Map<String, Repository.Factory> getRepositories(Environment env, NamedXContentRegistry namedXContentRegistry) { | ||
return Collections.singletonMap(URLRepository.TYPE, (metadata) -> new URLRepository(metadata, env, namedXContentRegistry)); |
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.
nit: the parens around metadata
are not necessary.
I'll update the PR with the requested changes. As for the name - when @s1monw and I originally talked about it, I was going to move both to a module named "repositories". But then this kind of blocked that from being a straightforward change. So we agreed that while working on the But there is no technical reason that I know of why they would need to be in the same module. If we want to specialize this module I can make those changes. |
Since URLRepository will require network permission, but FSRepository will not, I think that would be a good split. |
+1 |
I renamed it to I also worked on fixing some integration tests. I moved a snapshot restore test that used the In order to force that I a method I had to do this. I'm not sure if this was the correct approach? This was the first time I was dealing with the integration test harness, so let me know if there is something I should be doing instead. And @s1monw I will need a separate PR to move around |
I'm really sorry to be a pain here, but I think that it should be |
@jasontedor I mistyped the comment. |
Thank you. 😄 |
@tbrooks8 I don't see where your |
I think you need to rename that test. That exception is there for a reason. It means the test is running with an external cluster (which integTest does everywhere except in core, where the test was pulled from). In core, tests ending in IT extend from ESIntegTestCase. For all other modules, tests ending in IT mean they are running against an external cluster (a true integ test). If you rename the suffix of that test to |
Thanks. That looks like it was my issue. |
@jasontedor / @rjernst It looks like the build is passing at this point (now that I have worked out integration test issues). Can you update your reviews and approve it if everything looks alright? |
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.
LGTM
*/ | ||
|
||
esplugin { | ||
description 'Module for generic repositories' |
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.
Should be URL repository?
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.
Yep - just fixed
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.
Looks great, I left a question though.
} | ||
|
||
compileJava.options.compilerArgs << "-Xlint:-unchecked,-rawtypes" | ||
compileTestJava.options.compilerArgs << "-Xlint:-unchecked,-rawtypes" |
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.
Can you explain why these are needed?
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.
I just copied an existing module and made appropriate modifications when I created this. I assume those are artifacts from that and I do not know any reason those are need. I'll remove them.
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.
Cool, let's indeed see if we can drop them.
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.
LGTM. If the CI build passes, I'm good with it.
The CI build passed. So I'll merge this. |
* master: (47 commits) Remove non needed import use expectThrows instead of manually testing exception Fix checkstyle and a test Update after review Read ec2 discovery address from aws instance tags Invalidate cached query results if query timed out (elastic#22807) Add remaining generated painless API Generate reference links for painless API (elastic#22775) [TEST] Fix ElasticsearchExceptionTests Add parsing method for ElasticsearchException.generateThrowableXContent() (elastic#22783) Improve connection closing in `RemoteClusterConnection` (elastic#22804) Docs: Cluster allocation explain should be on one page Remove DFS_QUERY_AND_FETCH as a search type (elastic#22787) Add repository-url module and move URLRepository (elastic#22752) fix date-processor to a new default year for every new pipeline execution. (elastic#22601) Add tests for top_hits aggregation (elastic#22754) [TEST] Added this for 93a28b0 submitted via elastic#22772 Fix typo in comment in OsProbe.java Add new ruby search library to community clients doc (elastic#22765) RangeQuery WITHIN case now normalises query (elastic#22431) ...
This is related to #22116.
URLRepository
requiresSocketPermission
connect
. This commit introduces a new module called "repository-url"where
URLRepository
will reside. With the new module, permissions canbe removed from core.