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

Add support to shorthand syntax for loading parameters from files #9063

Merged
merged 4 commits into from
Nov 12, 2024

Conversation

aemous
Copy link
Contributor

@aemous aemous commented Nov 8, 2024

Description of changes:

  • Enable support for loading files into nested parameters via usage of file:// or fileb:// prefix.

Description of tests:

  • Added unit test cases to ensure the parser works against the expected grammar updates.
  • Added a test suite to verify that the parser correctly loads contents from local files as expected.
  • Ran and passed all existing and new tests.
  • Manually tested the feature via self-crafted input.

Usage Example:
For example, suppose there is a file named tagval.txt located at path/to/tagval.txt on the host machine with contents TagValue.

aws codecommit tag-resource --resource-arn <RESOURCE_ARN> --tags TagKey@=file://path/to/tagval.txt

The above command will parse the tags parameter as "tags": {"TagKey": "TagValue"}}. Notice the need for the assignment operator @=. This operator is required to prevent breaking existing customers that may be using a nested parameter value that happens to start with file:// already.

Relevant Links:

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

@aemous aemous requested review from hssyoo and a team November 8, 2024 17:47
@codecov-commenter
Copy link

codecov-commenter commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 28 lines in your changes missing coverage. Please review.

Project coverage is 0.08%. Comparing base (cdea504) to head (f21aa57).
Report is 16 commits behind head on develop.

Files with missing lines Patch % Lines
awscli/shorthand.py 0.00% 26 Missing ⚠️
awscli/paramfile.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #9063      +/-   ##
==========================================
- Coverage     0.08%   0.08%   -0.01%     
==========================================
  Files          210     210              
  Lines        16955   16977      +22     
==========================================
  Hits            14      14              
- Misses       16941   16963      +22     

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

@aemous aemous merged commit b02b058 into aws:develop Nov 12, 2024
30 checks passed
aws-sdk-python-automation added a commit that referenced this pull request Nov 12, 2024
* release-1.36.0:
  Bumping version to 1.36.0
  Update changelog based on model updates
  Enable support for loading files into nested parameter values (#9063)
  Fix non-deterministic S3 test failure. (#9069)
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.

3 participants