-
Notifications
You must be signed in to change notification settings - Fork 399
[NO-TICKET] Separate set_value_from_env_or_default in two methods and always set default option value
#4627
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
[NO-TICKET] Separate set_value_from_env_or_default in two methods and always set default option value
#4627
Conversation
…default option value
Datadog ReportBranch report: ✅ 0 Failed, 21229 Passed, 1376 Skipped, 3m 34.73s Total Time |
BenchmarksBenchmark execution time: 2025-05-09 08:41:44 Comparing candidate commit d5625f7 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 31 metrics, 2 unstable metrics. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4627 +/- ##
=======================================
Coverage 97.76% 97.76%
=======================================
Files 1412 1412
Lines 86250 86259 +9
Branches 4347 4351 +4
=======================================
+ Hits 84322 84332 +10
+ Misses 1928 1927 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Marco Costa <[email protected]>
What does this PR do?
This PR separates
set_value_from_env_or_defaultin two methods,set_default_valueandset_env_value. It also always calls both of them, which means that the default value will always be set, then the env value if it exists, in which case the default value will be saved in the@value_per_precedencehash, and restored if unset is called on the env value. This also fixes a bug that made it impossible to unset an env value (as it would set it back due to no fallback,resetsetting@is_setto false, andgetsetting it back to the env variable as @is_set is false.Motivation:
In #4592 , I need to add two similar methods for customer defined config file, and fleet automation config file, with customer config being set after default but before env.
Change log entry
None.
Additional Notes:
How to test the change?
CI.