Skip to content

Commit

Permalink
Add support for centos-stream-10 chroots (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwk committed Sep 12, 2024
1 parent 7403eec commit 7c21207
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
copr_ownername: "@fedora-llvm-team"
copr_project_tpl: "llvm-snapshots-pgo-YYYYMMDD"
copr_monitor_tpl: "https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots-pgo-YYYYMMDD/monitor/"
chroot_pattern: '^(fedora-(rawhide|[0-9]+)|rhel-[8,9]-)'
chroot_pattern: '^(fedora-(rawhide|[0-9]+)|rhel-[8,9]-|centos-stream-10)'
packages: "llvm"
# - name: bootstrap
# maintainer_handle: "kwk"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fedora-copr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: pgo
copr_project_tpl: "@fedora-llvm-team/llvm-snapshots-pgo-YYYYMMDD"
copr_target_project: "@fedora-llvm-team/llvm-snapshots-pgo"
# extra_script_file: "scripts/functions-pgo.sh"
extra_script_file: "scripts/functions-pgo.sh"
clone_url_tpl: "https://src.fedoraproject.org/forks/kkleine/rpms/PKG.git"
clone_ref: pgo
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions scripts/functions-pgo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set -x

# Prints the chroots we care about.
function get_chroots() {
copr list-chroots | grep -P '^(fedora-(rawhide|[0-9]+)|rhel-[8,9]-|centos-stream-10)' | sort | tr '\n' ' '
}
8 changes: 8 additions & 0 deletions snapshot_manager/snapshot_manager/testing_farm_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,12 @@ def select_ranch(cls, chroot: str) -> str:
>>> TestingFarmRequest.select_ranch("fedora-rawhide-i386")
'redhat'
>>> TestingFarmRequest.select_ranch("centos-stream-x86_64")
'public'
>>> TestingFarmRequest.select_ranch("centos-stream-ppc64le")
'redhat'
"""
util.expect_chroot(chroot)
ranch = None
Expand Down Expand Up @@ -405,6 +411,8 @@ def get_compose(cls, chroot: str) -> str:
'RHEL-9-Nightly'
>>> TestingFarmRequest.get_compose("rhel-8-x86_64")
'RHEL-8-Nightly'
>>> TestingFarmRequest.get_compose("centos-stream-10-s390x")
CentOS-Stream-10
"""
util.expect_chroot(chroot)

Expand Down
5 changes: 4 additions & 1 deletion snapshot_manager/snapshot_manager/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,15 @@ def expect_chroot(chroot: str) -> str:
>>> expect_chroot("fedora-rawhide-x86_64")
'fedora-rawhide-x86_64'
>>> expect_chroot("centos-stream-10-x86_64")
'centos-stream-10-x86_64'
>>> expect_chroot("fedora-rawhide-")
Traceback (most recent call last):
...
ValueError: invalid chroot fedora-rawhide-
"""
if not re.search(pattern=r"^[^-]+-[^-]+-[^-]+$", string=chroot):
if not re.search(pattern=r"^[^-]+-[^-]+-[^-]+(-[^-]+)?$", string=chroot):
raise ValueError(f"invalid chroot {chroot}")
return chroot

Expand Down

0 comments on commit 7c21207

Please sign in to comment.