Skip to content

Allow overriding SMS/voice support via feature flag (LG-5223)#5537

Merged
zachmargolis merged 1 commit intomainfrom
margolis-country-code-override
Oct 25, 2021
Merged

Allow overriding SMS/voice support via feature flag (LG-5223)#5537
zachmargolis merged 1 commit intomainfrom
margolis-country-code-override

Conversation

@zachmargolis
Copy link
Contributor

@zachmargolis zachmargolis commented Oct 22, 2021

If we had this a few weeks ago, #5487 would not have needed a deploy + patch, we could have set a config like this:

country_phone_number_overrides: '{"TL":{"supports_sms":false}}'

Comment on lines +2 to +8
def self.load_config
YAML.load_file(
Rails.root.join('config', 'country_dialing_codes.yml'),
).deep_merge(IdentityConfig.store.country_phone_number_overrides)
end

INTERNATIONAL_CODES = load_config.freeze
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since it takes an app restart to change feature flags, and this value is read often (meaning changing constant accesses to a method read seems expensive), it seemed easy enough to me to keep it a constant

Copy link
Contributor

@mitchellhenke mitchellhenke left a comment

Choose a reason for hiding this comment

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

Do you think at some point we'll probably want to move all overrides into this?

@zachmargolis
Copy link
Contributor Author

Do you think at some point we'll probably want to move all overrides into this?

I don't have a good sense, part of me think its nice to have the YAML in source code for most overrides, and this config would be for the quick emergency scenarios? The contents of the override file are big and it seems easy to make invalid JSON formatting with something that big?

@zachmargolis zachmargolis merged commit d197379 into main Oct 25, 2021
@zachmargolis zachmargolis deleted the margolis-country-code-override branch October 25, 2021 17:02
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.

2 participants