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

Refactor config environment variable override code #427

Merged
merged 2 commits into from
Oct 6, 2020
Merged

Refactor config environment variable override code #427

merged 2 commits into from
Oct 6, 2020

Conversation

HeavyWombat
Copy link
Contributor

Over time, there was some code duplication accumulated for overriding
configuration settings using an environment variable.

Introduce one common function to do the float slice override.

Combine os.Getenv and if case into one line, where possible.

Introduce basic Ginkgo test suite.

Add test cases for the currently possible environment overrides.

@qu1queee qu1queee removed their request for review October 6, 2020 13:42
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

Looks good. You may want to use Equal instead of BeEquivalentTo as the type conversion done by the latter one should not be needed in you Expects.

So far, there was no need to test cases that check whether the config
setup including the environment variable overrides work as expected. New
changes to the config setup would benefit from some level of unit tests.

Introduce basic Ginkgo test suite.

Add test cases for the currently possible environment overrides.
Over time, there was some code duplication accumulated for overriding
configuration settings using an environment variable.

Introduce one common function to do the float slice override.

Combine `os.Getenv` and `if` case into one line, where possible.
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 6, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SaschaSchwarze0

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 6, 2020
@HeavyWombat
Copy link
Contributor Author

/assign @sbose78

@openshift-merge-robot openshift-merge-robot merged commit c6b25b0 into shipwright-io:master Oct 6, 2020
@HeavyWombat HeavyWombat deleted the refactor/config-code branch October 6, 2020 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants