-
Notifications
You must be signed in to change notification settings - Fork 66
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
Switch Settings.dig to dot notation #19099
Conversation
Wow, I just came across this today in #18887 so I asked the PR author to change it up 🎉 |
Maybe this is a silly question, but isn’t the use of |
I agree with @jerekshoe on this. If we want to mandate/restrict the use of |
After thinking about this more I’m assuming it should be safe to use dot notation for these because they are updating usages of dig on the Settings hash, so if any of the intermediate values are nil there are probably bigger issues. I wasn’t thinking about this being scoped to the Settings hash when I asked my initial question |
@jerekshoe @shaunburdick My opinion is the default in the context of Settings should be dot notation, and if that's not possible
I think either are acceptable alternatives. Based on what I saw in the helm charts those values can't be nil and the settings that don't exist like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM based on @stevenjcumming commment! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I like this! I found a few issues with some of the settings though.
@@ -64,7 +64,7 @@ def token_validation_result | |||
private | |||
|
|||
def unsafe_mode? | |||
Rails.env.development? && Settings.dig(:modules_appeals_api, :enable_unsafe_mode) | |||
Rails.env.development? && Settings.modules_appeals_api.enable_unsafe_mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@department-of-veterans-affairs/lighthouse-banana-peels This setting doesn't actually exist anywhere... It's not in settings.yml or in any of the values.yaml in the manifest repo.
…back bearer_tokens to setting.yml
@rmtolmach I've add
|
Summary
Settings.parent_key.child_key
).dig
can obscure the use of those keys by making them difficult to findRelated issue(s)
Testing done
Acceptance criteria