Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

CLI options and commands renaming #618

Merged

Conversation

NicolasMassart
Copy link
Contributor

PR description

Provides a first group of changes to the CLI like renaming options and changing subcommands.
Doc was also updated.

Fixed Issue(s)

fixes Jira issues NC-2014, NC-2016, NC-2031, NC-2032, NC-2126 and NC-2127.

…mance

# Conflicts:
#	pantheon/src/test/resources/everything_config.toml
- fixes NC-2031 and NC-2032 by splitting RPC listen into host and port
- moves default values to DefaultCommandValues interface
- statically imports defaults
- renames some rpc variables tu include http or ws for homogeneity and clarity
- fixes Refresh delay error message as it should be "Refresh delay" and not the
variable name
- updates unit tests and yaml test configs
split p2p and metrics listen options into host and port
@NicolasMassart NicolasMassart self-assigned this Jan 21, 2019
@NicolasMassart NicolasMassart added documentation Related to any type of documentation api Related to public APIs needs engineering approval Doc needs reviewed by engineering labels Jan 21, 2019
Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

Few little details but then LGTM.

/** @deprecated Deprecated in favour of --network option */
@Deprecated
@Option(
hidden = true,
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably shouldn't be hidden until we actually support setting the network ID in genesis config. Otherwise there's no way to set a custom network ID.

String.valueOf(DEFAULT_MAX_REFRESH_DELAY)));
"Refresh delay must be a positive integer between %s and %s",
String.valueOf(DefaultCommandValues.DEFAULT_MIN_REFRESH_DELAY),
String.valueOf(DefaultCommandValues.DEFAULT_MAX_REFRESH_DELAY)));
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Static import for all the DefaultCommandValues references would improve readability.

@Option(
hidden = true,
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to keep this unhidden until DEV is an option for --network.

@@ -573,38 +625,38 @@ private static int trueCount(final Boolean... b) {
}
}

private File getNodePrivateKeyFile() {
private File getNodePrivateKeyFile(@Nullable final File nodePrivateKeyFile) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Pantheon doesn't currently use @Nullable so better to leave it off for consistency.

// "Synchronization mode (Value can be one of ${COMPLETION-CANDIDATES}, default:
// ${DEFAULT-VALUE})"
// )
private final SyncMode syncMode = DEFAULT_SYNC_MODE;
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be quite helpful if we kept this as-is - I have another open PR that starts using it again. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's me, deciding to remove dead code just before it gets to life gain after month being dead...

checkNotNull(syncMode);
synchronizerConfigurationBuilder.syncMode(syncMode);
private SynchronizerConfiguration buildSyncConfig() {
synchronizerConfigurationBuilder.syncMode(DEFAULT_SYNC_MODE);
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good not to remove the sync-mode flag. I have an open PR that starts using it again. :)

* Public key export sub-command
*
* <p>Export of the public key takes a file as parameter to export directly by writing the key in
* the file. A direct output of the key to sdt out is not done because we don't want the key value
Copy link
Contributor

Choose a reason for hiding this comment

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

sdt is an unusual abbreviation (at least to me). stdout or the full standard out is probably better.


@Before
public void resetSystemProps() {
System.setProperty("pantheon.docker", "false");
Copy link
Contributor

Choose a reason for hiding this comment

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

This appears to be setting a system property but never sets it back in an @After.

@NicolasMassart NicolasMassart merged commit 2a9fb15 into PegaSysEng:master Jan 22, 2019
@NicolasMassart NicolasMassart deleted the NC-2016_CLI_first_changes branch January 22, 2019 12:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api Related to public APIs documentation Related to any type of documentation needs engineering approval Doc needs reviewed by engineering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants