Skip to content

Commit 450121e

Browse files
authored
Merge branch 'main' into quinna.halim/add-error-extensions-graphql
2 parents c75c6e1 + af9098c commit 450121e

File tree

1,034 files changed

+23434
-14536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,034 files changed

+23434
-14536
lines changed

.circleci/config.templ.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -404,25 +404,12 @@ jobs:
404404
paths:
405405
- "."
406406

407-
appsec_iast_packages:
408-
<<: *machine_executor
409-
parallelism: 5
410-
steps:
411-
- when:
412-
condition:
413-
matches: { pattern: "main", value: << pipeline.git.branch >> }
414-
steps:
415-
- run_test:
416-
pattern: 'appsec_iast_packages'
417-
snapshot: true
418-
- run: echo "This test is skipped outside of main branch"
419-
420-
appsec_integrations:
407+
appsec_integrations_pygoat:
421408
<<: *machine_executor
422409
parallelism: 13
423410
steps:
424411
- run_test:
425-
pattern: 'appsec_integrations'
412+
pattern: 'appsec_integrations_pygoat'
426413
snapshot: true
427414
run_agent_checks: false
428415
docker_services: "pygoat"

.github/CODEOWNERS

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,17 @@ benchmarks/base/aspects_benchmarks_generate.py @DataDog/asm-python
110110
ddtrace/appsec/ @DataDog/asm-python
111111
ddtrace/settings/asm.py @DataDog/asm-python
112112
ddtrace/contrib/subprocess/ @DataDog/asm-python
113+
ddtrace/contrib/internal/subprocess/ @DataDog/asm-python
113114
ddtrace/contrib/flask_login/ @DataDog/asm-python
114115
ddtrace/contrib/webbrowser @DataDog/asm-python
115116
ddtrace/contrib/urllib @DataDog/asm-python
116117
ddtrace/internal/_exceptions.py @DataDog/asm-python
118+
ddtrace/internal/appsec/ @DataDog/asm-python
119+
ddtrace/internal/iast/ @DataDog/asm-python
117120
tests/appsec/ @DataDog/asm-python
118121
tests/contrib/dbapi/test_dbapi_appsec.py @DataDog/asm-python
119122
tests/contrib/subprocess @DataDog/asm-python
120123
tests/contrib/flask/test_flask_appsec.py @DataDog/asm-python
121-
tests/contrib/django/django_app/appsec_urls.py @DataDog/asm-python
122-
tests/contrib/django/test_django_appsec.py @DataDog/asm-python
123124
tests/snapshots/tests*appsec*.json @DataDog/asm-python
124125
tests/contrib/*/test*appsec*.py @DataDog/asm-python
125126
scripts/iast/* @DataDog/asm-python
@@ -146,6 +147,8 @@ ddtrace/contrib/internal/google_generativeai @DataDog/ml-observabilit
146147
ddtrace/contrib/google_generativeai @DataDog/ml-observability
147148
ddtrace/contrib/internal/vertexai @DataDog/ml-observability
148149
ddtrace/contrib/vertexai @DataDog/ml-observability
150+
ddtrace/contrib/langgraph @DataDog/ml-observability
151+
ddtrace/contrib/internal/langgraph @DataDog/ml-observability
149152
tests/llmobs @DataDog/ml-observability
150153
tests/contrib/openai @DataDog/ml-observability
151154
tests/contrib/langchain @DataDog/ml-observability
@@ -155,19 +158,22 @@ tests/contrib/botocore/bedrock_cassettes @DataDog/ml-observabilit
155158
tests/contrib/anthropic @DataDog/ml-observability
156159
tests/contrib/google_generativeai @DataDog/ml-observability
157160
tests/contrib/vertexai @DataDog/ml-observability
161+
tests/contrib/langgraph @DataDog/ml-observability
158162
.gitlab/tests/llmobs.yml @DataDog/ml-observability
159163

160164
# Remote Config
161165
ddtrace/internal/remoteconfig @DataDog/remote-config @DataDog/apm-core-python
162166
tests/internal/remoteconfig @DataDog/remote-config @DataDog/apm-core-python
163167

164168
# API SDK
169+
ddtrace/trace/ @DataDog/apm-sdk-api-python
165170
ddtrace/_trace/ @DataDog/apm-sdk-api-python
166171
ddtrace/opentelemetry/ @DataDog/apm-sdk-api-python
167172
ddtrace/internal/opentelemetry @DataDog/apm-sdk-api-python
168173
ddtrace/opentracer/ @DataDog/apm-sdk-api-python
169174
ddtrace/propagation/ @DataDog/apm-sdk-api-python
170175
ddtrace/filters.py @DataDog/apm-sdk-api-python
176+
ddtrace/provider.py @DataDog/apm-sdk-api-python
171177
ddtrace/pin.py @DataDog/apm-sdk-api-python
172178
ddtrace/sampler.py @DataDog/apm-sdk-api-python
173179
ddtrace/sampling_rule.py @DataDog/apm-sdk-api-python

.github/workflows/build-and-publish-image.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on:
2626
jobs:
2727
build_push:
2828
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
packages: write
2932
steps:
3033
- uses: actions/checkout@v4
3134
with:

.github/workflows/build_python_3.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ jobs:
3535
cibuildwheel --print-build-identifiers --platform linux --arch x86_64,i686 | jq -cR '{only: ., os: "ubuntu-latest"}' \
3636
&& cibuildwheel --print-build-identifiers --platform linux --arch aarch64 | jq -cR '{only: ., os: "arm-4core-linux"}' \
3737
&& cibuildwheel --print-build-identifiers --platform windows --arch AMD64,x86 | grep -v 313 | jq -cR '{only: ., os: "windows-latest"}' \
38-
&& cibuildwheel --print-build-identifiers --platform macos --arch x86_64,universal2 | jq -cR '{only: ., os: "macos-13"}'
38+
&& cibuildwheel --print-build-identifiers --platform macos --arch x86_64 | jq -cR '{only: ., os: "macos-13"}' \
39+
&& cibuildwheel --print-build-identifiers --platform macos --arch arm64 | jq -cR '{only: ., os: "macos-latest"}'
3940
} | jq -sc
4041
)
4142
echo $MATRIX_INCLUDE
@@ -112,6 +113,7 @@ jobs:
112113
choco install -y 7zip &&
113114
7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx &&
114115
move "{wheel}" "{dest_dir}"
116+
CIBW_TEST_COMMAND: "python {project}/tests/smoke_test.py"
115117
# DEV: Uncomment to debug MacOS
116118
# CIBW_BUILD_VERBOSITY_MACOS: 3
117119

@@ -132,6 +134,10 @@ jobs:
132134
CIBW_BEFORE_ALL_WINDOWS: rustup target add i686-pc-windows-msvc
133135
CIBW_BEFORE_ALL_MACOS: rustup target add aarch64-apple-darwin
134136
CIBW_ENVIRONMENT_LINUX: PATH=$HOME/.cargo/bin:$PATH CMAKE_BUILD_PARALLEL_LEVEL=24
137+
# SYSTEM_VERSION_COMPAT is a workaround for versioning issue, a.k.a.
138+
# `platform.mac_ver()` reports incorrect MacOS version at 11.0
139+
# See: https://stackoverflow.com/a/65402241
140+
CIBW_ENVIRONMENT_MACOS: CMAKE_BUILD_PARALLEL_LEVEL=24 SYSTEM_VERSION_COMPAT=0
135141
CIBW_REPAIR_WHEEL_COMMAND_LINUX: |
136142
mkdir ./tempwheelhouse &&
137143
unzip -l {wheel} | grep '\.so' &&
@@ -148,6 +154,7 @@ jobs:
148154
choco install -y 7zip &&
149155
7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx &&
150156
move "{wheel}" "{dest_dir}"
157+
CIBW_TEST_COMMAND: "python {project}/tests/smoke_test.py"
151158
# DEV: Uncomment to debug MacOS
152159
# CIBW_BUILD_VERBOSITY_MACOS: 3
153160

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Check for Safe main Merge
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '3.x-staging'
7+
8+
jobs:
9+
check-merge:
10+
runs-on: ubuntu-latest
11+
steps:
12+
# Step 1: Checkout the repository
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
# Step 2: Fetch the main branch
17+
- name: Fetch main branch
18+
run: git fetch origin main
19+
20+
# Step 3: Attempt to merge
21+
- name: Check merge conflicts
22+
run: |
23+
git merge --no-commit --no-ff origin/main || exit 1
24+
# Step 4: Clean up the merge (optional)
25+
- name: Abort merge
26+
if: failure()
27+
run: git merge --abort

.github/workflows/profiling-native.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
jobs:
1515
test:
1616
runs-on: ${{ matrix.os }}
17-
timeout-minutes: 5
17+
timeout-minutes: 7
1818
strategy:
1919
fail-fast: false
2020
matrix:

.github/workflows/pypa_musllinux_1_2_i686.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
jobs:
1313
build-and-publish:
1414
uses: ./.github/workflows/build-and-publish-image.yml
15+
permissions:
16+
contents: read
17+
packages: write
1518
with:
1619
tags: 'ghcr.io/datadog/dd-trace-py/pypa_musllinux_1_2_i686:${{ github.sha }},ghcr.io/datadog/dd-trace-py/pypa_musllinux_1_2_i686:latest'
1720
platforms: 'linux/386'

.github/workflows/rust-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
extension: ["src/core"]
14+
extension: ["src/native"]
1515
steps:
1616
- uses: actions/checkout@v4
1717
with:

.github/workflows/system-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
- weblog-variant: fastapi
4848
# runs django-poc for 3.12
4949
- weblog-variant: python3.12
50+
- weblog-variant: django-py3.13
5051
fail-fast: false
5152
env:
5253
TEST_LIBRARY: python
@@ -96,7 +97,7 @@ jobs:
9697
needs: [system-tests-build-agent, system-tests-build-weblog]
9798
strategy:
9899
matrix:
99-
weblog-variant: [flask-poc, uwsgi-poc , django-poc, fastapi, python3.12]
100+
weblog-variant: [flask-poc, uwsgi-poc , django-poc, fastapi, python3.12, django-py3.13]
100101
scenario: [remote-config, appsec, appsec-1, other, debugger-1, debugger-2]
101102

102103
fail-fast: false

.github/workflows/test_frameworks.yml

Lines changed: 0 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -111,68 +111,6 @@ jobs:
111111
if: needs.needs-run.outputs.outcome == 'success'
112112
run: cat debugger-expl.txt
113113

114-
sanic-testsuite:
115-
strategy:
116-
matrix:
117-
include:
118-
# TODO: profiling fails with a timeout error
119-
#- suffix: Profiling
120-
# profiling: 1
121-
# iast: 0
122-
# appsec: 0
123-
- suffix: IAST
124-
profiling: 0
125-
iast: 1
126-
appsec: 0
127-
- suffix: APPSEC
128-
profiling: 0
129-
iast: 0
130-
appsec: 1
131-
- suffix: Tracer only
132-
profiling: 0
133-
iast: 0
134-
appsec: 0
135-
name: Sanic 24.6 (with ${{ matrix.suffix }})
136-
runs-on: ubuntu-20.04
137-
needs: needs-run
138-
timeout-minutes: 15
139-
env:
140-
DD_PROFILING_ENABLED: ${{ matrix.profiling }}
141-
DD_IAST_ENABLED: ${{ matrix.iast }}
142-
DD_APPSEC_ENABLED: ${{ matrix.appsec }}
143-
DD_TESTING_RAISE: true
144-
CMAKE_BUILD_PARALLEL_LEVEL: 12
145-
DD_DEBUGGER_EXPL_OUTPUT_FILE: debugger-expl.txt
146-
defaults:
147-
run:
148-
working-directory: sanic
149-
steps:
150-
- uses: actions/checkout@v4
151-
if: needs.needs-run.outputs.outcome == 'success'
152-
with:
153-
persist-credentials: false
154-
path: ddtrace
155-
- uses: actions/checkout@v4
156-
if: needs.needs-run.outputs.outcome == 'success'
157-
with:
158-
persist-credentials: false
159-
repository: sanic-org/sanic
160-
ref: v24.6.0
161-
path: sanic
162-
- uses: actions/setup-python@v5
163-
if: needs.needs-run.outputs.outcome == 'success'
164-
with:
165-
python-version: "3.11"
166-
- name: Install sanic and dependencies required to run tests
167-
if: needs.needs-run.outputs.outcome == 'success'
168-
run: pip3 install '.[test]' aioquic
169-
- name: Install ddtrace
170-
if: needs.needs-run.outputs.outcome == 'success'
171-
run: pip3 install ../ddtrace
172-
- name: Run tests
173-
if: needs.needs-run.outputs.outcome == 'success'
174-
run: ddtrace-run pytest -k "not test_reloader and not test_reload_listeners and not test_no_exceptions_when_cancel_pending_request and not test_add_signal and not test_ode_removes and not test_skip_touchup and not test_dispatch_signal_triggers and not test_keep_alive_connection_context and not test_redirect_with_params and not test_keep_alive_client_timeout and not test_logger_vhosts and not test_ssl_in_multiprocess_mode"
175-
176114
django-testsuite:
177115
strategy:
178116
matrix:
@@ -963,58 +901,3 @@ jobs:
963901
- name: Debugger exploration results
964902
if: needs.needs-run.outputs.outcome == 'success'
965903
run: cat debugger-expl.txt
966-
967-
beautifulsoup-testsuite-4_12_3:
968-
strategy:
969-
matrix:
970-
include:
971-
# TODO: profiling is disabled due to a bug in the profiler paths
972-
# - suffix: Profiling
973-
# profiling: 1
974-
# iast: 0
975-
# appsec: 0
976-
- suffix: IAST
977-
profiling: 0
978-
iast: 1
979-
appsec: 0
980-
- suffix: APPSEC
981-
profiling: 0
982-
iast: 0
983-
appsec: 1
984-
- suffix: Tracer only
985-
profiling: 0
986-
iast: 0
987-
appsec: 0
988-
name: Beautifulsoup 4.12.3 (with ${{ matrix.suffix }})
989-
runs-on: "ubuntu-latest"
990-
needs: needs-run
991-
env:
992-
DD_TESTING_RAISE: true
993-
DD_PROFILING_ENABLED: ${{ matrix.profiling }}
994-
DD_IAST_ENABLED: ${{ matrix.iast }}
995-
DD_APPSEC_ENABLED: ${{ matrix.appsec }}
996-
CMAKE_BUILD_PARALLEL_LEVEL: 12
997-
DD_DEBUGGER_EXPL_OUTPUT_FILE: debugger-expl.txt
998-
steps:
999-
- uses: actions/setup-python@v5
1000-
if: needs.needs-run.outputs.outcome == 'success'
1001-
with:
1002-
python-version: '3.9'
1003-
- uses: actions/checkout@v4
1004-
if: needs.needs-run.outputs.outcome == 'success'
1005-
with:
1006-
persist-credentials: false
1007-
path: ddtrace
1008-
- name: Checkout beautifulsoup
1009-
if: needs.needs-run.outputs.outcome == 'success'
1010-
run: |
1011-
git clone -b 4.12.3 https://git.launchpad.net/beautifulsoup
1012-
- name: Install ddtrace
1013-
if: needs.needs-run.outputs.outcome == 'success'
1014-
run: pip3 install ./ddtrace
1015-
- name: Pytest fix
1016-
if: needs.needs-run.outputs.outcome == 'success'
1017-
run: pip install pytest==8.2.1
1018-
- name: Run tests
1019-
if: needs.needs-run.outputs.outcome == 'success'
1020-
run: cd beautifulsoup && ddtrace-run pytest

.gitlab-ci.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ stages:
66
- shared-pipeline
77
- benchmarks
88
- macrobenchmarks
9+
- benchmarks-report
910
- release
1011

1112
variables:
@@ -59,18 +60,20 @@ onboarding_tests_installer:
5960
matrix:
6061
- ONBOARDING_FILTER_WEBLOG: [test-app-python,test-app-python-container,test-app-python-alpine]
6162

62-
6363
onboarding_tests_k8s_injection:
6464
parallel:
6565
matrix:
66-
- WEBLOG_VARIANT:
67-
- dd-lib-python-init-test-django
68-
- dd-lib-python-init-test-django-gunicorn
69-
- dd-lib-python-init-test-django-gunicorn-alpine
70-
- dd-lib-python-init-test-django-preinstalled
71-
- dd-lib-python-init-test-django-unsupported-package-force
72-
- dd-lib-python-init-test-django-uvicorn
73-
- dd-lib-python-init-test-protobuf-old
66+
- WEBLOG_VARIANT: [dd-lib-python-init-test-django, ]
67+
SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_UDS, K8S_LIB_INJECTION_NO_AC, K8S_LIB_INJECTION_NO_AC_UDS, K8S_LIB_INJECTION_PROFILING_DISABLED, K8S_LIB_INJECTION_PROFILING_ENABLED, K8S_LIB_INJECTION_PROFILING_OVERRIDE]
68+
K8S_CLUSTER_VERSION: ['7.56.2', '7.59.0']
69+
70+
- WEBLOG_VARIANT: [dd-lib-python-init-test-django-gunicorn, dd-lib-python-init-test-django-gunicorn-alpine, dd-lib-python-init-test-django-unsupported-package-force, dd-lib-python-init-test-django-uvicorn, dd-lib-python-init-test-protobuf-old ]
71+
SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_PROFILING_ENABLED]
72+
K8S_CLUSTER_VERSION: ['7.56.2', '7.59.0']
73+
74+
- WEBLOG_VARIANT: [dd-lib-python-init-test-django-preinstalled]
75+
SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_UDS, K8S_LIB_INJECTION_NO_AC, K8S_LIB_INJECTION_NO_AC_UDS]
76+
K8S_CLUSTER_VERSION: ['7.56.2', '7.59.0']
7477

7578
deploy_to_di_backend:manual:
7679
stage: shared-pipeline

0 commit comments

Comments
 (0)