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

Adds ability to list installed plugins from CLI #5920

Merged
merged 14 commits into from
Jan 16, 2016

Conversation

ycombinator
Copy link
Contributor

Closes #5916

Note: The code in this PR only goes as far as listing the names of the installed plugins. It does not list their version numbers. Please let me know if that's something worth adding.

@epixa
Copy link
Contributor

epixa commented Jan 15, 2016

Looks like there's something funky going on here, the PR includes 3 commits that are already in master.

@ycombinator
Copy link
Contributor Author

@epixa Yeah, fixed now, thanks to help from @spalger and @w33ble!

@@ -0,0 +1,18 @@
const fs = require('fs');

module.exports = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use an es6 export instead of commonjs, so:

export function list(settings, logger) {

instead of module.exports = {...}.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, will make this change in this file. Should I also make the same change in the other plugin_*.js files in this directory (that aren't in the scope of this PR)?

Copy link
Contributor

Choose a reason for hiding this comment

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

No need to modify the other files. We plan to run through the entire codebase before Kibana 5 to update the majority of the existing commonjs module stuff.

@epixa
Copy link
Contributor

epixa commented Jan 15, 2016

Bunch of bits of feedback there, most of which are stylistic. The only bug I found was the conditional check for multiple commands at once.

++numChosen;
}
});
return (numChosen > 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend doing this by checking the length of the intersection rather than imperatively counting the duplicates. You can import intersection from the lodash module, and then this function becomes:

function areMultipleOptionsChosen(options, choices) {
  return intersection(Object.keys(options), choices).length > 1;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Beautiful. Changing. Thanks!

@epixa
Copy link
Contributor

epixa commented Jan 15, 2016

I've tested this out and it works well. My latest round of feedback is all stylistic recommendations rather than blockers, so this LGTM.

@epixa
Copy link
Contributor

epixa commented Jan 15, 2016

@ycombinator Just assign this issue to me when you've addressed whatever feedback you want to address.

@ycombinator ycombinator assigned epixa and unassigned ycombinator Jan 15, 2016
@@ -1,5 +1,6 @@
const { resolve } = require('path');
const expiry = require('expiry-js');
import intersection from 'lodash';
Copy link
Contributor

Choose a reason for hiding this comment

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

This should actually be import { intersection } from 'lodash'; The current line should error.

Copy link
Contributor

Choose a reason for hiding this comment

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

Correction, the current line itself wouldn't error, however intersection would be the lodash constructor itself rather than the intersection function from within lodash.

@epixa epixa removed their assignment Jan 15, 2016
@ycombinator ycombinator assigned epixa and unassigned ycombinator Jan 16, 2016
epixa added a commit that referenced this pull request Jan 16, 2016
Adds ability to list installed plugins from CLI
@epixa epixa merged commit a319979 into elastic:master Jan 16, 2016
elasticsearch-bot pushed a commit that referenced this pull request Jan 16, 2016
elasticsearch-bot pushed a commit that referenced this pull request Jan 16, 2016
elasticsearch-bot pushed a commit that referenced this pull request Jan 16, 2016
elasticsearch-bot pushed a commit that referenced this pull request Jan 16, 2016
elasticsearch-bot pushed a commit that referenced this pull request Jan 16, 2016
@elasticsearch-bot
Copy link

courtewing merged this into the following branches!

Branch Commits
4.x ef68493, f3df973, b5b13ff, 9300eda, 9a0be4e, f80ef70, ff8f18d, 16fe5ab, 5ec4923, 09de150, 208d374, a64f2cb, 904d91a, e2c93e2

elasticsearch-bot pushed a commit that referenced this pull request Jan 16, 2016
elasticsearch-bot pushed a commit that referenced this pull request Jan 16, 2016
elasticsearch-bot pushed a commit that referenced this pull request Jan 16, 2016
elasticsearch-bot pushed a commit that referenced this pull request Jan 16, 2016
elasticsearch-bot pushed a commit that referenced this pull request Jan 16, 2016
elasticsearch-bot pushed a commit that referenced this pull request Jan 16, 2016
elasticsearch-bot pushed a commit that referenced this pull request Jan 16, 2016
@epixa
Copy link
Contributor

epixa commented Jan 16, 2016

Awesome, thanks for doing this!

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.

3 participants