Skip to content

Commit 6f04282

Browse files
authored
ci: move gen_gitlab_config to uv script (#15358)
## Description This doesn't have to be defined as a riot venv, moving to a uv script will make it easier to just do `scripts/gen_gitlab_config.py` and it'll self-bootstrap a venv and what is needed. ## Testing <!-- Describe your testing strategy or note what tests are included --> ## Risks <!-- Note any risks associated with this change, or "None" if no risks --> ## Additional Notes <!-- Any other information that would be helpful for reviewers -->
1 parent 0e92d05 commit 6f04282

File tree

4 files changed

+19
-36
lines changed

4 files changed

+19
-36
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ tests-gen:
5454
# Use dd-octo-sts to get GitHub token
5555
export GH_TOKEN=$(dd-octo-sts token --scope DataDog/dd-trace-py --policy gitlab.github-access.read)
5656
fi
57-
- riot -v run --pass-env -s gitlab-gen-config -v
57+
- scripts/gen_gitlab_config.py --verbose
5858
needs: []
5959
artifacts:
6060
paths:

.riot/requirements/151a249.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

riotfile.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,6 @@ def select_pys(min_version: str = MIN_PYTHON_VERSION, max_version: str = MAX_PYT
151151
"standard-imghdr": latest,
152152
},
153153
),
154-
Venv(
155-
name="gitlab-gen-config",
156-
command="python scripts/gen_gitlab_config.py {cmdargs}",
157-
pys=["3"],
158-
pkgs={
159-
"ruamel.yaml": latest,
160-
"lxml": latest,
161-
},
162-
),
163154
Venv(
164155
name="appsec",
165156
pys=select_pys(),

scripts/gen_gitlab_config.py

100644100755
Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
# This script is used to generate the GitLab dynamic config file in
2-
# .gitlab/tests.yml.
3-
#
4-
# To add new configuration manipulations that are based on top of the template
5-
# file in .gitlab/tests.yml, add a function named gen_<name> to this
6-
# file. The function will be called automatically when this script is run.
1+
#!/usr/bin/env scripts/uv-run-script
2+
# -*- mode: python -*-
3+
# /// script
4+
# requires-python = ">=3.9"
5+
# dependencies = [
6+
# "riot>=0.20.1",
7+
# "ruamel.yaml>=0.17.21",
8+
# "lxml>=4.9.0",
9+
# ]
10+
# ///
11+
"""
12+
This script is used to generate the GitLab dynamic config file in
13+
.gitlab/tests.yml.
14+
15+
To add new configuration manipulations that are based on top of the template
16+
file in .gitlab/tests.yml, add a function named gen_<name> to this
17+
file. The function will be called automatically when this script is run.
18+
"""
719

820
from dataclasses import dataclass
921
import datetime

0 commit comments

Comments
 (0)