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(asm): ensure new aspects does not raise exceptions if there is no context #9234

Merged
merged 5 commits into from May 13, 2024

Conversation

juanjux
Copy link
Collaborator

@juanjux juanjux commented May 10, 2024

Description

Ensure the new aspect don't raise exceptions if there is no tx_map, instead just return the original function result.

Checklist

  • Change(s) are motivated and described in the PR description
  • Testing strategy is described if automated tests are not included in the PR
  • Risks are described (performance impact, potential for breakage, maintainability)
  • Change is maintainable (easy to change, telemetry, documentation)
  • Library release note guidelines are followed or label changelog/no-changelog is set
  • Documentation is included (in-code, generated user docs, public corp docs)
  • Backport labels are set (if applicable)
  • If this PR changes the public interface, I've notified @DataDog/apm-tees.

Reviewer Checklist

  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Description motivates each change
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Change is maintainable (easy to change, telemetry, documentation)
  • Release note makes sense to a user of the library
  • 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

Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
@juanjux juanjux added changelog/no-changelog A changelog entry is not required for this PR. ASM Application Security Monitoring backport 2.9 labels May 10, 2024
@juanjux juanjux self-assigned this May 10, 2024
@juanjux juanjux requested a review from a team as a code owner May 10, 2024 20:07
@juanjux juanjux changed the title Ensure new aspect doesnt raise exceptions if there is no tx_map fix(asm): ensure new aspects does not raise exceptions if there is no tx_map May 10, 2024
@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented May 10, 2024

Datadog Report

Branch report: juanjux/ensure-no-expections-on-aspects
Commit report: 4481c35
Test service: dd-trace-py

✅ 0 Failed, 109278 Passed, 3716 Skipped, 6m 7.24s Total duration (43m 49.8s time saved)

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 6.78%. Comparing base (7f679b3) to head (ad6a4d3).

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #9234       +/-   ##
===========================================
- Coverage   78.58%    6.78%   -71.81%     
===========================================
  Files        1277     1247       -30     
  Lines      120397   118617     -1780     
===========================================
- Hits        94611     8045    -86566     
- Misses      25786   110572    +84786     

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

@pr-commenter
Copy link

pr-commenter bot commented May 10, 2024

Benchmarks

Benchmark execution time: 2024-05-10 21:02:15

Comparing candidate commit ad6a4d3 in PR branch juanjux/ensure-no-expections-on-aspects with baseline commit 7f679b3 in branch main.

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

avara1986 and others added 3 commits May 13, 2024 09:33
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
…DataDog/dd-trace-py into juanjux/ensure-no-expections-on-aspects
@juanjux juanjux changed the title fix(asm): ensure new aspects does not raise exceptions if there is no tx_map fix(asm): ensure new aspects does not raise exceptions if there is no context May 13, 2024
@juanjux juanjux enabled auto-merge (squash) May 13, 2024 08:02
@juanjux juanjux disabled auto-merge May 13, 2024 08:02
@juanjux juanjux enabled auto-merge (squash) May 13, 2024 08:02
@juanjux juanjux disabled auto-merge May 13, 2024 08:05
@juanjux juanjux merged commit d0f56ab into main May 13, 2024
142 of 145 checks passed
@juanjux juanjux deleted the juanjux/ensure-no-expections-on-aspects branch May 13, 2024 08:05
Copy link

The backport to 2.9 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.9 2.9
# Navigate to the new working tree
cd .worktrees/backport-2.9
# Create a new branch
git switch --create backport-9234-to-2.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d0f56abd6053409b0f00fd7d8a77c199fa5ccd36
# Push it to GitHub
git push --set-upstream origin backport-9234-to-2.9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.9

Then, create a pull request where the base branch is 2.9 and the compare/head branch is backport-9234-to-2.9.

juanjux added a commit that referenced this pull request May 13, 2024
… context (#9234)

## Description

Ensure the new aspect don't raise exceptions if there is no tx_map,
instead just return the original function result.

## Checklist

- [X] Change(s) are motivated and described in the PR description
- [X] Testing strategy is described if automated tests are not included
in the PR
- [X] Risks are described (performance impact, potential for breakage,
maintainability)
- [X] Change is maintainable (easy to change, telemetry, documentation)
- [X] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed or label `changelog/no-changelog` is set
- [X] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/))
- [X] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))
- [X] If this PR changes the public interface, I've notified
`@DataDog/apm-tees`.

## Reviewer Checklist

- [x] Title is accurate
- [x] All changes are related to the pull request's stated goal
- [x] Description motivates each change
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- [x] Testing strategy adequately addresses listed risks
- [x] Change is maintainable (easy to change, telemetry, documentation)
- [x] Release note makes sense to a user of the library
- [x] Author has acknowledged and discussed the performance implications
of this PR as reported in the benchmarks PR comment
- [x] 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)

---------

Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Co-authored-by: Alberto Vara <alberto.vara@datadoghq.com>
(cherry picked from commit d0f56ab)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASM Application Security Monitoring backport 2.9 changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants