From d8d886b9f10a071b6b1b844348616644102130e7 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Wed, 25 Mar 2026 14:00:31 -0400 Subject: [PATCH 1/5] Pin one-pipeline system tests --- .github/workflows/create-release-branch.yaml | 2 +- .gitlab-ci.yml | 1 + tooling/update_system_test_reference.sh | 34 ++++++++++++++------ 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/workflows/create-release-branch.yaml b/.github/workflows/create-release-branch.yaml index e38254ac29f..b690edf2161 100644 --- a/.github/workflows/create-release-branch.yaml +++ b/.github/workflows/create-release-branch.yaml @@ -119,7 +119,7 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git commit -m "chore: Pin system-tests for release branch" .github/workflows/run-system-tests.yaml + git commit -m "chore: Pin system-tests for release branch" .github/workflows/run-system-tests.yaml .gitlab-ci.yml echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - name: Push changes diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 36618494552..deb29992485 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1071,6 +1071,7 @@ publishing-gate: configure_system_tests: variables: + SYSTEM_TESTS_REF: main # system tests are pinned for releases only SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,simple_onboarding_appsec,docker-ssi,lib-injection" create_key: diff --git a/tooling/update_system_test_reference.sh b/tooling/update_system_test_reference.sh index 951fe8e4b1d..8edbd8b35e5 100755 --- a/tooling/update_system_test_reference.sh +++ b/tooling/update_system_test_reference.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -# This script updates the system-tests reference in run-system-tests.yaml. +# This script updates the system-tests references used by GitHub Actions (run-system-tests.yaml) and GitLab CI (.gitlab-ci.yml). # The reference will be updated with the latest commit SHA of the given branch (or `main` if not set) of https://github.com/DataDog/system-tests. # Usage: BRANCH= tooling/update_system_test_reference.sh @@ -11,9 +11,13 @@ if [ -z "${BRANCH:-}" ]; then echo "BRANCH is not set. Defaulting to 'main'." fi -TARGET=".github/workflows/run-system-tests.yaml" # target file to update -PATTERN_1='(\s*system-tests\.yml@)(\S+)(\s+# system tests.*)' # pattern to update the "system-tests.yml@" reference -PATTERN_2='(\s*ref: )(\S+)(\s+# system tests.*)' # pattern to update the "ref:" reference +SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +REPO_ROOT=$(cd "$SCRIPT_DIR/.." && pwd) +GITHUB_TARGET="$REPO_ROOT/.github/workflows/run-system-tests.yaml" +GITLAB_TARGET="$REPO_ROOT/.gitlab-ci.yml" +GITHUB_PATTERN_1='(\s*system-tests\.yml@)(\S+)(\s+# system tests.*)' # pattern to update the "system-tests.yml@" reference +GITHUB_PATTERN_2='(\s*ref: )(\S+)(\s+# system tests.*)' # pattern to update the "ref:" reference +GITLAB_PATTERN='(\s*SYSTEM_TESTS_REF:\s*)(\S+)(\s+# system tests.*)' # pattern to update the GitLab SYSTEM_TESTS_REF variable echo "Fetching latest commit SHA for system-tests branch: $BRANCH" REF=$(git ls-remote https://github.com/DataDog/system-tests "refs/heads/$BRANCH" | cut -f 1) @@ -23,8 +27,13 @@ if [ -z "$REF" ]; then fi echo "Fetched SHA: $REF" -if [ ! -f "$TARGET" ]; then - echo "Error: Target file $TARGET does not exist" +if [ ! -f "$GITHUB_TARGET" ]; then + echo "Error: Target file $GITHUB_TARGET does not exist" + exit 1 +fi + +if [ ! -f "$GITLAB_TARGET" ]; then + echo "Error: Target file $GITLAB_TARGET does not exist" exit 1 fi @@ -33,13 +42,18 @@ TEMP_FILE=$(mktemp) # Update the "system-tests.yml@" reference echo "Updating 'system-tests.yml@' reference..." -perl -pe "s/$PATTERN_1/\${1}$REF\${3}/g" "$TARGET" > "$TEMP_FILE" -cp "$TEMP_FILE" "$TARGET" +perl -pe "s/$GITHUB_PATTERN_1/\${1}$REF\${3}/g" "$GITHUB_TARGET" > "$TEMP_FILE" +cp "$TEMP_FILE" "$GITHUB_TARGET" # Update the "ref:" reference echo "Updating 'ref:' reference..." -perl -pe "s/$PATTERN_2/\${1}$REF\${3}/g" "$TARGET" > "$TEMP_FILE" -cp "$TEMP_FILE" "$TARGET" +perl -pe "s/$GITHUB_PATTERN_2/\${1}$REF\${3}/g" "$GITHUB_TARGET" > "$TEMP_FILE" +cp "$TEMP_FILE" "$GITHUB_TARGET" + +# Update the GitLab SYSTEM_TESTS_REF variable +echo "Updating 'SYSTEM_TESTS_REF' reference..." +perl -pe "s/$GITLAB_PATTERN/\${1}$REF\${3}/g" "$GITLAB_TARGET" > "$TEMP_FILE" +cp "$TEMP_FILE" "$GITLAB_TARGET" # Clean up temporary file rm -f "$TEMP_FILE" From 1065da50dca7f1d8a83d9b47ce3ed08894ae5d49 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Wed, 25 Mar 2026 14:47:15 -0400 Subject: [PATCH 2/5] Test pinning system-tests --- .github/workflows/run-system-tests.yaml | 4 ++-- .gitlab-ci.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-system-tests.yaml b/.github/workflows/run-system-tests.yaml index 0463d76ac36..9f480eae6f9 100644 --- a/.github/workflows/run-system-tests.yaml +++ b/.github/workflows/run-system-tests.yaml @@ -62,7 +62,7 @@ jobs: needs: - build # If you change the following comment, update the pattern in the update_system_test_reference.sh script to match. - uses: DataDog/system-tests/.github/workflows/system-tests.yml@main # system tests are pinned for releases only + uses: DataDog/system-tests/.github/workflows/system-tests.yml@801f0e2c82555fd84b9e3385d67ab78bb0e1a360 # system tests are pinned for releases only; will revert back to main after testing secrets: TEST_OPTIMIZATION_API_KEY: ${{ secrets.DATADOG_API_KEY_PROD }} permissions: @@ -72,7 +72,7 @@ jobs: with: library: java # If you change the following comment, update the pattern in the update_system_test_reference.sh script to match. - ref: main # system tests are pinned for releases only + ref: 801f0e2c82555fd84b9e3385d67ab78bb0e1a360 # system tests are pinned for releases only; will revert back to main after testing binaries_artifact: binaries desired_execution_time: 900 # 15 minutes scenarios_groups: tracer-release diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index deb29992485..cc2e24e414c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1071,7 +1071,7 @@ publishing-gate: configure_system_tests: variables: - SYSTEM_TESTS_REF: main # system tests are pinned for releases only + SYSTEM_TESTS_REF: 801f0e2c82555fd84b9e3385d67ab78bb0e1a360 # system tests are pinned for releases only; will revert back to main after testing SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,simple_onboarding_appsec,docker-ssi,lib-injection" create_key: From a169c0390fab5d5224d84e346c4821681b55ec14 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Wed, 25 Mar 2026 14:51:29 -0400 Subject: [PATCH 3/5] Revert test pinning --- .github/workflows/run-system-tests.yaml | 4 ++-- .gitlab-ci.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-system-tests.yaml b/.github/workflows/run-system-tests.yaml index 9f480eae6f9..0463d76ac36 100644 --- a/.github/workflows/run-system-tests.yaml +++ b/.github/workflows/run-system-tests.yaml @@ -62,7 +62,7 @@ jobs: needs: - build # If you change the following comment, update the pattern in the update_system_test_reference.sh script to match. - uses: DataDog/system-tests/.github/workflows/system-tests.yml@801f0e2c82555fd84b9e3385d67ab78bb0e1a360 # system tests are pinned for releases only; will revert back to main after testing + uses: DataDog/system-tests/.github/workflows/system-tests.yml@main # system tests are pinned for releases only secrets: TEST_OPTIMIZATION_API_KEY: ${{ secrets.DATADOG_API_KEY_PROD }} permissions: @@ -72,7 +72,7 @@ jobs: with: library: java # If you change the following comment, update the pattern in the update_system_test_reference.sh script to match. - ref: 801f0e2c82555fd84b9e3385d67ab78bb0e1a360 # system tests are pinned for releases only; will revert back to main after testing + ref: main # system tests are pinned for releases only binaries_artifact: binaries desired_execution_time: 900 # 15 minutes scenarios_groups: tracer-release diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cc2e24e414c..deb29992485 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1071,7 +1071,7 @@ publishing-gate: configure_system_tests: variables: - SYSTEM_TESTS_REF: 801f0e2c82555fd84b9e3385d67ab78bb0e1a360 # system tests are pinned for releases only; will revert back to main after testing + SYSTEM_TESTS_REF: main # system tests are pinned for releases only SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,simple_onboarding_appsec,docker-ssi,lib-injection" create_key: From 259f4c2049a1b1e66061bc0885d25b129dd54063 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Wed, 25 Mar 2026 15:18:11 -0400 Subject: [PATCH 4/5] Simplify paths --- tooling/update_system_test_reference.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tooling/update_system_test_reference.sh b/tooling/update_system_test_reference.sh index 8edbd8b35e5..9271a414e83 100755 --- a/tooling/update_system_test_reference.sh +++ b/tooling/update_system_test_reference.sh @@ -11,10 +11,8 @@ if [ -z "${BRANCH:-}" ]; then echo "BRANCH is not set. Defaulting to 'main'." fi -SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -REPO_ROOT=$(cd "$SCRIPT_DIR/.." && pwd) -GITHUB_TARGET="$REPO_ROOT/.github/workflows/run-system-tests.yaml" -GITLAB_TARGET="$REPO_ROOT/.gitlab-ci.yml" +GITHUB_TARGET=".github/workflows/run-system-tests.yaml" +GITLAB_TARGET=".gitlab-ci.yml" GITHUB_PATTERN_1='(\s*system-tests\.yml@)(\S+)(\s+# system tests.*)' # pattern to update the "system-tests.yml@" reference GITHUB_PATTERN_2='(\s*ref: )(\S+)(\s+# system tests.*)' # pattern to update the "ref:" reference GITLAB_PATTERN='(\s*SYSTEM_TESTS_REF:\s*)(\S+)(\s+# system tests.*)' # pattern to update the GitLab SYSTEM_TESTS_REF variable From d28e883862747a799597a838078ad4f6b9d21fd9 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Thu, 26 Mar 2026 09:58:34 -0400 Subject: [PATCH 5/5] Fix comments --- .github/workflows/run-system-tests.yaml | 4 ++-- .gitlab-ci.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-system-tests.yaml b/.github/workflows/run-system-tests.yaml index 0463d76ac36..9b97ea5c167 100644 --- a/.github/workflows/run-system-tests.yaml +++ b/.github/workflows/run-system-tests.yaml @@ -62,7 +62,7 @@ jobs: needs: - build # If you change the following comment, update the pattern in the update_system_test_reference.sh script to match. - uses: DataDog/system-tests/.github/workflows/system-tests.yml@main # system tests are pinned for releases only + uses: DataDog/system-tests/.github/workflows/system-tests.yml@main # system tests are pinned on release branches only secrets: TEST_OPTIMIZATION_API_KEY: ${{ secrets.DATADOG_API_KEY_PROD }} permissions: @@ -72,7 +72,7 @@ jobs: with: library: java # If you change the following comment, update the pattern in the update_system_test_reference.sh script to match. - ref: main # system tests are pinned for releases only + ref: main # system tests are pinned on release branches only binaries_artifact: binaries desired_execution_time: 900 # 15 minutes scenarios_groups: tracer-release diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index deb29992485..d8527784e80 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1071,7 +1071,7 @@ publishing-gate: configure_system_tests: variables: - SYSTEM_TESTS_REF: main # system tests are pinned for releases only + SYSTEM_TESTS_REF: main # system tests are pinned on release branches only SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,simple_onboarding_appsec,docker-ssi,lib-injection" create_key: