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

Config serialization should take into account environment variables #4865

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

ypatia
Copy link
Member

@ypatia ypatia commented Apr 10, 2024

sc-44928
We were getting failures while testing Query v3 , and specifically when setting up the REST-CI environment for it, because the rest.use_refactored_array_open_and_query_submit config we were setting was not getting propagated to the REST server.

After debugging it seems that Config serialization code was calling param_values() method to get the config variables to set in Cap'n'proto, which is not taking into account environment variables.

This PR also moves param_values() to private to prevent other classes from similar mistakes. ConfiIter is the only class that still uses it and I only saw that class being used in S3Parameters::load_headers. It's worth investigating further if that's a problem or not.


TYPE: BUG
DESC: Config serialization should take into account environment variables

@ypatia ypatia requested review from shaunrd0 and KiterLuc April 10, 2024 12:00
@ypatia ypatia force-pushed the yt/sc-44928/fix_config_serialization branch from e4ad636 to f52ab26 Compare April 11, 2024 08:25
@ypatia ypatia force-pushed the yt/sc-44928/fix_config_serialization branch from f52ab26 to 4305980 Compare April 11, 2024 08:51
@ypatia
Copy link
Member Author

ypatia commented Apr 11, 2024

sc-44928

Comment on lines +714 to +717
/** Get all config params taking into account environment variables */
const std::map<std::string, std::string> get_all_params_from_config_or_env()
const;

Copy link
Member

Choose a reason for hiding this comment

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

Maybe a better way would be to populate the config options with the environment variables at the time the Config gets created, but it might introduce complications when unsetting values.

@KiterLuc KiterLuc merged commit 8046ae2 into dev Apr 12, 2024
58 checks passed
@KiterLuc KiterLuc deleted the yt/sc-44928/fix_config_serialization branch April 12, 2024 11:31
dudoslav pushed a commit that referenced this pull request Apr 17, 2024
…4865)

sc-44928
We were getting failures while testing Query v3 , and specifically when
setting up the REST-CI environment for it, because the
`rest.use_refactored_array_open_and_query_submit` config we were setting
was not getting propagated to the REST server.

After debugging it seems that Config serialization code was calling
`param_values()` method to get the config variables to set in
Cap'n'proto, which is not taking into account environment variables.

This PR also moves `param_values()` to private to prevent other classes
from similar mistakes. `ConfiIter` is the only class that still uses it
and I only saw that class being used in `S3Parameters::load_headers`.
It's worth investigating further if that's a problem or not.

---
TYPE: BUG
DESC: Config serialization should take into account environment
variables
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