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

Modify and improve config change callback system #74

Merged
merged 6 commits into from
Aug 12, 2016

Conversation

nickelization
Copy link
Contributor

These changes break backwards compatibility with the old config callback API, but the new system is much easier to use in that it automatically deals with use of the --node and --all flags and calls the callbacks in the correct places. It also allows the callbacks to add output messages that can be displayed back to the user. In the case of the --all flag, all the results will now be displayed back to the user in a table.

This PR also updates the documentation appropriately, and adds extensive unit tests for the clique "set" command.

@@ -171,18 +171,26 @@ Configuration specific behaviour can be managed by registering a callback to
fire when a given configuration variable is set on the cli. The callback runs
*after* the corresponding environment variables are set. The callback function
is a 3-arity function that gets called with the original key (as a list of
Copy link

Choose a reason for hiding this comment

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

This should now be 2-arity?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! Thanks!

@ian-mi
Copy link

ian-mi commented Aug 12, 2016

Good work, I will wait for a rebase to squash some of these commits before going ahead with the merge.

@nickelization nickelization force-pushed the nem-fix-config-hook-rpc branch 5 times, most recently from beab01a to 3fa2acc Compare August 12, 2016 15:59
We no longer pass the flags through to the config change callback, and
the callback is executed directly on whichever node(s) are receiving the
config change. Additionally, the return format of the config callbacks
has changed so that we can display either a text status message for a
standard "set", or a table of results when we use the --all flag.
And fix some dialyzer warnings too while we're at it.
Regardless of whether the callback displays any output, it's
better to tell the user exactly what has been done and confirm
that the variable has been modified.
Credit to Ian for pointing this out in review comments
@nickelization
Copy link
Contributor Author

@ian-mi Alright, after much git wrangling, I think that's about as clean and tidy as I'm going to get it without having to start manually resolving merge conflicts. GitHub seems to have gotten a bit confused by all my rebases and force pushes, because it's showing the commits out of order now, so be careful to get the correct commit hash when you +1 it for Bors. (Currently 14e01b0).

@ian-mi
Copy link

ian-mi commented Aug 12, 2016

looks good, +1 14e01b0

@nickelization
Copy link
Contributor Author

I think Bors needs the +1 to be the first thing in the comment and on its own line. Let me try one more time...

@nickelization
Copy link
Contributor Author

👍 14e01b0

borshop added a commit that referenced this pull request Aug 12, 2016
Modify and improve config change callback system

Reviewed-by: nickelization
@nickelization
Copy link
Contributor Author

@borshop merge

@borshop borshop merged commit 14e01b0 into develop Aug 12, 2016
@hazen hazen deleted the nem-fix-config-hook-rpc branch August 15, 2016 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants