Skip to content

Add support for config resolver#738

Open
ubaskota wants to merge 1 commit into
smithy-lang:config_integration_implementationfrom
ubaskota:config_resolver_implementation
Open

Add support for config resolver#738
ubaskota wants to merge 1 commit into
smithy-lang:config_integration_implementationfrom
ubaskota:config_resolver_implementation

Conversation

@ubaskota

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:
This change implements the async config resolution pipeline with AsyncAwsConfig using a resolve() classmethod as the only construction path. It adds SharedConfigContext for holding env vars and memoized config file data, FieldSpec for per-field resolution metadata, and provenance tracking via ConfigSource. Resolvers for region and retry_strategy_options are included along with validators for both fields.

Testing:

  • Added unit and end-to-end tests covering env var resolution, profile resolution, explicit overrides, defaults, provenance tracking, validator enforcement, and construction blocking, and verified that they all pass.
  • All existing tests pass

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ubaskota ubaskota requested a review from a team as a code owner July 13, 2026 05:19
result = await _resolve_str(ctx, env_vars=env_vars, profile_keys=profile_keys)
if result.value is UNSET:
return Resolved(value=UNSET, source=ConfigSource.DEFAULT) # type: ignore[arg-type]
if result.value is None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Is this dead code? _resolve_str may never return Resolved with a None value?

sources_found.append(attempts_result.source)

source = (
_strongest_source(*sources_found) if sources_found else ConfigSource.DEFAULT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we only have source_of("retry_strategy_options"), do we lose the ability to tell where retry_mode vs max_attempts each came from? E.g. retry_mode from env but max_attempts from profile would both just report ENV? I forgot if we discussed this yesterday - please refresh my memory if we did. I'm curious about this because it may affect another PR - which depends on provenance tracking, and needs to know if the max_attempts itself has been set by customer or not. If we've decided to keep provenance at the options level (rather than per-field) for now, then the other PR may consider a different way to determine if the customer has set the max_attempts manually.

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