Skip to content

Commit

Permalink
Merge branch 'main' into munir/add-support-for-http-error-status-env
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Oct 2, 2024
2 parents aaa6585 + afb6f2f commit 7cb25d0
Show file tree
Hide file tree
Showing 397 changed files with 17,218 additions and 5,747 deletions.
45 changes: 25 additions & 20 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,31 @@ tests/runtime @DataDog/apm-core-python
tests/tracer @DataDog/apm-core-python

# CI App and related
ddtrace/contrib/coverage @DataDog/ci-app-libraries
ddtrace/contrib/pytest @DataDog/ci-app-libraries
ddtrace/contrib/pytest_bdd @DataDog/ci-app-libraries
ddtrace/contrib/unittest @DataDog/ci-app-libraries
tests/contrib/pytest @DataDog/ci-app-libraries
tests/contrib/pytest_bdd @DataDog/ci-app-libraries
tests/contrib/unittest_plugin @DataDog/ci-app-libraries
ddtrace/ext/ci.py @DataDog/ci-app-libraries
ddtrace/ext/test_visibility @DataDog/ci-app-libraries
ddtrace/ext/test.py @DataDog/ci-app-libraries
ddtrace/internal/ci_visibility @DataDog/ci-app-libraries
ddtrace/internal/test_visibility @DataDog/ci-app-libraries
ddtrace/internal/codeowners.py @DataDog/apm-core-python @datadog/ci-app-libraries
ddtrace/internal/coverage @DataDog/apm-core-python @datadog/ci-app-libraries
tests/internal/test_codeowners.py @datadog/ci-app-libraries
tests/ci_visibility @DataDog/ci-app-libraries
tests/coverage @DataDog/apm-core-python @DataDog/ci-app-libraries
tests/tracer/test_ci.py @DataDog/ci-app-libraries
ddtrace/ext/git.py @DataDog/ci-app-libraries @DataDog/apm-core-python
scripts/ci_visibility/* @DataDog/ci-app-libraries
ddtrace/contrib/asynctest @DataDog/ci-app-libraries
ddtrace/contrib/coverage @DataDog/ci-app-libraries
ddtrace/contrib/pytest @DataDog/ci-app-libraries
ddtrace/contrib/pytest_bdd @DataDog/ci-app-libraries
ddtrace/contrib/pytest_benchmark @DataDog/ci-app-libraries
ddtrace/contrib/unittest @DataDog/ci-app-libraries
tests/contrib/asynctest @DataDog/ci-app-libraries
tests/contrib/pytest @DataDog/ci-app-libraries
tests/contrib/pytest_bdd @DataDog/ci-app-libraries
tests/contrib/pytest_benchmark @DataDog/ci-app-libraries
tests/contrib/unittest @DataDog/ci-app-libraries
tests/integration/test_integration_civisibility.py @DataDog/ci-app-libraries
ddtrace/ext/ci.py @DataDog/ci-app-libraries
ddtrace/ext/test_visibility @DataDog/ci-app-libraries
ddtrace/ext/test.py @DataDog/ci-app-libraries
ddtrace/internal/ci_visibility @DataDog/ci-app-libraries
ddtrace/internal/test_visibility @DataDog/ci-app-libraries
ddtrace/internal/codeowners.py @DataDog/apm-core-python @datadog/ci-app-libraries
ddtrace/internal/coverage @DataDog/apm-core-python @datadog/ci-app-libraries
tests/internal/test_codeowners.py @datadog/ci-app-libraries
tests/ci_visibility @DataDog/ci-app-libraries
tests/coverage @DataDog/apm-core-python @DataDog/ci-app-libraries
tests/tracer/test_ci.py @DataDog/ci-app-libraries
ddtrace/ext/git.py @DataDog/ci-app-libraries @DataDog/apm-core-python
scripts/ci_visibility/* @DataDog/ci-app-libraries

# Debugger
ddtrace/debugging/ @DataDog/debugger-python
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_python_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
platforms: all

- name: Build wheels arm64
if: matrix.os == 'arm-4core-linux'
if: always() && matrix.os == 'arm-4core-linux'
run: /home/runner/.local/bin/pipx run cibuildwheel==2.16.5 --only ${{ matrix.only }}
env:
CIBW_SKIP: ${{ inputs.cibw_skip }}
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
# CIBW_BUILD_VERBOSITY_MACOS: 3

- name: Build wheels
if: matrix.os != 'arm-4core-linux'
if: always() && matrix.os != 'arm-4core-linux'
uses: pypa/cibuildwheel@v2.16.5
with:
only: ${{ matrix.only }}
Expand Down
92 changes: 28 additions & 64 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,24 @@ on:
types: [checks_requested]

jobs:
needs-run:
runs-on: ubuntu-latest
outputs:
outcome: ${{ steps.run_needed.outcome }}
steps:
- uses: actions/checkout@v4
- id: run_needed
name: Check if run is needed
run: |
git fetch origin ${{ github.event.pull_request.base.sha || github.sha }}
export PATHS=$(git diff --name-only HEAD ${{ github.event.pull_request.base.sha || github.sha }})
python -c "import os,sys,fnmatch;sys.exit(not bool([_ for pattern in {'ddtrace/*', 'setup*', 'pyproject.toml', '.github/workflows/system-tests.yml'} for _ in fnmatch.filter(os.environ['PATHS'].splitlines(), pattern)]))"
continue-on-error: true

system-tests-build-agent:
runs-on: ubuntu-latest
needs: needs-run
steps:

- name: Checkout system tests
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'

- name: Build agent
id: build
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./build.sh -i agent

- name: Save
id: save
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: |
docker image save system_tests/agent:latest | gzip > agent_${{ github.sha }}.tar.gz
- uses: actions/upload-artifact@v4
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
with:
name: agent_${{ github.sha }}
path: |
Expand All @@ -59,7 +39,6 @@ jobs:

system-tests-build-weblog:
runs-on: ubuntu-latest
needs: needs-run
strategy:
matrix:
include:
Expand All @@ -85,13 +64,11 @@ jobs:
steps:

- name: Checkout system tests
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'

- name: Checkout dd-trace-py
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/checkout@v4
with:
path: 'binaries/dd-trace-py'
Expand All @@ -101,18 +78,14 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Build
id: build
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./build.sh -i weblog

- name: Save
id: save
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: |
docker image save system_tests/weblog:latest | gzip > ${{ matrix.weblog-variant}}_weblog_${{ github.sha }}.tar.gz
- uses: actions/upload-artifact@v4
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
with:
name: ${{ matrix.weblog-variant }}_${{ github.sha }}
path: |
Expand All @@ -121,7 +94,7 @@ jobs:

system-tests:
runs-on: ubuntu-latest
needs: [needs-run, system-tests-build-agent, system-tests-build-weblog]
needs: [system-tests-build-agent, system-tests-build-weblog]
strategy:
matrix:
weblog-variant: [flask-poc, uwsgi-poc , django-poc, fastapi, python3.12]
Expand All @@ -143,131 +116,126 @@ jobs:
steps:

- name: Checkout system tests
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'

- name: Build runner
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: ./.github/actions/install_runner

- uses: actions/download-artifact@v4
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
with:
name: ${{ matrix.weblog-variant }}_${{ github.sha }}
path: images_artifacts/

- uses: actions/download-artifact@v4
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
with:
name: agent_${{ github.sha }}
path: images_artifacts/

- name: docker load
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
id: docker_load
run: |
docker load < images_artifacts/${{ matrix.weblog-variant}}_weblog_${{ github.sha }}.tar.gz
docker load < images_artifacts/agent_${{ github.sha }}.tar.gz
- name: Run DEFAULT
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'other'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'other'
run: ./run.sh DEFAULT

- name: Run SAMPLING
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'other'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'other'
run: ./run.sh SAMPLING

- name: Run INTEGRATIONS
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'other'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'other'
run: ./run.sh INTEGRATIONS

- name: Run CROSSED_TRACING_LIBRARIES
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'other'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'other'
run: ./run.sh CROSSED_TRACING_LIBRARIES

- name: Run REMOTE_CONFIG_MOCKED_BACKEND_ASM_FEATURES
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'remote-config'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'remote-config'
run: ./run.sh REMOTE_CONFIG_MOCKED_BACKEND_ASM_FEATURES

- name: Run REMOTE_CONFIG_MOCKED_BACKEND_LIVE_DEBUGGING
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'remote-config'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'remote-config'
run: ./run.sh REMOTE_CONFIG_MOCKED_BACKEND_LIVE_DEBUGGING

- name: Run REMOTE_CONFIG_MOCKED_BACKEND_ASM_DD
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'remote-config'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'remote-config'
run: ./run.sh REMOTE_CONFIG_MOCKED_BACKEND_ASM_DD

- name: Run APPSEC_MISSING_RULES
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec'
run: ./run.sh APPSEC_MISSING_RULES

- name: Run APPSEC_CUSTOM_RULES
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec'
run: ./run.sh APPSEC_CUSTOM_RULES

- name: Run APPSEC_CORRUPTED_RULES
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec'
run: ./run.sh APPSEC_CORRUPTED_RULES

- name: Run APPSEC_RULES_MONITORING_WITH_ERRORS
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec'
run: ./run.sh APPSEC_RULES_MONITORING_WITH_ERRORS

- name: Run APPSEC_LOW_WAF_TIMEOUT
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec'
run: ./run.sh APPSEC_LOW_WAF_TIMEOUT

- name: Run APPSEC_CUSTOM_OBFUSCATION
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec'
run: ./run.sh APPSEC_CUSTOM_OBFUSCATION

- name: Run APPSEC_RATE_LIMITER
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec'
run: ./run.sh APPSEC_RATE_LIMITER

- name: Run APPSEC_STANDALONE
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec-1'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec-1'
run: ./run.sh APPSEC_STANDALONE

- name: Run APPSEC_RUNTIME_ACTIVATION
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec-1'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec-1'
run: ./run.sh APPSEC_RUNTIME_ACTIVATION

- name: Run APPSEC_WAF_TELEMETRY
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec-1'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec-1'
run: ./run.sh APPSEC_WAF_TELEMETRY

- name: Run APPSEC_DISABLED
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec-1'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec-1'
run: ./run.sh APPSEC_DISABLED

- name: Run APPSEC_BLOCKING
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec-1'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec-1'
run: ./run.sh APPSEC_BLOCKING

- name: Run APPSEC_BLOCKING_FULL_DENYLIST
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec-1'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec-1'
run: ./run.sh APPSEC_BLOCKING_FULL_DENYLIST

- name: Run APPSEC_REQUEST_BLOCKING
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec-1'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec-1'
run: ./run.sh APPSEC_REQUEST_BLOCKING

- name: Run APPSEC_RASP
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'appsec-1'
if: always() && steps.docker_load.outcome == 'success' && matrix.scenario == 'appsec-1'
run: ./run.sh APPSEC_RASP

# The compress step speed up a lot the upload artifact process
- name: Compress artifact
if: always() && steps.docker_load.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule')
if: always() && steps.docker_load.outcome == 'success'
id: compress-artifact
run: tar -czvf artifact.tar.gz $(ls | grep logs)

- name: Upload artifact
uses: actions/upload-artifact@v4
if: always() && steps.docker_load.outcome == 'success' && (steps.compress-artifact.outcome == 'success' || github.event_name == 'schedule')
if: always() && steps.docker_load.outcome == 'success'
with:
name: logs_${{ matrix.weblog-variant }}_${{ matrix.scenario }}
path: artifact.tar.gz
Expand All @@ -276,17 +244,14 @@ jobs:
parametric:
runs-on:
group: "APM Larger Runners"
needs: needs-run
env:
TEST_LIBRARY: python
steps:
- name: Checkout system tests
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'
- name: Checkout dd-trace-py
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/checkout@v4
with:
path: 'binaries/dd-trace-py'
Expand All @@ -295,20 +260,19 @@ jobs:

- name: Build runner
id: build_runner
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: ./.github/actions/install_runner

- name: Run
if: always() && steps.build_runner.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule')
if: always() && steps.build_runner.outcome == 'success'
run: ./run.sh PARAMETRIC

- name: Compress artifact
if: always() && steps.build_runner.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule')
if: always() && steps.build_runner.outcome == 'success'
run: tar -czvf artifact.tar.gz $(ls | grep logs)

- name: Upload artifact
uses: actions/upload-artifact@v4
if: always() && steps.build_runner.outcome == 'success' && (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule')
if: always() && steps.build_runner.outcome == 'success'
with:
name: logs_parametric
path: artifact.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ddtrace/profiling/collector/stack.c
ddtrace/profiling/exporter/pprof.c
ddtrace/profiling/_build.c
ddtrace/internal/datadog/profiling/ddup/_ddup.cpp
ddtrace/internal/datadog/profiling/crashtracker/crashtracker_exe
ddtrace/internal/datadog/profiling/crashtracker/crashtracker_exe*
ddtrace/internal/_encoding.c
ddtrace/internal/_rand.c
ddtrace/internal/_tagset.c
Expand Down
Loading

0 comments on commit 7cb25d0

Please sign in to comment.