Skip to content

Conversation

t-persson
Copy link
Collaborator

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

@t-persson t-persson requested a review from a team as a code owner October 23, 2024 08:14
@t-persson t-persson requested review from andmat900 and fredjn and removed request for a team October 23, 2024 08:14
@t-persson t-persson mentioned this pull request Nov 15, 2024
Copy link
Member

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?

Copy link
Collaborator Author

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.

@t-persson t-persson force-pushed the configs-to-use-composition branch from 5a5c7f5 to 7a27c7e Compare November 27, 2024 13:35
@t-persson
Copy link
Collaborator Author

Forced push due to rebase

@t-persson t-persson requested a review from fredjn November 28, 2024 09:55
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")
Copy link
Member

@fredjn fredjn Jan 14, 2025

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.

Copy link
Collaborator Author

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.

@t-persson t-persson requested a review from fredjn January 17, 2025 09:17
@t-persson t-persson force-pushed the configs-to-use-composition branch from 2d6ecdc to 8502a80 Compare January 17, 2025 12:49
@t-persson
Copy link
Collaborator Author

Rebased

@t-persson t-persson merged commit 985f9c8 into eiffel-community:main Jan 20, 2025
5 checks passed
@t-persson t-persson deleted the configs-to-use-composition branch January 20, 2025 10:35
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.

2 participants