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

Move the CLI into its own subproject #27114

Merged
merged 24 commits into from
Nov 19, 2017
Merged

Conversation

hub-cap
Copy link
Contributor

@hub-cap hub-cap commented Oct 25, 2017

Projects the depend on the CLI currently depend on core. This should not
always be the case. The EnvironmentAwareCommand will remain in :core,
but the rest of the CLI components have been moved into their own
subproject of :core, :core:cli.

Projects the depend on the CLI currently depend on core. This should not
always be the case. The EnvironmentAwareCommand will remain in :core,
but the rest of the CLI components have been moved into their own
subproject of :core, :core:cli.
apply plugin: 'elasticsearch.build'
apply plugin: 'ru.vyarus.animalsniffer'
apply plugin: 'nebula.maven-base-publish'
apply plugin: 'nebula.maven-scm'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, prolly dont some of these. will test w/o them.

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

I left a few comments.

@@ -102,6 +104,26 @@ private static void putSystemPropertyIfSettingIsMissing(final Map<String, String
}
}

@Override
protected void beforeExecute() {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be final?


dependencies {
compile 'net.sf.jopt-simple:jopt-simple:5.0.2'
compile "org.apache.lucene:lucene-core:${versions.lucene}"
Copy link
Member

Choose a reason for hiding this comment

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

Why is Lucene here, that seems unfortunate?

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
Copy link
Member

Choose a reason for hiding this comment

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

The indentation is off here.

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
Copy link
Member

Choose a reason for hiding this comment

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

Can you spare a line of whitespace?

@@ -58,6 +58,7 @@ dependencies {
compile 'org.elasticsearch:securesm:1.1'

// utilities
compile "org.elasticsearch:elasticsearch-cli:${version}"
Copy link
Member

Choose a reason for hiding this comment

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

Do we actually need to publish this? If we first move the ES cli under a distribution/tools project, then this could could be something like distribution/tools/base-cli?

@hub-cap
Copy link
Contributor Author

hub-cap commented Nov 1, 2017

@elasticmachine test this please. I refute your claim of failure with this message. I refute my claim of sanity.

@hub-cap
Copy link
Contributor Author

hub-cap commented Nov 1, 2017

@elasticmachine test this please. I think you are lying to me on purpose.

@nik9000
Copy link
Member

nik9000 commented Nov 2, 2017

Skip tests as there are none... should we move them?

I haven't read the PR but I liked this commit message. In general my take is "yes", we should move whatever tests make sense.

@hub-cap
Copy link
Contributor Author

hub-cap commented Nov 13, 2017

@elasticmachine test this please. I no longer think you are lying to me. I think gradle is.

@hub-cap
Copy link
Contributor Author

hub-cap commented Nov 13, 2017

In general my take is "yes", we should move whatever tests make sense.

I will do this in a followup PR, as my priorities have shifted a bit. As is, we will need to create a new "cli test" framework so that we can move things like MockTerminal into it, since many classes in core use this. Then we can move the cli tests into this project, and depend on this cli test framework instead of the core test framework. Its a bit more work than i want to tackle with this PR, and I think itll make it larger than necessary. But its the right thing to do, I think, so Ill circle back soon (tm).

…ore runtime configurations (which also had cli in it)
@hub-cap
Copy link
Contributor Author

hub-cap commented Nov 14, 2017

yay build finally passed cc @jasontedor

@hub-cap
Copy link
Contributor Author

hub-cap commented Nov 14, 2017

I think we still have an issue w/ this in that the core project should not be depending on a license/notice from another subproject (ie, the core/licenses/elasticsearch-cli-*) and I still need to sort that, but it should be ready for review barring that change

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

Looks good, I left a few comments.


test.enabled = false
// Since CLI does not depend on :core, it cannot run the jarHell task
jarHell.enabled = false
Copy link
Member

Choose a reason for hiding this comment

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

I think we should refactor out the JAR hell check too, as there are other places where we will want to run JAR hell checks that will not depend on core.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as part of this PR or just as a separate issue @jasontedor ?

Copy link
Member

Choose a reason for hiding this comment

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

@hub-cap Separate is fine.

@@ -166,6 +153,11 @@ protected boolean addShutdownHook() {
return true;
}

/** Gets the shutdown hook thread if it exists **/
public Thread getShutdownHookThread() {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this needs to be public, only package-private?

protected boolean shouldConfigureLoggingWithoutConfig() {
return true;
}
protected void beforeExecute() throws Exception {}
Copy link
Member

Choose a reason for hiding this comment

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

Why does this declare a checked exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cruft from the refactor. itll be gone next push.

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

Sorry, one more nit.

@@ -154,7 +154,7 @@ protected boolean addShutdownHook() {
}

/** Gets the shutdown hook thread if it exists **/
public Thread getShutdownHookThread() {
protected Thread getShutdownHookThread() {
Copy link
Member

Choose a reason for hiding this comment

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

Can we get away with this being package visible only?

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

LGTM.

@hub-cap hub-cap merged commit cb3e8f4 into elastic:master Nov 19, 2017
hub-cap added a commit that referenced this pull request Nov 19, 2017
Projects the depend on the CLI currently depend on core. This should not
always be the case. The EnvironmentAwareCommand will remain in :core,
but the rest of the CLI components have been moved into their own
subproject of :core, :core:cli.
jasontedor added a commit that referenced this pull request Nov 20, 2017
* master: (31 commits)
  [TEST] Fix `GeoShapeQueryTests#testPointsOnly` failure
  Transition transport apis to use void listeners (#27440)
  AwaitsFix GeoShapeQueryTests#testPointsOnly #27454
  Bump test version after backport
  Ensure nested documents have consistent version and seq_ids (#27455)
  Tests: Add Fedora-27 to packaging tests
  Delete some seemingly unused exceptions (#27439)
  #26800: Fix docs rendering
  Remove config prompting for secrets and text (#27216)
  Move the CLI into its own subproject (#27114)
  Correct usage of "an" to "a" in getting started docs
  Avoid NPE when getting build information
  Removes BWC snapshot status handler used in 6.x (#27443)
  Remove manual tracking of registered channels (#27445)
  Remove parameters on HandshakeResponseHandler (#27444)
  [GEO] fix pointsOnly bug for MULTIPOINT
  Standardize underscore requirements in parameters (#27414)
  peanut butter hamburgers
  Log primary-replica resync failures
  Uses TransportMasterNodeAction to update shard snapshot status (#27165)
  ...
jasontedor added a commit that referenced this pull request Nov 20, 2017
* 6.x: (41 commits)
  [TEST] Fix `GeoShapeQueryTests#testPointsOnly` failure
  Transition transport apis to use void listeners (#27440)
  AwaitsFix GeoShapeQueryTests#testPointsOnly #27454
  Ensure nested documents have consistent version and seq_ids (#27455)
  Tests: Add Fedora-27 to packaging tests
  #26800: Fix docs rendering
  Move the CLI into its own subproject (#27114)
  Correct usage of "an" to "a" in getting started docs
  Avoid NPE when getting build information
  Remove manual tracking of registered channels (#27445)
  Standardize underscore requirements in parameters (#27414)
  Remove parameters on HandshakeResponseHandler (#27444)
  [GEO] fix pointsOnly bug for MULTIPOINT
  peanut butter hamburgers
  Uses TransportMasterNodeAction to update shard snapshot status (#27165)
  Log primary-replica resync failures
  Add limits for ngram and shingle settings (#27411)
  Enforce a minimum task execution and service time of 1 nanosecond
  Fix place-holder in allocation decider messages (#27436)
  Remove newline from log message (#27425)
  ...
@jimczi jimczi added v7.0.0-beta1 and removed v7.0.0 labels Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants