Skip to content

Commit 303084d

Browse files
authored
ci: pin system-tests ref in one-pipeline (#14298)
Also update `scripts/update-system-tsts-version.py` to also update `.gitlab-ci.yml` ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [ ] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
1 parent 9d35c2b commit 303084d

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

.github/workflows/system-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
persist-credentials: false
4141
repository: 'DataDog/system-tests'
4242
# Automatically managed, use scripts/update-system-tests-version to update
43-
ref: 'cc0f0a64853f98d0248b682d633d227fa41f4a6e'
43+
ref: '4ea4c419151062ab3c2e4131962f24f73c8f3f5d'
4444

4545
- name: Checkout dd-trace-py
4646
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -90,7 +90,7 @@ jobs:
9090
persist-credentials: false
9191
repository: 'DataDog/system-tests'
9292
# Automatically managed, use scripts/update-system-tests-version to update
93-
ref: 'cc0f0a64853f98d0248b682d633d227fa41f4a6e'
93+
ref: '4ea4c419151062ab3c2e4131962f24f73c8f3f5d'
9494

9595
- name: Build runner
9696
uses: ./.github/actions/install_runner
@@ -273,7 +273,7 @@ jobs:
273273
persist-credentials: false
274274
repository: 'DataDog/system-tests'
275275
# Automatically managed, use scripts/update-system-tests-version to update
276-
ref: 'cc0f0a64853f98d0248b682d633d227fa41f4a6e'
276+
ref: '4ea4c419151062ab3c2e4131962f24f73c8f3f5d'
277277
- name: Checkout dd-trace-py
278278
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
279279
with:

.gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ variables:
1313
# VPA Template configuration
1414
DD_VPA_TEMPLATE: "vpa-template-cpu-p70-10percent-2x-oom-min-cap"
1515
# CI_DEBUG_SERVICES: "true"
16+
# Automatically managed, use scripts/update-system-tests-version to update
17+
SYSTEM_TESTS_REF: "4ea4c419151062ab3c2e4131962f24f73c8f3f5d"
1618

1719
default:
1820
interruptible: true

scripts/update-system-tests-version.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
system_tests_repo = "https://github.com/DataDog/system-tests.git"
1010
system_tests_workflows_path = ".github/workflows/system-tests.yml"
11+
gitlab_ci_path = ".gitlab-ci.yml"
1112

1213

1314
def get_latest_system_tests_version() -> str:
@@ -32,6 +33,7 @@ def get_current_system_tests_version() -> str:
3233

3334

3435
def update_system_tests_version(latest_version: str):
36+
# Update GitHub workflow file
3537
with open(system_tests_workflows_path, "r") as file:
3638
content = file.read()
3739

@@ -49,11 +51,27 @@ def update_system_tests_version(latest_version: str):
4951
with open(system_tests_workflows_path, "w") as file:
5052
file.write("\n".join(lines))
5153

54+
# Update GitLab CI file
55+
with open(gitlab_ci_path, "r") as file:
56+
content = file.read()
57+
58+
lines = content.splitlines()
59+
for i in range(len(lines)):
60+
# Look for the SYSTEM_TESTS_REF variable
61+
if lines[i].strip().startswith("SYSTEM_TESTS_REF:"):
62+
# Replace the entire line with the new commit hash
63+
indent = len(lines[i]) - len(lines[i].lstrip())
64+
lines[i] = f"{' ' * indent}SYSTEM_TESTS_REF: \"{latest_version}\""
65+
break
66+
67+
with open(gitlab_ci_path, "w") as file:
68+
file.write("\n".join(lines))
69+
5270

5371
if __name__ == "__main__":
5472
current_version = get_current_system_tests_version()
5573
print(f"Current system-tests version: {current_version}")
5674
latest_version = get_latest_system_tests_version()
5775
print(f"Latest system-tests version: {latest_version}")
5876
update_system_tests_version(latest_version)
59-
print(f"Updated {system_tests_workflows_path} with the latest version.")
77+
print(f"Updated {system_tests_workflows_path} and {gitlab_ci_path} with the latest version.")

0 commit comments

Comments
 (0)