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

Add libenvpp #158

Merged
merged 1 commit into from
Mar 24, 2023
Merged

Add libenvpp #158

merged 1 commit into from
Mar 24, 2023

Conversation

facuMH
Copy link
Contributor

@facuMH facuMH commented Jan 18, 2023

For multiple runtime parameters celerity uses environment variables.
This library makes the fetching of these variables easier while providing suggestions if miss spelling some of them.
It is also OS independent, hence we do not have to worry about OS specifics for fetching the env vars.

This PR depends on #155

@facuMH facuMH self-assigned this Jan 18, 2023
Copy link

@BlackMark29A BlackMark29A left a comment

Choose a reason for hiding this comment

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

Already looks much better than before, but there are still some issues.

One of them is that there are no unit tests to make sure environment variable parsing works as expected. To this end libenvpp supports the set_for_testing function on the prefix, which can be used in unit tests to specify which value a certain variable should have.

Further issues are:

src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Show resolved Hide resolved
@facuMH facuMH force-pushed the integration/libenvpp branch 5 times, most recently from 29d4c64 to 99b8e58 Compare January 24, 2023 13:36
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
include/config.h Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
test/runtime_tests.cc Show resolved Hide resolved
include/config.h Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/config.cc Outdated Show resolved Hide resolved
@facuMH facuMH force-pushed the integration/libenvpp branch from be38542 to 2d9e9eb Compare January 25, 2023 13:25
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
test/runtime_tests.cc Show resolved Hide resolved
Copy link

@BlackMark29A BlackMark29A 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 to me now.

However, before merging this, the libenvpp dependency should not be on something in the development branch, but rather the official release of version 1.1.0. I will wait with the release of that version until other people have also reviewed this PR, so that if further libenvpp features are required I can add them to version 1.1.0 without having to do another release.

Copy link
Member

@psalz psalz left a comment

Choose a reason for hiding this comment

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

Thanks, I've added some notes.

Edit: Also please rebase onto master as CI should be fixed now!

include/config.h Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
include/config.h Outdated Show resolved Hide resolved
@facuMH facuMH force-pushed the integration/libenvpp branch from 30b1deb to cecd852 Compare February 20, 2023 11:34
Copy link
Member

@psalz psalz left a comment

Choose a reason for hiding this comment

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

A few more notes!

src/config.cc Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
test/test_utils.h Outdated Show resolved Hide resolved
src/config.cc Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
@facuMH facuMH force-pushed the integration/libenvpp branch from cecd852 to 7486e90 Compare February 20, 2023 15:57
Copy link
Member

@psalz psalz left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Outdated Show resolved Hide resolved
src/config.cc Show resolved Hide resolved
test/runtime_tests.cc Show resolved Hide resolved
test/runtime_tests.cc Show resolved Hide resolved
@facuMH facuMH force-pushed the integration/libenvpp branch from 7486e90 to 8dc777d Compare February 22, 2023 09:45
@BlackMark29A
Copy link

I released v1.1.0 of libenvpp. So this PR can be updated to use the official release and then be merged.

@facuMH facuMH force-pushed the integration/libenvpp branch from 7faf84b to c81e456 Compare March 14, 2023 10:00
Test config properly parses correct env vars or reports when they can not be parsed.
Add test for deprecated env vars.
libenvpp checked out at v1.1 tag.
@facuMH facuMH force-pushed the integration/libenvpp branch from c81e456 to bb3db10 Compare March 24, 2023 09:05
@psalz psalz merged commit b2ced9b into master Mar 24, 2023
@psalz psalz deleted the integration/libenvpp branch March 24, 2023 10:00
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.

3 participants