-
Notifications
You must be signed in to change notification settings - Fork 6
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
Global config for Hearth clients #207
Conversation
TODO: test for global being overwritten (hierarchy?) and value validation |
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.
Per our convo, may need test coverage on the following:
- Ensure that the inherited global config on the client level is validated
- Confirm client can override config that was inherited from global
codegen/smithy-ruby-codegen-test/integration-specs/client_spec.rb
Outdated
Show resolved
Hide resolved
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.
I like the approach of adding the options
to Config, but I'm not sure about supporting a global Hearth.config.
attr_reader :config | ||
|
||
# @param [Hash] config | ||
def config=(config) |
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.
While I do think global config is okay for AWS clients, I'm a little skeptical about supporting it for all generic Hearth clients - I think it could be a little bit of a foot gun if someone is using smithy-ruby clients for vastly different services.
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.
Maybe. Let's chat offline.
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.
If we do want to support generic global config - what about only supporting it in the generated SDK's namespace. Eg: RailsJson.config
or AWS::SDK::S3.config
?
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.
I think we will also need per-service global config and AWS global config, but I think Hearth global config is still fine here. Yes there are risks, and I understand it may seem funky, but I think it's correct to have config at every level.
Config defaults need to remain inside the Config struct and Config must expose the original provided options. This is so global config plugin knows what was configured already (it may be nil).
Needs tests and some more thought on approach. Options are being modified by resolver, it would be preferable not to.