Add support for config resolver#738
Conversation
| 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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Issue #, if available:
Description of changes:
This change implements the async config resolution pipeline with
AsyncAwsConfigusing aresolve()classmethod as the only construction path. It addsSharedConfigContextfor holding env vars and memoized config file data,FieldSpecfor per-field resolution metadata, and provenance tracking viaConfigSource. Resolvers for region andretry_strategy_optionsare included along with validators for both fields.Testing:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.