Skip to content

Commit

Permalink
Merge branch 'main' into munir/decouple-telemetry-writer-from-global-…
Browse files Browse the repository at this point in the history
…config
  • Loading branch information
mabdinur authored Oct 7, 2024
2 parents 02bc9da + 5f25f36 commit 9f0d9f9
Show file tree
Hide file tree
Showing 51 changed files with 461 additions and 312 deletions.
1 change: 1 addition & 0 deletions .github/workflows/django-overhead-profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
runs-on: ubuntu-latest
env:
PREFIX: ${{ github.workspace }}/prefix
DD_CODE_ORIGIN_FOR_SPANS_ENABLED: "1"
defaults:
run:
working-directory: ddtrace
Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,15 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
archs: x86_64 i686
#- os: arm-4core-linux
# archs: aarch64
- os: windows-latest
archs: AMD64 x86
- os: macos-latest
archs: arm64
os: [ubuntu-latest, windows-latest, macos-latest]
# Keep this in sync with hatch.toml
python-version: ["3.7", "3.10", "3.12"]
steps:
- uses: actions/checkout@v4
# Include all history and tags
with:
fetch-depth: 0

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.12'

- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install latest stable toolchain and rustfmt
run: rustup update stable && rustup default stable && rustup component add rustfmt clippy
Expand All @@ -44,4 +33,4 @@ jobs:
version: "1.12.0"

- name: Run tests
run: hatch run ddtrace_unit_tests:test
run: hatch run +py=${{ matrix.python-version }} ddtrace_unit_tests:test
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,21 @@ ddtrace/_version.py
artifacts/

# IAST cpp
ddtrace/appsec/_iast/_taint_tracking/cmake_install.cmake
ddtrace/appsec/_iast/_taint_tracking/CMakeCache.txt
ddtrace/appsec/_iast/_taint_tracking/Makefile
ddtrace/appsec/_iast/_taint_tracking/cmake-build-debug/*
ddtrace/appsec/_iast/_taint_tracking/_deps/*
ddtrace/appsec/_iast/_taint_tracking/CMakeFiles/*

ddtrace/appsec/_iast/_taint_tracking/tests/CMakeFiles/*
ddtrace/appsec/_iast/_taint_tracking/tests/cmake_install.cmake
ddtrace/appsec/_iast/_taint_tracking/tests/CMakeCache.txt
ddtrace/appsec/_iast/_taint_tracking/tests/Makefile
ddtrace/appsec/_iast/_taint_tracking/tests/CTestTestfile.cmake
ddtrace/appsec/_iast/_taint_tracking/tests/native_tests*
ddtrace/appsec/_iast/_taint_tracking/_vendor/pybind11/Makefile
ddtrace/appsec/_iast/_taint_tracking/_vendor/pybind11/CMakeFiles/*
ddtrace/appsec/_iast/_taint_tracking/_vendor/pybind11/cmake_install.cmake
# CircleCI generated config
.circleci/config.gen.yml

Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ package-oci:
onboarding_tests_installer:
parallel:
matrix:
- ONBOARDING_FILTER_WEBLOG: [test-app-python,test-app-python-container,test-app-python-alpine-libgcc]
- ONBOARDING_FILTER_WEBLOG: [test-app-python,test-app-python-container,test-app-python-alpine]


onboarding_tests_k8s_injection:
Expand Down
36 changes: 18 additions & 18 deletions .riot/requirements/1280196.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/1280196.in
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1280196.in
#
attrs==23.1.0
beautifulsoup4==4.12.2
bottle==0.12.25
coverage[toml]==7.3.4
exceptiongroup==1.2.0
attrs==24.2.0
beautifulsoup4==4.12.3
bottle==0.13.1
coverage[toml]==7.6.1
exceptiongroup==1.2.2
hypothesis==6.45.0
importlib-metadata==7.0.0
importlib-metadata==8.5.0
iniconfig==2.0.0
mock==5.1.0
opentracing==2.4.0
packaging==23.2
pluggy==1.3.0
pytest==7.4.3
pytest-cov==4.1.0
pytest-mock==3.12.0
packaging==24.1
pluggy==1.5.0
pytest==8.3.3
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sortedcontainers==2.4.0
soupsieve==2.5
tomli==2.0.1
waitress==2.1.2
webob==1.8.7
webtest==3.0.0
zipp==3.17.0
soupsieve==2.6
tomli==2.0.2
waitress==3.0.0
webob==1.8.8
webtest==3.0.1
zipp==3.20.2
34 changes: 17 additions & 17 deletions .riot/requirements/15dee3b.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/15dee3b.in
# pip-compile --allow-unsafe --no-annotate .riot/requirements/15dee3b.in
#
attrs==23.1.0
beautifulsoup4==4.12.2
attrs==24.2.0
beautifulsoup4==4.12.3
bottle==0.12.25
coverage[toml]==7.3.4
exceptiongroup==1.2.0
coverage[toml]==7.6.1
exceptiongroup==1.2.2
hypothesis==6.45.0
importlib-metadata==7.0.0
importlib-metadata==8.5.0
iniconfig==2.0.0
mock==5.1.0
opentracing==2.4.0
packaging==23.2
pluggy==1.3.0
pytest==7.4.3
pytest-cov==4.1.0
pytest-mock==3.12.0
packaging==24.1
pluggy==1.5.0
pytest==8.3.3
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sortedcontainers==2.4.0
soupsieve==2.5
tomli==2.0.1
waitress==2.1.2
webob==1.8.7
webtest==3.0.0
zipp==3.17.0
soupsieve==2.6
tomli==2.0.2
waitress==3.0.0
webob==1.8.8
webtest==3.0.1
zipp==3.20.2
16 changes: 8 additions & 8 deletions .riot/requirements/18b1b66.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
# This file is autogenerated by pip-compile with Python 3.7
# by the following command:
#
# pip-compile --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/18b1b66.in
# pip-compile --allow-unsafe --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/18b1b66.in
#
attrs==23.1.0
beautifulsoup4==4.12.2
attrs==24.2.0
beautifulsoup4==4.12.3
bottle==0.12.25
coverage[toml]==7.2.7
exceptiongroup==1.2.0
exceptiongroup==1.2.2
hypothesis==6.45.0
importlib-metadata==6.7.0
iniconfig==2.0.0
mock==5.1.0
opentracing==2.4.0
packaging==23.2
packaging==24.0
pluggy==1.2.0
pytest==7.4.3
pytest==7.4.4
pytest-cov==4.1.0
pytest-mock==3.11.1
pytest-randomly==3.12.0
Expand All @@ -25,6 +25,6 @@ soupsieve==2.4.1
tomli==2.0.1
typing-extensions==4.7.1
waitress==2.1.2
webob==1.8.7
webtest==3.0.0
webob==1.8.8
webtest==3.0.1
zipp==3.15.0
36 changes: 18 additions & 18 deletions .riot/requirements/573fdbf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/573fdbf.in
# pip-compile --allow-unsafe --no-annotate .riot/requirements/573fdbf.in
#
attrs==23.1.0
beautifulsoup4==4.12.2
bottle==0.12.25
coverage[toml]==7.3.4
exceptiongroup==1.2.0
attrs==24.2.0
beautifulsoup4==4.12.3
bottle==0.13.1
coverage[toml]==7.6.1
exceptiongroup==1.2.2
hypothesis==6.45.0
importlib-metadata==7.0.0
importlib-metadata==8.5.0
iniconfig==2.0.0
mock==5.1.0
opentracing==2.4.0
packaging==23.2
pluggy==1.3.0
pytest==7.4.3
pytest-cov==4.1.0
pytest-mock==3.12.0
packaging==24.1
pluggy==1.5.0
pytest==8.3.3
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sortedcontainers==2.4.0
soupsieve==2.5
tomli==2.0.1
waitress==2.1.2
webob==1.8.7
webtest==3.0.0
zipp==3.17.0
soupsieve==2.6
tomli==2.0.2
waitress==3.0.0
webob==1.8.8
webtest==3.0.1
zipp==3.20.2
18 changes: 9 additions & 9 deletions .riot/requirements/760d56e.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
# This file is autogenerated by pip-compile with Python 3.7
# by the following command:
#
# pip-compile --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/760d56e.in
# pip-compile --allow-unsafe --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/760d56e.in
#
attrs==23.1.0
beautifulsoup4==4.12.2
bottle==0.12.25
attrs==24.2.0
beautifulsoup4==4.12.3
bottle==0.13.1
coverage[toml]==7.2.7
exceptiongroup==1.2.0
exceptiongroup==1.2.2
hypothesis==6.45.0
importlib-metadata==6.7.0
iniconfig==2.0.0
mock==5.1.0
opentracing==2.4.0
packaging==23.2
packaging==24.0
pluggy==1.2.0
pytest==7.4.3
pytest==7.4.4
pytest-cov==4.1.0
pytest-mock==3.11.1
pytest-randomly==3.12.0
Expand All @@ -25,6 +25,6 @@ soupsieve==2.4.1
tomli==2.0.1
typing-extensions==4.7.1
waitress==2.1.2
webob==1.8.7
webtest==3.0.0
webob==1.8.8
webtest==3.0.1
zipp==3.15.0
34 changes: 17 additions & 17 deletions .riot/requirements/8c110bf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/8c110bf.in
# pip-compile --allow-unsafe --no-annotate .riot/requirements/8c110bf.in
#
attrs==23.1.0
beautifulsoup4==4.12.2
attrs==24.2.0
beautifulsoup4==4.12.3
bottle==0.12.25
coverage[toml]==7.3.4
exceptiongroup==1.2.0
coverage[toml]==7.6.1
exceptiongroup==1.2.2
hypothesis==6.45.0
importlib-metadata==7.0.0
importlib-metadata==8.5.0
iniconfig==2.0.0
mock==5.1.0
opentracing==2.4.0
packaging==23.2
pluggy==1.3.0
pytest==7.4.3
pytest-cov==4.1.0
pytest-mock==3.12.0
packaging==24.1
pluggy==1.5.0
pytest==8.3.3
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sortedcontainers==2.4.0
soupsieve==2.5
tomli==2.0.1
waitress==2.1.2
webob==1.8.7
webtest==3.0.0
zipp==3.17.0
soupsieve==2.6
tomli==2.0.2
waitress==3.0.0
webob==1.8.8
webtest==3.0.1
zipp==3.20.2
13 changes: 7 additions & 6 deletions ddtrace/appsec/_iast/_taint_tracking/Aspects/AspectJoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ aspect_join_str(PyObject* sep,

PyObject* new_result{ new_pyobject_id(result) };
set_tainted_object(new_result, result_to, tx_taint_map);
Py_DecRef(result);
Py_DECREF(result);
return new_result;
}

Expand Down Expand Up @@ -134,7 +134,7 @@ aspect_join(PyObject* sep, PyObject* result, PyObject* iterable_elements, const

PyObject* new_result{ new_pyobject_id(result) };
set_tainted_object(new_result, result_to, tx_taint_map);
Py_DecRef(result);
Py_DECREF(result);
return new_result;
}

Expand All @@ -158,9 +158,10 @@ api_join_aspect(PyObject* self, PyObject* const* args, const Py_ssize_t nargs)
PyObject* list_aux = PyList_New(0);
while ((item = PyIter_Next(iterator))) {
PyList_Append(list_aux, item);
Py_DECREF(item);
}
arg0 = list_aux;
Py_DecRef(iterator);
Py_DECREF(iterator);
decref_arg0 = true;
}
}
Expand All @@ -181,7 +182,7 @@ api_join_aspect(PyObject* self, PyObject* const* args, const Py_ssize_t nargs)

if (has_pyerr()) {
if (decref_arg0) {
Py_DecRef(arg0);
Py_DECREF(arg0);
}
return nullptr;
}
Expand All @@ -190,13 +191,13 @@ api_join_aspect(PyObject* self, PyObject* const* args, const Py_ssize_t nargs)
if (not ctx_map or ctx_map->empty() or get_pyobject_size(result) == 0) {
// Empty result cannot have taint ranges
if (decref_arg0) {
Py_DecRef(arg0);
Py_DECREF(arg0);
}
return result;
}
auto res = aspect_join(sep, result, arg0, ctx_map);
if (decref_arg0) {
Py_DecRef(arg0);
Py_DECREF(arg0);
}
return res;
});
Expand Down
Loading

0 comments on commit 9f0d9f9

Please sign in to comment.