Skip to content

Commit 90d6ea3

Browse files
authored
Deprecate testing-farm IDs without trailing / (#1379)
This allows us to parse testing-farm requests that were made for performance comparisons. This is needed in order to address #1378. Another PR is needed as well.
1 parent 2f4bead commit 90d6ea3

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

snapshot_manager/testing_farm/request.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,27 @@ def parse(cls, string: str) -> list["Request"]:
102102
... Foo bAr. <!--TESTING_FARM:invalid-chroot/33333333-fc9a-4e1d-95fe-567cc9d62ad4/8,9,10--> fafa
103103
... FOO bar. <!--TESTING_FARM: fedora-40-x86_64/; cat /tmp/secret/file/11--> fafa
104104
... FOO bar. <!--TESTING_FARM: fedora-40-x86_64/33333333-fc9a-4e1d-95fe-567cc9d62ad4/12,13,14--> fafa
105-
... This next request ID is missing build IDs. We allow it because there used to be comment IDs
106-
... that didn't have these IDs.
107-
... FOO bar. <!--TESTING_FARM: fedora-38-x86_64/44444444-fc9a-4e1d-95fe-567cc9d62ad4--> fafa
105+
... This next request ID is missing build IDs. We allow it because we don't store build IDs for performance-comparison requests.
106+
... FOO bar. <!--TESTING_FARM: fedora-38-x86_64/44444444-fc9a-4e1d-95fe-567cc9d62ad4/--> fafa
107+
... FOO bar. <!--TESTING_FARM: fedora-42-x86_64/55555555-fc9a-4e1d-95fe-567cc9d62ad4/--> fafa
108108
... '''
109109
>>> reqs = Request.parse(s)
110110
>>> [req.chroot for req in reqs]
111-
['fedora-38-x86_64', 'fedora-39-x86_64', 'fedora-40-x86_64', 'fedora-rawhide-x86_64']
112-
>>> [req.request_id for req in reqs]
113-
[UUID('44444444-fc9a-4e1d-95fe-567cc9d62ad4'), UUID('22222222-fc9a-4e1d-95fe-567cc9d62ad4'), UUID('33333333-fc9a-4e1d-95fe-567cc9d62ad4'), UUID('271a79e8-fc9a-4e1d-95fe-567cc9d62ad4')]
111+
['fedora-38-x86_64', 'fedora-39-x86_64', 'fedora-40-x86_64', 'fedora-42-x86_64', 'fedora-rawhide-x86_64']
112+
>>> [req.request_id for req in reqs] # doctest: +NORMALIZE_WHITESPACE
113+
[UUID('44444444-fc9a-4e1d-95fe-567cc9d62ad4'),
114+
UUID('22222222-fc9a-4e1d-95fe-567cc9d62ad4'),
115+
UUID('33333333-fc9a-4e1d-95fe-567cc9d62ad4'),
116+
UUID('55555555-fc9a-4e1d-95fe-567cc9d62ad4'),
117+
UUID('271a79e8-fc9a-4e1d-95fe-567cc9d62ad4')]
114118
>>> [req.copr_build_ids for req in reqs]
115-
[[], [5, 6, 7], [12, 13, 14], [1, 2, 3]]
119+
[[], [5, 6, 7], [12, 13, 14], [], [1, 2, 3]]
116120
"""
117-
matches = re.findall(r"<!--TESTING_FARM:([^/]+)/([^/]+)(/([^/]+))?-->", string)
121+
matches = re.findall(
122+
pattern=r"<!--TESTING_FARM:([^/]+)/([^/]+)(/([^/]*))?-->",
123+
string=string,
124+
flags=re.MULTILINE,
125+
)
118126
if not matches:
119127
logging.debug("No testing-farm requests found to recover.")
120128
return []

0 commit comments

Comments
 (0)