Skip to content

refactor(parameters): replace EnvironmentVariablesService class with helper functions in Parameters #4168

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

Merged
merged 3 commits into from
Jul 16, 2025

Conversation

JonkaSusaki
Copy link
Contributor

Summary

Changes

This PR removes the legacy class-based EnvironmentVariablesService from the Parameters package and replaces it with functional local helpers.

  • Removed the packages/parameters/src/config/EnvironmentVariablesService.ts file.
  • Removed the packages/parameters/tests/unit/EnvironmentVariablesService.test.ts file, since our tests are backed by commons/tests/unit/envUtils.test.ts.
  • Created the packages/parameters/src/utils/env.ts file containing the helpers.
  • Changed the contents of packages/parameters/src/base/BaseProvider.ts.
  • Changed the contents of packages/parameters/src/base/GetMultipleOptions.ts.
  • Changed the contents of packages/parameters/src/base/GetOptions.ts.
  • Changed the contents of packages/parameters/src/appconfig/AppConfigProvider.ts.
  • Added the isValueTrue function to the packages/commons/src/envUtils.ts because it is needed in packages/parameters/src/ssm/SSMProvider.ts.
  • Added the tests for isValueTrue in packages/commons/tests/unit/envUtils.test.ts.
  • Changed the contents of packages/parameters/src/ssm/SSMProvider.ts.

Issue number: #4138


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

@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Jul 14, 2025
@boring-cyborg boring-cyborg bot added commons This item relates to the Commons Utility parameters This item relates to the Parameters Utility tests PRs that add or change tests labels Jul 14, 2025
Copy link

boring-cyborg bot commented Jul 14, 2025

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 #typescript channel on our Powertools for AWS Lambda Discord: Invite link

@svozza
Copy link
Contributor

svozza commented Jul 14, 2025

Thanks for picking this up, it's looking good! I only had one small comment.

@dreamorosi dreamorosi self-requested a review July 14, 2025 20:57
…r.ts

Removed test utilities that remained from Environment Variables Service

Changes to be committed:
	modified:   packages/commons/src/envUtils.ts
	modified:   packages/commons/tests/unit/envUtils.test.ts
	modified:   packages/parameters/src/base/GetOptions.ts
	modified:   packages/parameters/src/ssm/SSMProvider.ts
	deleted:    packages/parameters/src/types/ConfigServiceInterface.ts
	deleted:    packages/parameters/src/utils/env.ts
	modified:   packages/parameters/tests/unit/BaseProvider.test.ts
@dreamorosi dreamorosi self-requested a review July 16, 2025 15:01
Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

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

Thank you for addressing my comments, and great work.

Thank you for your first PR, there're a few similar open issues, in case you're interested feel free to leave a comment

Copy link

@svozza svozza merged commit ce4e618 into aws-powertools:main Jul 16, 2025
5 checks passed
Copy link

boring-cyborg bot commented Jul 16, 2025

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

@svozza
Copy link
Contributor

svozza commented Jul 16, 2025

Thank you for this PR @JonkaSusaki, it's now been merged!

@JonkaSusaki
Copy link
Contributor Author

Thanks guys! I would love to keep contributing to this project! Next week I'll look for some other issues since I won't be able to work this week.

Keep up the good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commons This item relates to the Commons Utility parameters This item relates to the Parameters Utility size/L PRs between 100-499 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants