fifloader: require group_name to be set via product

I've always hated the magic group name derivation in fifloader,
and it prevents it being used by anyone but Fedora. This fixes
that by requiring group_name to be set in the Products. This is
an executive decision, but it makes sense at least with how
Fedora uses openQA. If other users who might want to adopt
fifloader *don't* have a 100% assocation from products to job
groups, we can introduce more ways to set it in future, I guess.

I made it compulsory because it feels weird to have job templates
that aren't in groups...I don't even know how those get shown in
the web UI. But if there's a real use case for this we can make
it optional.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2025-05-20 17:50:14 -07:00
commit f966128089
9 changed files with 70 additions and 41 deletions

View file

@ -39,6 +39,12 @@ loader expects a more obvious and simple format where the value of the 'settings
dict of keys and values. With this loader, Products can inherit settings from Flavors to reduce
duplication - see below.
Each Product must have a 'group_name' key whose value is the name of a job group which all job
templates that test against that Product will be a part of. This association is an invention of
this loader, derived from how Fedora organizes tests. The value is used by this loader, then the
entry is dropped entirely as part of conversion to the upstream format. group_name can be set via
ProductDefaults (see below).
The expected format of the Flavors dict is a dict-of-dicts. For each entry, the key is a flavor
name that is expected to be used as the 'flavor' for one or more Product(s). The value is a dict
with only a 'settings' key, containing settings in the same format described above. When
@ -269,27 +275,13 @@ def generate_job_templates(products, profiles, pgroups, testsuites):
continue
for (profile, prio) in suiteprofs.items():
jobtemplate = {'test_suite_name': name, 'prio': prio}
# x86_64 compose
jobtemplate['group_name'] = 'fedora'
jobtemplate['machine_name'] = profiles[profile]['machine']
product = products[profiles[profile]['product']]
jobtemplate['group_name'] = product['group_name']
jobtemplate['arch'] = product['arch']
jobtemplate['flavor'] = product['flavor']
jobtemplate['distri'] = product['distri']
jobtemplate['version'] = product['version']
if jobtemplate['machine_name'] == 'ppc64le':
if 'updates' in product['flavor']:
jobtemplate['group_name'] = "Fedora PowerPC Updates"
else:
jobtemplate['group_name'] = "Fedora PowerPC"
elif jobtemplate['machine_name'] in ('aarch64', 'ARM'):
if 'updates' in product['flavor']:
jobtemplate['group_name'] = "Fedora AArch64 Updates"
else:
jobtemplate['group_name'] = "Fedora AArch64"
elif 'updates' in product['flavor']:
# x86_64 updates
jobtemplate['group_name'] = "Fedora Updates"
jobtemplates.append(jobtemplate)
return jobtemplates
@ -321,8 +313,10 @@ def reverse_qol(machines, flavors, products, testsuites):
converted.append({'key': key, 'value': value})
return converted
# merge flavors into products
for product in products.values():
# delete group names, this association is a loader-only concept
del product["group_name"]
# merge flavors into products
flavsets = flavors.get(product["flavor"], {}).get("settings", {})
if flavsets:
temp = dict(flavsets)

View file

@ -1,12 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "fif-product.json",
"$id": "fif-product-predefault.json",
"title": "FIF single product schema (pre-defaults-merge)",
"type": "object",
"properties": {
"arch": { "$ref": "fif-arch.json" },
"distri": { "$ref": "fif-distri.json" },
"flavor": { "type": "string" },
"group_name": { "type": "string" },
"version": { "$ref": "fif-version.json" },
"settings": { "$ref": "fif-settingshash.json" },
"name": { "type": "string" }

View file

@ -7,6 +7,7 @@
"arch",
"distri",
"flavor",
"group_name",
"version"
],
"properties": {
@ -14,6 +15,7 @@
"distri": { "$ref": "fif-distri.json" },
"flavor": { "type": "string" },
"version": { "$ref": "fif-version.json" },
"group_name": { "type": "string" },
"settings": { "$ref": "fif-settingshash.json" },
"name": { "type": "string" }
},

View file

@ -8,6 +8,7 @@
"arch": { "$ref": "fif-arch.json" },
"distri": { "$ref": "fif-distri.json" },
"flavor": { "type": "string" },
"group_name": { "type": "string" },
"version": { "$ref": "fif-version.json" },
"settings": { "$ref": "fif-settingshash.json" },
"name": { "type": "string" }

View file

@ -88,16 +88,19 @@
},
"ProductDefaults": {
"distri": "fedora",
"group_name": "Fedora Updates",
"version": "*"
},
"Products": {
"fedora-updates-container-aarch64-*": {
"arch": "aarch64",
"flavor": "updates-container"
"flavor": "updates-container",
"group_name": "Fedora AArch64 Updates"
},
"fedora-updates-container-ppc64le-*": {
"arch": "ppc64le",
"flavor": "updates-container"
"flavor": "updates-container",
"group_name": "Fedora PowerPC Updates"
},
"fedora-updates-container-x86_64-*": {
"arch": "x86_64",
@ -116,15 +119,18 @@
},
"fedora-updates-server-aarch64-*": {
"arch": "aarch64",
"flavor": "updates-server"
"flavor": "updates-server",
"group_name": "Fedora AArch64 Updates"
},
"fedora-updates-server-ppc64le-*": {
"arch": "ppc64le",
"flavor": "updates-server"
"flavor": "updates-server",
"group_name": "Fedora PowerPC Updates"
},
"fedora-updates-server-upgrade-ppc64le-*": {
"arch": "ppc64le",
"flavor": "updates-server-upgrade"
"flavor": "updates-server-upgrade",
"group_name": "Fedora PowerPC Updates"
},
"fedora-updates-server-upgrade-x86_64-*": {
"arch": "x86_64",

View file

@ -230,6 +230,7 @@
},
"ProductDefaults": {
"distri": "fedora",
"group_name": "fedora",
"version": "*"
},
"Products": {
@ -243,11 +244,13 @@
},
"fedora-Cloud_Base-qcow2-qcow2-aarch64-*": {
"arch": "aarch64",
"flavor": "Cloud_Base-qcow2-qcow2"
"flavor": "Cloud_Base-qcow2-qcow2",
"group_name": "Fedora AArch64"
},
"fedora-Cloud_Base-qcow2-qcow2-ppc64le-*": {
"arch": "ppc64le",
"flavor": "Cloud_Base-qcow2-qcow2"
"flavor": "Cloud_Base-qcow2-qcow2",
"group_name": "Fedora PowerPC"
},
"fedora-Cloud_Base-qcow2-qcow2-x86_64-*": {
"arch": "x86_64",
@ -259,7 +262,8 @@
},
"fedora-Everything-boot-iso-ppc64le-*": {
"arch": "ppc64le",
"flavor": "Everything-boot-iso"
"flavor": "Everything-boot-iso",
"group_name": "Fedora PowerPC"
},
"fedora-Everything-boot-iso-x86_64-*": {
"arch": "x86_64",
@ -270,7 +274,8 @@
},
"fedora-IoT-dvd_ostree-iso-aarch64-*": {
"arch": "aarch64",
"flavor": "IoT-dvd_ostree-iso"
"flavor": "IoT-dvd_ostree-iso",
"group_name": "Fedora AArch64"
},
"fedora-IoT-dvd_ostree-iso-x86_64-*": {
"arch": "x86_64",
@ -286,15 +291,18 @@
},
"fedora-Minimal-raw_xz-raw.xz-aarch64-*": {
"arch": "aarch64",
"flavor": "Minimal-raw_xz-raw.xz"
"flavor": "Minimal-raw_xz-raw.xz",
"group_name": "Fedora AArch64"
},
"fedora-Server-boot-iso-aarch64-*": {
"arch": "aarch64",
"flavor": "Server-boot-iso"
"flavor": "Server-boot-iso",
"group_name": "Fedora AArch64"
},
"fedora-Server-boot-iso-ppc64le-*": {
"arch": "ppc64le",
"flavor": "Server-boot-iso"
"flavor": "Server-boot-iso",
"group_name": "Fedora PowerPC"
},
"fedora-Server-boot-iso-x86_64-*": {
"arch": "x86_64",
@ -305,11 +313,13 @@
},
"fedora-Server-dvd-iso-aarch64-*": {
"arch": "aarch64",
"flavor": "Server-dvd-iso"
"flavor": "Server-dvd-iso",
"group_name": "Fedora AArch64"
},
"fedora-Server-dvd-iso-ppc64le-*": {
"arch": "ppc64le",
"flavor": "Server-dvd-iso"
"flavor": "Server-dvd-iso",
"group_name": "Fedora PowerPC"
},
"fedora-Server-dvd-iso-x86_64-*": {
"arch": "x86_64",
@ -317,11 +327,13 @@
},
"fedora-Server-raw_xz-raw.xz-aarch64-*": {
"arch": "aarch64",
"flavor": "Server-raw_xz-raw.xz"
"flavor": "Server-raw_xz-raw.xz",
"group_name": "Fedora AArch64"
},
"fedora-Silverblue-dvd_ostree-iso-ppc64le-*": {
"arch": "ppc64le",
"flavor": "Silverblue-dvd_ostree-iso"
"flavor": "Silverblue-dvd_ostree-iso",
"group_name": "Fedora PowerPC"
},
"fedora-Silverblue-dvd_ostree-iso-x86_64-*": {
"arch": "x86_64",
@ -329,7 +341,8 @@
},
"fedora-Workstation-live-iso-ppc64le-*": {
"arch": "ppc64le",
"flavor": "Workstation-live-iso"
"flavor": "Workstation-live-iso",
"group_name": "Fedora PowerPC"
},
"fedora-Workstation-live-iso-x86_64-*": {
"arch": "x86_64",
@ -348,19 +361,23 @@
},
"fedora-Workstation-raw_xz-raw.xz-aarch64-*": {
"arch": "aarch64",
"flavor": "Workstation-raw_xz-raw.xz"
"flavor": "Workstation-raw_xz-raw.xz",
"group_name": "Fedora AArch64"
},
"fedora-Workstation-upgrade-aarch64-*": {
"arch": "aarch64",
"flavor": "Workstation-upgrade"
"flavor": "Workstation-upgrade",
"group_name": "Fedora AArch64"
},
"fedora-universal-aarch64-*": {
"arch": "aarch64",
"flavor": "universal"
"flavor": "universal",
"group_name": "Fedora AArch64"
},
"fedora-universal-ppc64le-*": {
"arch": "ppc64le",
"flavor": "universal"
"flavor": "universal",
"group_name": "Fedora PowerPC"
},
"fedora-universal-x86_64-*": {
"arch": "x86_64",
@ -368,11 +385,13 @@
},
"fedora-seasonal-aarch64-*": {
"arch": "aarch64",
"flavor": "seasonal"
"flavor": "seasonal",
"group_name": "Fedora AArch64"
},
"fedora-seasonal-ppc64le-*": {
"arch": "ppc64le",
"flavor": "seasonal"
"flavor": "seasonal",
"group_name": "Fedora PowerPC"
},
"fedora-seasonal-x86_64-*": {
"arch": "x86_64",

View file

@ -4,6 +4,7 @@
"arch": "ppc64le",
"distri": "fedora",
"flavor": "updates-server",
"group_name": "Fedora PowerPC Updates",
"settings": {},
"version": "*"
},
@ -11,6 +12,7 @@
"arch": "x86_64",
"distri": "fedora",
"flavor": "updates-server",
"group_name": "Fedora Updates",
"settings": {},
"version": "*"
}

View file

@ -33,12 +33,14 @@
"distri": "fedora",
"arch": "ppc64le",
"flavor": "Server-dvd-iso",
"group_name": "Fedora PowerPC",
"version": "*"
},
"fedora-Server-dvd-iso-x86_64-*": {
"distri": "fedora",
"arch": "x86_64",
"flavor": "Server-dvd-iso",
"group_name": "fedora",
"settings": {
"TEST_TARGET": "COMPOSE",
"QEMURAM": "3072"

View file

@ -43,11 +43,13 @@
"Products": {
"fedora-Server-dvd-iso-ppc64le-*": {
"arch": "ppc64le",
"flavor": "Server-dvd-iso"
"flavor": "Server-dvd-iso",
"group_name": "Fedora PowerPC"
},
"fedora-Server-dvd-iso-x86_64-*": {
"arch": "x86_64",
"flavor": "Server-dvd-iso",
"group_name": "fedora",
"settings": {
"TEST_TARGET": "COMPOSE",
"QEMURAM": "3072"