Skip to content

fix(parameters): key appconfig default provider by environment and ap… - #8635

Merged
leandrodamascena merged 3 commits into
aws-powertools:developfrom
codewithzubair07:fix/get-app-config-provider-key
Oct 22, 2026
Merged

leandrodamascena merged 3 commits into
aws-powertools:developfrom
codewithzubair07:fix/get-app-config-provider-key

Conversation

@codewithzubair07

@codewithzubair07 codewithzubair07 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Issue number: closes #8588

Summary

Changes

get_app_config created one provider on the first call and reused it, so later calls with a different environment or application read the wrong config. The provider is now cached per environment/application pair. Added a test for two apps/environments and updated the three tests that set the old "appconfig" key.

User experience

Before: a function reading two applications or environments silently got the first one's config. After: each call uses the environment and application it was given.

Ran tests/functional/parameters, ruff and mypy locally. Also ran the repro from the issue, which needed AWS_DEFAULT_REGION set (no AWS credentials).


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

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@codewithzubair07
codewithzubair07 requested a review from a team as a code owner October 19, 2026 08:07
@boring-cyborg boring-cyborg Bot added the tests label Oct 19, 2026
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 19, 2026
@boring-cyborg

boring-cyborg Bot commented Oct 19, 2026

Copy link
Copy Markdown

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@leandrodamascena leandrodamascena added this to the 3.38.0 milestone Oct 19, 2026

@leandrodamascena leandrodamascena left a comment

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.

Thanks @codewithzubair07, nice first contribution! I ran the suites and also tested it against two real AppConfig applications with the same profile name: develop reads app A's config when you ask for app B, your branch returns the right one for each. Same app and environment reuse the provider, and clear_caches() still clears everything.

Approving now. This goes out in 3.38.0, so it will sit here a bit before I merge. No need to rebase or touch anything, I'll take care of it and you'll get the credit in the release notes. Thank you!

@codewithzubair07

Copy link
Copy Markdown
Contributor Author

Thanks @codewithzubair07, nice first contribution! I ran the suites and also tested it against two real AppConfig applications with the same profile name: develop reads app A's config when you ask for app B, your branch returns the right one for each. Same app and environment reuse the provider, and clear_caches() still clears everything.

Approving now. This goes out in 3.38.0, so it will sit here a bit before I merge. No need to rebase or touch anything, I'll take care of it and you'll get the credit in the release notes. Thank you!

Thanks for the review and for testing it against real AppConfig apps, that’s a more thorough check than I could do on my side. Happy to leave the merge and rebase to you. Thanks for the credit in the 3.38.0 notes!

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.93%. Comparing base (46eb971) to head (7104eb8).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8635   +/-   ##
========================================
  Coverage    96.93%   96.93%           
========================================
  Files          318      318           
  Lines        16075    16076    +1     
  Branches      1436     1436           
========================================
+ Hits         15583    15584    +1     
  Misses         349      349           
  Partials       143      143           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leandrodamascena
leandrodamascena merged commit 050aba6 into aws-powertools:develop Oct 22, 2026
14 checks passed
@boring-cyborg

boring-cyborg Bot commented Oct 22, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

@powertools-for-aws-oss-automation

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: get_app_config ignores environment and application after the first call

2 participants