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

fix(configurations): correctly parse payload_tagging_services [backport 2.21] #12440

Open
wants to merge 4 commits into
base: 2.21
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

Backport 6e58426 from #12180 to 2.21.

Previously this:

        "payload_tagging_services": set(
            os.getenv("DD_TRACE_CLOUD_PAYLOAD_TAGGING_SERVICES", default={"s3", "sns", "sqs", "kinesis", "eventbridge"})
        ),

would require users to do config.botocore["payload_tagging_services"].add("SERVICE_HERE") as os.getenv just returns string.

If someone were to do:

$env:DD_TRACE_CLOUD_PAYLOAD_TAGGING_SERVICES = "foo,bar"

it would be converted into the set of {'o', 'b', 'r', 'f', ',', 'a'}

This correctly parses it as a set of {"foo", "bar"} while also stripping any potential whitespace.

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

Previously this:

```python
        "payload_tagging_services": set(
            os.getenv("DD_TRACE_CLOUD_PAYLOAD_TAGGING_SERVICES", default={"s3", "sns", "sqs", "kinesis", "eventbridge"})
        ),
```

would require users to do
`config.botocore["payload_tagging_services"].add("SERVICE_HERE")` as
`os.getenv` just returns `string`.

If someone were to do:

```powershell
$env:DD_TRACE_CLOUD_PAYLOAD_TAGGING_SERVICES = "foo,bar"
```

it would be converted into the `set` of `{'o', 'b', 'r', 'f', ',', 'a'}`

This correctly parses it as a set of `{"foo", "bar"}` while also
stripping any potential whitespace.

## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, author has acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment
- Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

---------

Co-authored-by: Joey Zhao <[email protected]>
(cherry picked from commit 6e58426)
@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Feb 20, 2025

Datadog Report

Branch report: backport-12180-to-2.21
Commit report: a01305f
Test service: dd-trace-py

✅ 0 Failed, 130 Passed, 1378 Skipped, 1m 45.85s Total Time

Copy link
Contributor Author

CODEOWNERS have been resolved as:

releasenotes/notes/correctly-parse-payload_tagging_services-794cdf0f340975e6.yaml  @DataDog/apm-python
tests/snapshots/tests.contrib.botocore.test.BotocoreTest.test_dynamodb_payload_tagging.json  @DataDog/apm-python
ddtrace/contrib/internal/botocore/patch.py                              @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/botocore/test.py                                          @DataDog/apm-core-python @DataDog/apm-idm-python

@pr-commenter
Copy link

pr-commenter bot commented Feb 20, 2025

Benchmarks

Benchmark execution time: 2025-02-20 19:36:00

Comparing candidate commit a01305f in PR branch backport-12180-to-2.21 with baseline commit 6a4347f in branch 2.21.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 396 metrics, 2 unstable metrics.

@emmettbutler emmettbutler enabled auto-merge (squash) February 20, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants