8000 TaggingService: Allow key value field names to be overridden by viren-nadkarni · Pull Request #12306 · localstack/localstack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

TaggingService: Allow key value field names to be overridden #12306

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 2 commits into from
Feb 28, 2025

Conversation

viren-nadkarni
Copy link
Member
@viren-nadkarni viren-nadkarni commented Feb 26, 2025

Background

We use the TaggingService abstraction as a service-neutral way to maintain resource tags. Its helper functions can use the common tag shape used by Botocore specs, which is:

'Tags': [
  {
    'Key': ...,
    'Value': ...,
  }
]

This is used by variety of services including s3, kinesisanalytics, elasticache, and others.

However some services use the same shape but different capitalisation for the field names, most notably codepipeline, which looks like:

'Tags': [
  {
    'key': ...,
    'value': ...,
  }
]

Changes

This PR introduces the ability to override these field values during the initialisation of the TaggingService object. This change is backward compatible.

Tests

This change is accompanied by unit tests. Plus, existing tests are refactored to use pytest.

@viren-nadkarni viren-nadkarni self-assigned this Feb 26, 2025
@viren-nadkarni viren-nadkarni added this to the 4.3 milestone Feb 26, 2025
@viren-nadkarni viren-nadkarni added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Feb 26, 2025
Copy link
github-actions bot commented Feb 26, 2025

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 52m 5s ⏱️ +5s
4 104 tests ±0  3 772 ✅ ±0  332 💤 ±0  0 ❌ ±0 
4 106 runs  ±0  3 772 ✅ ±0  334 💤 ±0  0 ❌ ±0 

Results for commit 475fa6e. ± Comparison against base commit e509f9d.

♻️ This comment has been updated with latest results.

@viren-nadkarni viren-nadkarni marked this pull request as ready for review February 26, 2025 12:35
Copy link
Contributor
@bentsku bentsku left a comment

Choose a reason for hiding this comment

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

LGTM! This looks like a nice change, while leaving the underlying TaggingService.tags still be regular dictionary. We still have a common structure under the hood that we will probably leverage at some point forresourcetaggingapi. Nice 💯

@viren-nadkarni viren-nadkarni merged commit 6b38789 into master Feb 28, 2025
35 checks passed
@viren-nadkarni viren-nadkarni deleted the tagging-service-field-override branch February 28, 2025 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0