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(lib-injection): ensure any user defined sitecustomize.py is loaded after injection #11469

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

Conversation

brettlangdon
Copy link
Member

@brettlangdon brettlangdon commented Nov 20, 2024

Right now we do not preserve any user defined sitecustomize.py.

In theory we should be because we import ddtrace.bootstrap.sitecustomize which has this logic built-in, but only if the .../site-packages/ddtrace/bootstrap/ directory exists in the sys.path.

The fix here is easy, that we ensure that the ddtrace/bootstrap directory is added to the sys.path first before import ddtrace.bootstrap.sitecustomize.

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

Copy link
Contributor

CODEOWNERS have been resolved as:

releasenotes/notes/fix-lib-injection-user-sitecustomize-4ebc76e1b722490f.yaml  @DataDog/apm-python
lib-injection/sources/sitecustomize.py                                  @DataDog/apm-core-python

@pr-commenter
Copy link

pr-commenter bot commented Nov 20, 2024

Benchmarks

Benchmark execution time: 2024-11-20 20:13:43

Comparing candidate commit f93dd90 in PR branch brettlangdon/INPLAT-203 with baseline commit 7e1bb89 in branch main.

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

@brettlangdon
Copy link
Member Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Nov 21, 2024

Devflow running: /merge

View all feedbacks in Devflow UI.


2024-11-21 13:15:31 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2024-11-21 14:46:00 UTC ℹ️ MergeQueue: merge request added to the queue

The median merge time in main is 35m.


2024-11-21 16:46:39 UTCMergeQueue: The build pipeline has timeout

The merge request has been interrupted because the build took longer than expected. The current limit for the base branch 'main' is 120 minutes.

Possible reasons:

  • some mandatory checkruns are failing:
    • require-checklist

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