Add ConfigResolver with necessary tests#641
Merged
ubaskota merged 3 commits intosmithy-lang:config_resolution_mainfrom Feb 23, 2026
Merged
Add ConfigResolver with necessary tests#641ubaskota merged 3 commits intosmithy-lang:config_resolution_mainfrom
ubaskota merged 3 commits intosmithy-lang:config_resolution_mainfrom
Conversation
SamRemis
reviewed
Feb 20, 2026
packages/smithy-aws-core/src/smithy_aws_core/config/resolver.py
Outdated
Show resolved
Hide resolved
jonathan343
reviewed
Feb 20, 2026
Contributor
There was a problem hiding this comment.
Thanks Ujjwal.
I left some minor comments and suggestions. However, my biggest concern with this PR is the approach for config resolver sharing.
- It doesn't follow any of the approaches discussed in previous designs
- In cases where multiple threads hit the function before the first result is cached, it will result in each building their own resolver which is unnecessary/duplicate work
packages/smithy-aws-core/src/smithy_aws_core/config/resolver.py
Outdated
Show resolved
Hide resolved
packages/smithy-aws-core/src/smithy_aws_core/config/__init__.py
Outdated
Show resolved
Hide resolved
packages/smithy-aws-core/src/smithy_aws_core/config/resolver.py
Outdated
Show resolved
Hide resolved
arandito
reviewed
Feb 20, 2026
SamRemis
reviewed
Feb 23, 2026
SamRemis
reviewed
Feb 23, 2026
| assert region == ("us-west-2", "source_one") | ||
| assert retry_mode == ("adaptive", "source_two") | ||
|
|
||
| def test_returns_non_string_values(self): |
Contributor
There was a problem hiding this comment.
Nit: this test is a bit odd to me; I'm not sure what's different about string values that makes them special. I'd think this would be more like "test_resolved_returns_different_types", then we test a string, an int, a bool, and whatever else.
These test make it look like string is the default type that a resolver will return, and I don't think that's true.
SamRemis
approved these changes
Feb 23, 2026
jonathan343
approved these changes
Feb 23, 2026
arandito
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Implements
ConfigResolverto resolve configuration values from multiple sources in precedence order. The resolver iterates through sources and returns the first non-None value found, along with the source name for provenance tracking. Returns(None, None)when no source provides a value.Tests
Added unit tests covering:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.