Skip to content

Commit

Permalink
Merge branch 'main' into estringana/enable-ssrf-for-php
Browse files Browse the repository at this point in the history
  • Loading branch information
estringana authored Jan 30, 2025
2 parents ad63e59 + be0a69d commit 833b5ae
Show file tree
Hide file tree
Showing 104 changed files with 1,687 additions and 7,898 deletions.
21 changes: 21 additions & 0 deletions .github/actions/get_target_branch/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Get_target_branch
description: "Gets target branch from the PR description"
inputs:
text:
description: "Text from which to extract the target branch"
required: true
outputs:
target-branch:
description: "Target branch"
value: ${{ steps.extract.outputs.target-branch }}

runs:
using: composite
steps:
- name: Extract target branch
id: extract
shell: bash
run: |
branch=$(echo "${{ inputs.text }}" | grep -ioP '\[(?:java|dotnet|python|ruby|php|golang|cpp|agent|nodejs)@[^]]+(?=\])' | tr -d '[:space:]' || true)
echo "target-branch=${branch#*@}" >> $GITHUB_OUTPUT
23 changes: 21 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,22 @@ jobs:
library: ${{ fromJson(needs.impacted_libraries.outputs.impacted_libraries) }}
fail-fast: false
runs-on: ubuntu-latest
outputs:
target-branch: ${{ steps.get-target-branch.outputs.target-branch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get target branch
uses: ./.github/actions/get_target_branch
id: get-target-branch
with:
text: ${{ github.event.pull_request.title }}
- name: Get library artifact
run: ./utils/scripts/load-binary.sh ${{ matrix.library }}

env:
TARGET_BRANCH: "${{ steps.get-target-branch.outputs.target-branch }}"
- name: Get agent artifact
run: ./utils/scripts/load-binary.sh agent

# ### appsec-event-rules is now a private repo. The GH_TOKEN provided can't read private repos.
# ### skipping this, waiting for a proper solution
# - name: Load WAF rules
Expand All @@ -82,6 +89,18 @@ jobs:
name: binaries_dev_${{ matrix.library }}
path: binaries/

fail-if-target-branch:
name: Fail if target branch is specified
needs:
- get_dev_artifacts
if: needs.get_dev_artifacts.outputs.target-branch != ''
runs-on: ubuntu-latest
steps:
- name: Fail if PR title contains a target branch
run: |
echo "This PR can't be merged, due to the title specifying a target branch"
exit 1
system_tests:
name: System Tests
needs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compute-impacted-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
else:
pr_title = github_context["event"]["pull_request"]["title"].lower()
match = re.search(rf"^\[({libraries})\]", pr_title)
match = re.search(rf"^\[({libraries})(?:@([^\]]+))?\]", pr_title)
if match:
print(f"PR title matchs => run {match[1]}")
result.add(match[1])
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/run-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ jobs:
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"IPV6"') && inputs.library != 'ruby'
run: ./run.sh IPV6
- name: Run CROSSED_TRACING_LIBRARIES scenario
if: always() && steps.build.outcome == 'success' && matrix.weblog != 'python3.12' && contains(inputs.scenarios, '"CROSSED_TRACING_LIBRARIES"')
if: always() && steps.build.outcome == 'success' && matrix.weblog != 'python3.12' && matrix.weblog != 'django-py3.13' && contains(inputs.scenarios, '"CROSSED_TRACING_LIBRARIES"')
# python 3.13 issue : APMAPI-1096
run: ./run.sh CROSSED_TRACING_LIBRARIES
env:
SYSTEM_TESTS_AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
32 changes: 16 additions & 16 deletions .gitlab/k8s_gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ stages:
K8S_WEBLOG_IMG: "xyz"
K8S_SCENARIO: "xyz"
K8S_LIB_INIT_IMG: "xyz"
K8S_CLUSTER_VERSION: "xyz"
K8S_CLUSTER_IMG: "xyz"
K8S_INJECTOR_IMG: "xyz"
script:
- ./build.sh -i runner # rebuild runner in case there were changes
- source venv/bin/activate
- python --version
- pip freeze
- ./run.sh ${K8S_SCENARIO} --k8s-library ${TEST_LIBRARY} --k8s-weblog ${K8S_WEBLOG} --k8s-weblog-img ${K8S_WEBLOG_IMG} --k8s-lib-init-img ${K8S_LIB_INIT_IMG} --k8s-injector-img ${K8S_INJECTOR_IMG} --k8s-cluster-version ${K8S_CLUSTER_VERSION} --report-run-url $CI_JOB_URL --report-environment $ONBOARDING_FILTER_ENV
- ./run.sh ${K8S_SCENARIO} --k8s-library ${TEST_LIBRARY} --k8s-weblog ${K8S_WEBLOG} --k8s-weblog-img ${K8S_WEBLOG_IMG} --k8s-lib-init-img ${K8S_LIB_INIT_IMG} --k8s-injector-img ${K8S_INJECTOR_IMG} --k8s-cluster-img ${K8S_CLUSTER_IMG} --report-run-url $CI_JOB_URL --report-environment $ONBOARDING_FILTER_ENV
after_script: |
mkdir -p reports
cp -R logs_*/ reports/
Expand Down Expand Up @@ -90,14 +90,14 @@ k8s_java:
K8S_SCENARIO: [K8S_LIB_INJECTION_SPARK_DJM]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-java-init:latest", "ghcr.io/datadog/dd-trace-java/dd-lib-java-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

- K8S_WEBLOG: [dd-lib-java-init-test-app]
K8S_WEBLOG_IMG: [ghcr.io/datadog/system-tests/dd-lib-java-init-test-app:latest]
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_UDS, K8S_LIB_INJECTION_PROFILING_DISABLED, K8S_LIB_INJECTION_PROFILING_ENABLED, K8S_LIB_INJECTION_PROFILING_OVERRIDE, K8S_LIB_INJECTION_OPERATOR]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-java-init:latest", "ghcr.io/datadog/dd-trace-java/dd-lib-java-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

- K8S_WEBLOG: [dd-lib-java-init-test-app]
K8S_WEBLOG_IMG: [ghcr.io/datadog/system-tests/dd-lib-java-init-test-app:latest]
Expand All @@ -115,7 +115,7 @@ k8s_dotnet:
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_UDS, K8S_LIB_INJECTION_PROFILING_DISABLED, K8S_LIB_INJECTION_PROFILING_ENABLED, K8S_LIB_INJECTION_PROFILING_OVERRIDE, K8S_LIB_INJECTION_OPERATOR]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-dotnet-init:latest", "ghcr.io/datadog/dd-trace-dotnet/dd-lib-dotnet-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

- K8S_WEBLOG: [dd-lib-dotnet-init-test-app]
K8S_WEBLOG_IMG: [ghcr.io/datadog/system-tests/dd-lib-dotnet-init-test-app:latest]
Expand All @@ -133,7 +133,7 @@ k8s_nodejs:
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_UDS, K8S_LIB_INJECTION_PROFILING_DISABLED, K8S_LIB_INJECTION_PROFILING_ENABLED, K8S_LIB_INJECTION_PROFILING_OVERRIDE, K8S_LIB_INJECTION_OPERATOR]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-js-init:latest", "ghcr.io/datadog/dd-trace-js/dd-lib-js-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

- K8S_WEBLOG: [sample-app]
K8S_WEBLOG_IMG: [ghcr.io/datadog/system-tests/sample-app:latest]
Expand All @@ -151,7 +151,7 @@ k8s_python:
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_UDS, K8S_LIB_INJECTION_PROFILING_DISABLED, K8S_LIB_INJECTION_PROFILING_ENABLED, K8S_LIB_INJECTION_PROFILING_OVERRIDE, K8S_LIB_INJECTION_OPERATOR]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-python-init:latest", "ghcr.io/datadog/dd-trace-py/dd-lib-python-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

- K8S_WEBLOG: [dd-lib-python-init-test-django]
K8S_WEBLOG_IMG: [ghcr.io/datadog/system-tests/dd-lib-python-init-test-django:latest]
Expand All @@ -163,42 +163,42 @@ k8s_python:
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_PROFILING_ENABLED]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-python-init:latest", "ghcr.io/datadog/dd-trace-py/dd-lib-python-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

- K8S_WEBLOG: [dd-lib-python-init-test-django-gunicorn-alpine]
K8S_WEBLOG_IMG: [ghcr.io/datadog/system-tests/dd-lib-python-init-test-django-gunicorn-alpine:latest]
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_PROFILING_ENABLED]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-python-init:latest", "ghcr.io/datadog/dd-trace-py/dd-lib-python-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

- K8S_WEBLOG: [dd-lib-python-init-test-django-unsupported-package-force]
K8S_WEBLOG_IMG: [ghcr.io/datadog/system-tests/dd-lib-python-init-test-django-unsupported-package-force:latest]
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_PROFILING_ENABLED]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-python-init:latest", "ghcr.io/datadog/dd-trace-py/dd-lib-python-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

- K8S_WEBLOG: [dd-lib-python-init-test-django-uvicorn]
K8S_WEBLOG_IMG: [ghcr.io/datadog/system-tests/dd-lib-python-init-test-django-uvicorn:latest]
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_PROFILING_ENABLED]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-python-init:latest", "ghcr.io/datadog/dd-trace-py/dd-lib-python-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

- K8S_WEBLOG: [dd-lib-python-init-test-protobuf-old]
K8S_WEBLOG_IMG: [ghcr.io/datadog/system-tests/dd-lib-python-init-test-protobuf-old:latest]
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_PROFILING_ENABLED]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-python-init:latest", "ghcr.io/datadog/dd-trace-py/dd-lib-python-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

- K8S_WEBLOG: [dd-lib-python-init-test-django-preinstalled]
K8S_WEBLOG_IMG: [ghcr.io/datadog/system-tests/dd-lib-python-init-test-django-preinstalled:latest]
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_UDS]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-python-init:latest", "ghcr.io/datadog/dd-trace-py/dd-lib-python-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

k8s_ruby:
extends: .k8s_lib_injection_base
Expand All @@ -211,7 +211,7 @@ k8s_ruby:
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_UDS, K8S_LIB_INJECTION_PROFILING_DISABLED, K8S_LIB_INJECTION_PROFILING_ENABLED, K8S_LIB_INJECTION_PROFILING_OVERRIDE, K8S_LIB_INJECTION_OPERATOR]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-ruby-init:latest", "ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

- K8S_WEBLOG: [dd-lib-ruby-init-test-rails]
K8S_WEBLOG_IMG: [ghcr.io/datadog/system-tests/dd-lib-ruby-init-test-rails:latest]
Expand All @@ -223,11 +223,11 @@ k8s_ruby:
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_UDS, K8S_LIB_INJECTION_PROFILING_DISABLED, K8S_LIB_INJECTION_PROFILING_ENABLED, K8S_LIB_INJECTION_PROFILING_OVERRIDE]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-ruby-init:latest", "ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']

- K8S_WEBLOG: [dd-lib-ruby-init-test-rails-gemsrb]
K8S_WEBLOG_IMG: [ghcr.io/datadog/system-tests/dd-lib-ruby-init-test-rails-gemsrb:latest]
K8S_SCENARIO: [K8S_LIB_INJECTION, K8S_LIB_INJECTION_UDS, K8S_LIB_INJECTION_PROFILING_DISABLED, K8S_LIB_INJECTION_PROFILING_ENABLED, K8S_LIB_INJECTION_PROFILING_OVERRIDE]
K8S_LIB_INIT_IMG: ["gcr.io/datadoghq/dd-lib-ruby-init:latest", "ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:latest_snapshot"]
K8S_INJECTOR_IMG: ["gcr.io/datadoghq/apm-inject:latest", "ghcr.io/datadog/apm-inject:latest_snapshot"]
K8S_CLUSTER_VERSION: ['7.56.2', '7.57.0', '7.59.0']
K8S_CLUSTER_IMG: ['gcr.io/datadoghq/cluster-agent:7.56.2', 'docker.io/datadog/cluster-agent-dev:master', 'gcr.io/datadoghq/cluster-agent:latest']
Loading

0 comments on commit 833b5ae

Please sign in to comment.