Skip to content
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

feat(clients): change runtime config from constant to provider functions #2574

Merged
merged 6 commits into from
Jul 22, 2021

Conversation

AllanZhengYP
Copy link
Contributor

@AllanZhengYP AllanZhengYP commented Jul 13, 2021

Issue

Resolves #2557

Description

This change makes runtime default configs as a function instead of constant. As a result, different client instance won't share the same runtime config (e.g. HTTP handlers). This change also uses inline nullish coalescing in replace of fully loaded default configuration. This change makes sure the SDK won't load default value/provider at all when corresponding custom config is supplied.

This change may increase the code size because each nullish coalescing operator is transcribed to more inline code. However the difference is unnoticeable, tested on a React project with only S3 and GetObject command.

Testing

  • unit test
  • manual test(S3, ACM)
  • API reference

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

@codecov-commenter
Copy link

codecov-commenter commented Jul 15, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@7040faa). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2574   +/-   ##
=======================================
  Coverage        ?   60.59%           
=======================================
  Files           ?      516           
  Lines           ?    27633           
  Branches        ?     6760           
=======================================
  Hits            ?    16744           
  Misses          ?    10889           
  Partials        ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7040faa...37212cc. Read the comment docs.

@AllanZhengYP
Copy link
Contributor Author

AllanZhengYP commented Jul 16, 2021

Looks like the protocol tests are failed because they don't have region in the runtime config, but got was validated in resolveRegionConfig. Possibly because the region config not needed for non-AWS clients but required for SigV4 signer.

@AllanZhengYP AllanZhengYP force-pushed the runtime-config-function branch from 4704ed8 to d2228a9 Compare July 21, 2021 16:25
@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • CodeBuild project: sdk-staging-test
  • Commit ID: 37212cc
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@AllanZhengYP AllanZhengYP merged commit 5eca565 into aws:main Jul 22, 2021
@github-actions
Copy link

github-actions bot commented Aug 6, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Runtime config is mistakenly reused across clients re-instantiation
4 participants