-
Notifications
You must be signed in to change notification settings - Fork 23
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
Settings rework #125
Settings rework #125
Conversation
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.
Parameterized modules is a very old concept in Erlang: http://erlang.org/workshop/2003/paper/p29-carlsson.pdf
Could you rename this to avoid the clash?
a2c9f14
to
f896248
Compare
This reverts commit f3f3997417638030f8a27b46183107bd4edd33d5.
f896248
to
218712c
Compare
tmp.erl:
now try to compile it:
it's a bit hard to clash with something that is "dead". but if you can suggest some better name for this functionality i will change it. |
I know what happened with them, I've been using them back in the old days until they got removed ;-) Regarding a better name, maybe after reviewing the whole PR I could come up with something, the only idea that comes to my mind is that maybe there is no need to divide modules into regular and parameterized ones, but just use the parameter list as the differentiator (empty or not empty). |
yes, we need the list of parametrized modules to prepare the configuration before we start the scenario. the main idea is to do it in one and the same way as scenario configuration. |
update can be done like this: amoc_controller:update_settings([{interarrival, NewValue}]).
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.
Thanks for the rework, I know there was a need for it.
The code looks good, but I have a few concerns, mostly regarding complexity and clarity of the code. Could you take them into consideration?
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.
Thanks for the huge effort to make amoc and amoc scenarios configuration consistent and more convenient from the REST API perspective.
I added a few more comments and agree with all the points raised by @chrzaszcz
On a side note, it looks like some part of the changes could be excrated to separate PR. This would help with review.
those that are not configurable (parametrized) and not scenarios. |
@michalwski Tide is also using an old format, so it must be updated as well. is it still ok to remove it? |
this is done mainly to avoid confusions with well known concept in erlang environment http://erlang.org/workshop/2003/paper/p29-carlsson.pdf
Thanks for making the changes. There are a few remaining things I asked about. Otherwise, I think it starts looking good to merge. |
7e7d791
to
c6cfc0a
Compare
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.
Thanks for the changes. We are getting there :) I had few extra comments on the code.
Also, I noticed there is no update to the documentation. It looks like to me these changes need to be reflected in the doc. I'm not saying to add the documentation change to this PR, rather immedietally after this one is merged.
@@ -0,0 +1,75 @@ | |||
-module(dummy_helper). | |||
|
|||
-required_variable(#{name=>dummy_var, description=>"dummy_var", |
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.
Whitespaces, please :) I'm not going to point every single place where there is a missing space. I hope this is not a big deal to take a look at the diff and pay attention to them. There is also the lint
plugin for rebar3
which may be helpful.
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.
cannot find any reference to lint
plugin on rebar3.org I was thinking about elvis integration in the project to "fix" this once and forever :)
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.
All the changes I considered necessary are done. I think it is good enough to merge as soon as @michalwski approves it as well.
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.
It looks good now. Thanks.
This pull request adds the next functionality:
-required_variable(...)
module attribute).amoc_controller:update_settings()
interface. Only if update method is set explicitly for the parameter, otherwise it'sread_only
-required_variable(...)
module attribute declaration. the new format is declared here. the old format is still supported.overview of the amoc_config_* modules:
amoc_config
- getter module, the only one that is supposed to be used by helper/scenario modules.amoc_config_env
- contains functionality for parsing (os) env variables.amoc_config_attributes
- parsing/validation of the-required_variable(...)
module attributes.amoc_config_validation
- verification of the parameters values.amoc_config_scenario
- composition of the-required_variable(...)
attributes from all the helpers and started scenario, runtime update of the values.amoc_config_utils
various helper functions.amoc_scenario
- collects a list of all the parametrized helper modules.open questions:
-required_variable(...)
module attributes?config_verification_modules
? It's quite complex but I don't know how to deal with it better. currently it works in the next way:config_verification_modules
env of the module's application.config_verification_modules
env of all other loaded applications.