Bug: Support cases where ignore_not_found is not provided#29
Bug: Support cases where ignore_not_found is not provided#29GrantBirki merged 2 commits intomainfrom
ignore_not_found is not provided#29Conversation
|
I know we use |
|
I believe what is happening here (with my limited understanding of Here is an example: # initialize the class but ensure all params have a value "passed in" even when they have defaults set (comments below)
Entitlements::Backend::GitHubTeam::Service.new(
addr: nil, # value passed in
org: "github",
token: "secret",
ou: "blah",
ignore_not_found: false # value passed in
)The code seen above will pass the checks that # initialize the class but use the defaults that the class defines for `addr` and `ignore_not_found`
Entitlements::Backend::GitHubTeam::Service.new(
# addr: nil,
org: "github",
token: "secret",
ou: "blah",
# ignore_not_found: false
)This will raise an exception on Hopefully that all makes sense and my understanding of TL;DR: I don't think we can safely enforce the type on |
This pull request fixes a bug where
entitlementswould throw an exception and crash ifignore_not_foundis not provided via a configuration. This is an issue with the way Ruby'sContractsGem handles optional input params. If theignore_not_foundvalue is not provided, it will default tofalsebut the wayContractsis setup it expects the input option to be a Boolean. This pull request fixes that with theMaybekeyword.related: #28