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

chore(user-agent): support patching botocore session #2614

Merged

Conversation

roger-zhangg
Copy link
Member

@roger-zhangg roger-zhangg commented Jun 29, 2023

Issue number:
#2626
Support patching botocore for data-masking

  • Where do we use this function?
    • For supporting Seshu's data-masking pr. Which uses AWS KMS as one of it's provider here.
  • IIRC we already had one function to add user-agent to the session.
    • The special thing about kms is it uses a botocore session instead of boto3 session to init it's client. So we need a new function to patch the new botocore session.

Summary

Changes

Please provide a summary of what's being changed

Add register_feature_to_botocore_session to shared.user_agent

User experience

Please share what the user experience looks like before and after this change

No UX impact

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

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.

@roger-zhangg roger-zhangg requested a review from a team as a code owner June 29, 2023 21:01
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 29, 2023
@github-actions github-actions bot added the feature New feature or functionality label Jun 30, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2023

Codecov Report

Patch coverage: 20.00% and project coverage change: -0.05 ⚠️

Comparison is base (a7e23dd) 97.23% compared to head (d92fe09) 97.18%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2614      +/-   ##
===========================================
- Coverage    97.23%   97.18%   -0.05%     
===========================================
  Files          161      161              
  Lines         7415     7431      +16     
  Branches       538      538              
===========================================
+ Hits          7210     7222      +12     
- Misses         158      162       +4     
  Partials        47       47              
Impacted Files Coverage Δ
aws_lambda_powertools/shared/user_agent.py 55.35% <20.00%> (-3.47%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rubenfonseca
Copy link
Contributor

Hi @roger-zhangg thank you for opening this PR. According to our contributing guide an opened issue is required before you submit a PR. Can you please check if you can create one so we can triage it?

@rubenfonseca rubenfonseca added do-not-merge need-issue PRs that are missing related issues labels Jun 30, 2023
@roger-zhangg
Copy link
Member Author

#2626
Added, Please help to review @rubenfonseca Thanks!

@heitorlessa
Copy link
Contributor

Looking into this today

@heitorlessa heitorlessa removed do-not-merge need-issue PRs that are missing related issues labels Jul 7, 2023
@heitorlessa heitorlessa self-assigned this Jul 7, 2023
Copy link
Contributor

@heitorlessa heitorlessa left a comment

Choose a reason for hiding this comment

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

Missing reason why we need this

aws_lambda_powertools/shared/user_agent.py Show resolved Hide resolved
@heitorlessa heitorlessa changed the title feat(user-agent): Support patching botocore session chore(user-agent): Support patching botocore session Jul 7, 2023
@github-actions github-actions bot added the internal Maintenance changes label Jul 7, 2023
@heitorlessa heitorlessa removed the feature New feature or functionality label Jul 7, 2023
Signed-off-by: Roger Zhang <[email protected]>
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 7, 2023
Signed-off-by: Roger Zhang <[email protected]>
@heitorlessa heitorlessa changed the title chore(user-agent): Support patching botocore session chore(user-agent): support patching botocore session Jul 7, 2023
@heitorlessa heitorlessa merged commit ec9c451 into aws-powertools:develop Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commons internal Maintenance changes size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants