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

RDS: implement CopyTags and Tags parameters for copy_db_snapshot() #8320

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snordhausen
Copy link
Contributor

Testing on AWS showed that tags are never merged. Instead, AWS uses either the provided Tags value or the tags of the original snapshot.
Also, the old code always copied the tags of the source snapshots, but CopyTags actually defaults to False.

I'll apply the same change to copy_db_cluster_snapshot once this PR is merged. It behaves in the same way as copy_db_snapshot with regards to tags.

Testing on AWS showed that tags are never merged. Instead, AWS
uses either the provided Tags value or the tags of the original
snapshot.
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.57%. Comparing base (10bdd08) to head (fb550e7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8320   +/-   ##
=======================================
  Coverage   94.57%   94.57%           
=======================================
  Files        1159     1159           
  Lines      100936   100936           
=======================================
+ Hits        95458    95459    +1     
+ Misses       5478     5477    -1     
Flag Coverage Δ
servertests 28.89% <0.00%> (ø)
unittests 94.54% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@bblommers bblommers changed the title implement CopyTags and Tags parameters for RDS copy_db_snapshot() RDS: implement CopyTags and Tags parameters for copy_db_snapshot() Nov 16, 2024
)

new_tags = [{"Key": "new", "Value": "tag"}]
kwargs_and_expected_results = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! This is a very clean and clear way of showing the different behaviours.

Just one nitpick - can you use this list to parametrize the entire test? That is going to include a bit of overhead, but having separate tests for each use case makes debugging later on much easier (IMHO).

So the resulting test signature would look something like this:

@pytest.mark.parametrize("kwargs,expected_result", [..])
def test_copy_db_snapshots_copytags_and_tags(kwargs, expected_result):
    ...

@snordhausen
Copy link
Contributor Author

@bblommers I'll take at this eventually, just didn't have time yet.

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.

2 participants