-
Notifications
You must be signed in to change notification settings - Fork 5
Clean up configurations to utilize composition instead #89
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
Clean up configurations to utilize composition instead #89
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.
Why remove the tests for specific configurations?
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.
The test mostly just test that it is possible to use the config interface. It does not necessarily test that each value is possible to set.
While a new config_test could be added for the executionspace config it would not really do anything other than check that the default values are correct. The benefit of adding it would be that we'd be able to check that it loads the base config, but loading the base config is not really necessary as long as the config implements the Config interface (which it does).
In other words: I can add the tests if we want to, but I don't see much value in having them.
5a5c7f5
to
7a27c7e
Compare
Forced push due to rebase |
flag.DurationVar(&conf.executionSpaceWaitTimeout, "executionSpaceWaitTimeout", executionSpaceWaitTimeout, "Timeout duration to wait when trying to checkout execution space(s)") | ||
flag.StringVar(&conf.rabbitmqHookURL, "rabbitmq_hook_url", os.Getenv("ETOS_RABBITMQ_URL"), "URL to the ETOS rabbitmq for logs") | ||
flag.StringVar(&conf.rabbitmqHookExchange, "rabbitmq_hook_exchange", os.Getenv("ETOS_RABBITMQ_EXCHANGE"), "Exchange to use for the ETOS rabbitmq for logs") | ||
flag.StringVar(&conf.eiffelGoerURL, "event_repository_host", os.Getenv("EIFFEL_GOER_URL"), "Event repository URL used for Eiffel event lookup") |
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.
If what we want/need is specifically a GoER url, then the help text etc should not talk about a generic event repository url.
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.
While I agree with the comment, this is out of scope for this PR. I only moved these variables from 9e806d4#diff-7bcfcaac6de878edc282f448cc09fc79d74566aab79e4fa8a73eb0235b57d0f4 to here.
Co-authored-by: Fredrik Fristedt <fredrik.fristedt@axis.com>
2d6ecdc
to
8502a80
Compare
Rebased |
Applicable Issues
Description of the Change
With my change for controller I noticed that I had to add a lot of the same code in multiple places. By utilizing composition here instead we will get cleaner code and it makes it easier to add new base configuration values instead of having to add it to every config separately.
Alternate Designs
Considered keeping it as is, but I think it's better to try and fix this now when it is easy instead of waiting and, potentially, not being able to.
Possible Drawbacks
I don't see any drawbacks of this design.
Sign-off
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
Signed-off-by: Tobias Persson tobias.persson@axis.com