| |
@@ -15,6 +15,7 @@
|
| |
import argparse
|
| |
from collections import defaultdict
|
| |
import json
|
| |
+ import yaml
|
| |
import shutil
|
| |
from tempfile import mkdtemp
|
| |
from urllib.request import urlopen
|
| |
@@ -56,6 +57,13 @@
|
| |
BODHI_RELEASEURL = "https://bodhi.fedoraproject.org/releases/?rows_per_page=500"
|
| |
FEDORA_BASEURL = "http://dl.fedoraproject.org/pub/fedora/linux/"
|
| |
FEDORA_ALTERNATEURL = "http://dl.fedoraproject.org/pub/fedora-secondary/"
|
| |
+ # note this name is synthetic; it does not correspond to an actual comps group
|
| |
+ COREOS_CRITPATH_GROUP = "critical-path-coreos"
|
| |
+ COREOS_CONFIG_URL = "https://raw.githubusercontent.com/coreos/coreos-ci/main/bodhi-testing.yaml"
|
| |
+
|
| |
+ # used as a cache by get_coreos_gating_data
|
| |
+ COREOS_GATED_SRPMS = None
|
| |
+
|
| |
# used as a cache by get_bodhi_releases
|
| |
BODHIRELEASES = {}
|
| |
|
| |
@@ -81,6 +89,14 @@
|
| |
return BODHIRELEASES
|
| |
|
| |
|
| |
+ def get_coreos_gated_srpms():
|
| |
+ global COREOS_GATED_SRPMS
|
| |
+ if COREOS_GATED_SRPMS is None:
|
| |
+ config_data = yaml.safe_load(urlopen(COREOS_CONFIG_URL).read().decode("utf8"))
|
| |
+ COREOS_GATED_SRPMS = config_data.get("gated-srpms", [])
|
| |
+ return COREOS_GATED_SRPMS
|
| |
+
|
| |
+
|
| |
def get_paths(release, forcebranched=False):
|
| |
"""This does a certain amount of fudging so we can refer to
|
| |
Branched by its release number or "branched", and Rawhide by its
|
| |
@@ -245,9 +261,21 @@
|
| |
default=False,
|
| |
help="Not to run for alternate architectures",
|
| |
)
|
| |
+ parser.add_argument(
|
| |
+ "--with-coreos",
|
| |
+ action="store_true",
|
| |
+ default=False,
|
| |
+ help="Add packages configured as gating in CoreOS CI config",
|
| |
+ )
|
| |
return parser.parse_args()
|
| |
|
| |
|
| |
+ # Things that aren't as easy to express via argparse
|
| |
+ def validate_args(args):
|
| |
+ if args.with_coreos and not args.srpm:
|
| |
+ raise Exception("--with-coreos requires --srpm")
|
| |
+
|
| |
+
|
| |
def write_files(critpath, outpath, jsonout):
|
| |
wrapped = {"rpm": critpath}
|
| |
with open(jsonout, mode="w", encoding="utf-8") as jsonoutfh:
|
| |
@@ -326,6 +354,11 @@
|
| |
else:
|
| |
critpath[group].update([pkg.name for pkg in pkgs])
|
| |
|
| |
+ # note for these, we don't do any depsolving
|
| |
+ if args.with_coreos:
|
| |
+ coreos_gated_srpms = get_coreos_gated_srpms()
|
| |
+ critpath[COREOS_CRITPATH_GROUP].update([srpm['name'] for srpm in coreos_gated_srpms])
|
| |
+
|
| |
del pkgdict
|
| |
print()
|
| |
# Turn sets back into lists (so we can JSON-dump them)
|
| |
@@ -337,6 +370,7 @@
|
| |
|
| |
def main():
|
| |
args = parse_args()
|
| |
+ validate_args(args)
|
| |
release = args.release
|
| |
if release == "all":
|
| |
relnums = get_bodhi_releases()
|
| |
The Fedora CoreOS team would like to start gating Bodhi updates on
CoreOS tests passing.
This patch adds a new
--with-coreos
switch tocritpath.py
which will make it reach out to the CoreOS CI configuration file to
know which packages are marked as gating and generate a synthetic
critical-path-coreos
group in the outputcritpath.json
.Currently, ONLY PACKAGES OWNED BY THE COREOS TEAM ARE GATED. Gating
on other packages will be discussed via a future Change Proposal. The
short-term goal is to make sure this is working well before opening
it up.
It's likely the code here will change once we do that, though how
exactly is intimately tied to previous discussions around gating and
the notion of critical path. Currently, they are bound together; we will
have to discuss whether it makes sense to keep it that way or separate
the concepts. Previous discussions on this in:
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/PLMXRKKDYNJN2LBPJEJBWWA3HL6W2FVC
The new functionality is purely opt-in for now to make it safe but easy
to experiment with.
See also: https://github.com/coreos/fedora-coreos-tracker/issues/1617