Repository navigation
fix(feature_flags): match days of week regardless of locale - #8707
leandrodamascena merged 2 commits into
Conversation
|
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
leandrodamascena
left a comment
There was a problem hiding this comment.
Thanks @anishmehta24, confirmed with a real de_DE locale here: on develop a DAYS=["SATURDAY"] rule stops matching as soon as strftime says Samstag, with your change it keeps matching, and the English locale behaves exactly as before.
I'm approving now. This goes out in 3.40.0, so it will sit here for a while before I merge it. No rebase needed in the meantime, and you'll be credited in the release notes.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8707 +/- ##
========================================
Coverage 97.01% 97.01%
========================================
Files 321 321
Lines 16431 16432 +1
Branches 1484 1484
========================================
+ Hits 15940 15941 +1
Misses 350 350
Partials 141 141 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
|
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |



Issue number: closes #8706
Summary
Changes
compare_days_of_weeknamed the current day withstrftime("%A").upper(), which follows the process'sLC_TIMElocale, so under a German locale Friday becameFREITAGand never matchedFRIDAY. It now looks the day up fromdatetime.weekday()in a tuple built from theTimeValuesday names.Added
test_time_based_days_range_rule_match_with_non_english_locale, which returns adatetimewhosestrftimegives German day names; it fails ondevelop. The feature flags tests pass.User experience
Before: a
SCHEDULE_BETWEEN_DAYS_OF_WEEKrule silently stops matching if the function sets a non-EnglishLC_TIME. After: the rule matches on the configured days regardless of locale.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.