merge: branch 'ih/distros-supported'

ci: update distros-info.yml and add script to extract useful info from it

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2025
This commit is contained in:
Íñigo Huguet 2024-09-10 11:44:16 +00:00
commit 67416d52f4
4 changed files with 462 additions and 185 deletions

View file

@ -60,11 +60,11 @@ variables:
#
# This is done by running `ci-fairy generate-template` and possibly bumping
# ".default_tag".
ALPINE_TAG: 'tag-961e70a41177'
CENTOS_TAG: 'tag-fe6805b2c8f4'
DEBIAN_TAG: 'tag-806721d9d354'
FEDORA_TAG: 'tag-fe6805b2c8f4'
UBUNTU_TAG: 'tag-806721d9d354'
ALPINE_TAG: 'tag-5fca51298172'
CENTOS_TAG: 'tag-40039d32d4e4'
DEBIAN_TAG: 'tag-410ffa3d1295'
FEDORA_TAG: 'tag-40039d32d4e4'
UBUNTU_TAG: 'tag-410ffa3d1295'
ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh'
CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh'
@ -100,32 +100,18 @@ variables:
# Build a container for each distribution + version. The ci-templates
# will re-use the containers if the tag doesn't change.
tier1:fedora:40@prep:
tier1:fedora:41@prep:
extends:
- .fdo.container-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '40'
FDO_DISTRIBUTION_VERSION: '41'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
tier2:centos:stream9@prep:
extends:
- .fdo.container-build@centos
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier2:fedora:rawhide@prep:
extends:
- .fdo.container-build@fedora
@ -140,29 +126,15 @@ tier2:fedora:rawhide@prep:
when: manual
allow_failure: true
tier2:debian:sid@prep:
tier2:centos:stream9@prep:
extends:
- .fdo.container-build@debian
- .fdo.container-build@centos
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'sid'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier2:debian:testing@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'testing'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
@ -182,6 +154,34 @@ tier2:ubuntu:devel@prep:
when: manual
allow_failure: true
tier2:debian:testing@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'testing'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier2:debian:sid@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'sid'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier2:alpine:edge@prep:
extends:
- .fdo.container-build@alpine
@ -196,6 +196,20 @@ tier2:alpine:edge@prep:
when: manual
allow_failure: true
tier3:fedora:40@prep:
extends:
- .fdo.container-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '40'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:fedora:39@prep:
extends:
- .fdo.container-build@fedora
@ -210,13 +224,13 @@ tier3:fedora:39@prep:
when: manual
allow_failure: true
tier3:ubuntu:20.04@prep:
tier3:ubuntu:24.04@prep:
extends:
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '20.04'
FDO_DISTRIBUTION_VERSION: '24.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC
rules:
@ -238,13 +252,13 @@ tier3:ubuntu:22.04@prep:
when: manual
allow_failure: true
tier3:ubuntu:24.04@prep:
tier3:ubuntu:20.04@prep:
extends:
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '24.04'
FDO_DISTRIBUTION_VERSION: '20.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC
rules:
@ -252,27 +266,13 @@ tier3:ubuntu:24.04@prep:
when: manual
allow_failure: true
tier3:ubuntu:rolling@prep:
extends:
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'rolling'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:debian:stable@prep:
tier3:debian:12@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'stable'
FDO_DISTRIBUTION_VERSION: '12'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
@ -280,27 +280,55 @@ tier3:debian:stable@prep:
when: manual
allow_failure: true
tier3:debian:oldstable@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'oldstable'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:alpine:latest@prep:
tier3:alpine:3.20@prep:
extends:
- .fdo.container-build@alpine
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'latest'
FDO_DISTRIBUTION_VERSION: '3.20'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
FDO_DISTRIBUTION_EXEC: $ALPINE_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:alpine:3.19@prep:
extends:
- .fdo.container-build@alpine
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '3.19'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
FDO_DISTRIBUTION_EXEC: $ALPINE_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:alpine:3.18@prep:
extends:
- .fdo.container-build@alpine
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '3.18'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
FDO_DISTRIBUTION_EXEC: $ALPINE_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:alpine:3.17@prep:
extends:
- .fdo.container-build@alpine
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '3.17'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
FDO_DISTRIBUTION_EXEC: $ALPINE_EXEC
rules:
@ -324,7 +352,7 @@ tier3:alpine:latest@prep:
dependencies: []
t_fedora:40:
t_fedora:41:
extends:
- .build@template
- .fdo.distribution-image@fedora
@ -340,24 +368,10 @@ t_fedora:40:
- tarball
- subtree
variables:
FDO_DISTRIBUTION_VERSION: '40'
FDO_DISTRIBUTION_VERSION: '41'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "tier1:fedora:40@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_centos:stream9:
extends:
- .build@template
- .fdo.distribution-image@centos
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
needs:
- "tier2:centos:stream9@prep"
- "tier1:fedora:41@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
@ -375,31 +389,17 @@ t_fedora:rawhide:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:sid:
t_centos:stream9:
extends:
- .build@template
- .fdo.distribution-image@debian
- .fdo.distribution-image@centos
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'sid'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
needs:
- "tier2:debian:sid@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:testing:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'testing'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier2:debian:testing@prep"
- "tier2:centos:stream9@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
@ -417,6 +417,34 @@ t_ubuntu:devel:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:testing:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'testing'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier2:debian:testing@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:sid:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'sid'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier2:debian:sid@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:edge:
extends:
- .build@template
@ -431,6 +459,20 @@ t_alpine:edge:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_fedora:40:
extends:
- .build@template
- .fdo.distribution-image@fedora
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '40'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "tier3:fedora:40@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_fedora:39:
extends:
- .build@template
@ -445,17 +487,17 @@ t_fedora:39:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_ubuntu:20.04:
t_ubuntu:24.04:
extends:
- .build@template
- .fdo.distribution-image@ubuntu
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '20.04'
FDO_DISTRIBUTION_VERSION: '24.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
needs:
- "tier3:ubuntu:20.04@prep"
- "tier3:ubuntu:24.04@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
@ -473,73 +515,87 @@ t_ubuntu:22.04:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_ubuntu:24.04:
t_ubuntu:20.04:
extends:
- .build@template
- .fdo.distribution-image@ubuntu
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '24.04'
FDO_DISTRIBUTION_VERSION: '20.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
needs:
- "tier3:ubuntu:24.04@prep"
- "tier3:ubuntu:20.04@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_ubuntu:rolling:
extends:
- .build@template
- .fdo.distribution-image@ubuntu
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: 'rolling'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
needs:
- "tier3:ubuntu:rolling@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:stable:
t_debian:12:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: 'stable'
FDO_DISTRIBUTION_VERSION: '12'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier3:debian:stable@prep"
- "tier3:debian:12@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:oldstable:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: 'oldstable'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier3:debian:oldstable@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:latest:
t_alpine:3.20:
extends:
- .build@template
- .fdo.distribution-image@alpine
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: 'latest'
FDO_DISTRIBUTION_VERSION: '3.20'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
needs:
- "tier3:alpine:latest@prep"
- "tier3:alpine:3.20@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:3.19:
extends:
- .build@template
- .fdo.distribution-image@alpine
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '3.19'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
needs:
- "tier3:alpine:3.19@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:3.18:
extends:
- .build@template
- .fdo.distribution-image@alpine
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '3.18'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
needs:
- "tier3:alpine:3.18@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:3.17:
extends:
- .build@template
- .fdo.distribution-image@alpine
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '3.17'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
needs:
- "tier3:alpine:3.17@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
@ -553,10 +609,10 @@ check-patch:
extends:
- .fdo.distribution-image@fedora
variables:
FDO_DISTRIBUTION_VERSION: '40'
FDO_DISTRIBUTION_VERSION: '41'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "tier1:fedora:40@prep"
- "tier1:fedora:41@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
stage: tier1
@ -568,10 +624,10 @@ check-tree:
extends:
- .fdo.distribution-image@fedora
variables:
FDO_DISTRIBUTION_VERSION: '40'
FDO_DISTRIBUTION_VERSION: '41'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "tier1:fedora:40@prep"
- "tier1:fedora:41@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
stage: tier1
@ -597,9 +653,9 @@ pages:
when: never
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'main'
dependencies:
- "t_fedora:40: [meson+gcc+docs+valgrind]"
- "t_fedora:41: [meson+gcc+docs+valgrind]"
needs:
- "t_fedora:40: [meson+gcc+docs+valgrind]"
- "t_fedora:41: [meson+gcc+docs+valgrind]"
triage:issues:
stage: triage

View file

@ -23,51 +23,53 @@ distributions:
- name: fedora
tier: 1
versions:
- '40'
- '41'
# TIER 2: distribution versions that will or might use the current NM version.
# Run when doing a release.
- name: fedora
tier: 2
versions:
- 'rawhide'
- name: centos
tier: 2
versions:
- 'stream9'
- name: fedora
tier: 2
versions:
- rawhide
- name: debian
tier: 2
versions:
- sid
- testing
- name: ubuntu
tier: 2
versions:
- devel
- 'devel'
- name: debian
tier: 2
versions:
- 'testing'
- 'sid'
- name: alpine
tier: 2
versions:
- edge
- 'edge'
# TIER 3: distribution versions not in EOL but don't use the current NM version.
# Run when doing a release, but a failure won't be blocking for the release.
- name: fedora
tier: 3
versions:
- '40'
- '39'
- name: ubuntu
tier: 3
versions:
- '20.04'
- '22.04'
- '24.04'
- 'rolling' # latest non-LTS
- '22.04'
- '20.04'
- name: debian
tier: 3
versions:
- 'stable'
- 'oldstable'
- '12'
- name: alpine
tier: 3
versions:
- 'latest'
- '3.20'
- '3.19'
- '3.18'
- '3.17'

View file

@ -2,10 +2,15 @@
# cadence: every 6 months
# support: 13 months
# Image aliases: latest, rawhide
# Releases and support info: https://docs.fedoraproject.org/en-US/releases/lifecycle/
# NetworkManager versions info: https://src.fedoraproject.org/rpms/NetworkManager
fedora:
- version: rawhide
support: yes
nm: main
- version: 41
support: yes
nm: 1.50
- version: 40
support: 2025-05-13
nm: 1.46
@ -18,9 +23,6 @@ centos:
- version: stream9
support: 2027-05-31
nm: main
- version: stream8
support: 2024-05-31 ## EOL
nm: 1.40
# RHEL:
# Even minor versions:
@ -29,10 +31,14 @@ centos:
# Odd minor versions:
# cadence: every year (every other 6 months than even versions)
# support: 6 months
# Releases and support info: https://access.redhat.com/support/policy/updates/errata
rhel:
- version: 9.5
- version: 9.6 # not released yet
support: yes
nm: main
- version: 9.5
support: yes
nm: 1.48
- version: 9.4
support: 2026-04-30
extended-support: 2028-04-30
@ -67,12 +73,14 @@ rhel:
# cadence: every 6 months
# support: 9 months
# Image aliases: latest (LTS), rolling (LTS or non-LTS), devel
# Releases and support info: https://salsa.debian.org/debian/distro-info-data/-/blob/main/ubuntu.csv
# NetworkManager versions info: https://packages.ubuntu.com/search?keywords=network-manager
ubuntu:
- version: devel
support: yes
nm: main
- version: 24.04
name: focal
name: noble
support: 2029-05-31
extended-support: 2034-04-25
nm: 1.46
@ -82,7 +90,7 @@ ubuntu:
extended-support: 2032-04-21
nm: 1.36
- version: 20.04
name: noble
name: focal
support: 2025-05-29
extended-support: 2030-04-23
nm: 1.22
@ -90,9 +98,11 @@ ubuntu:
# Debian:
# cadence: every 2 years
# support: 3 years + 2 years LTS
# Images aliases: stable, oldstable, oldoldstable
# Images aliases: testing, sid, stable, oldstable, oldoldstable
# Releases and support info: https://salsa.debian.org/debian/distro-info-data/-/blob/main/debian.csv
# NetworkManager versions info: https://packages.debian.org/search?keywords=network-manager
debian:
- version: devel
- version: testing
support: yes
nm: main
- version: sid
@ -113,6 +123,8 @@ debian:
# cadence: every 6 months
# support: 2 years
# Image aliases: latest, edge (development)
# Releases and support info: https://alpinelinux.org/releases/
# NetworkManager versions info (manually select Alpine version): https://pkgs.alpinelinux.org/packages?name=networkmanager&arch=x86_64
alpine:
- version: edge
support: yes

207
.gitlab-ci/distros_support.py Executable file
View file

@ -0,0 +1,207 @@
#!/usr/bin/env python3
import datetime
import os
import sys
try:
import yaml
except ImportError:
print("Error: missing pyyaml. Install with `pip install pyyaml`.", file=sys.stderr)
quit(code=1)
# These are the distros that we currently check, ordered by priority to be chosen as Tier 1
ci_distros = ("fedora", "centos", "debian", "ubuntu", "alpine")
def _parse_date(date_str) -> datetime.date:
return datetime.datetime.strptime(date_str, "%Y-%m-%d").date()
def _is_supported(val_str, today) -> bool:
val_str = val_str.lower()
if val_str in ("yes", "true"):
return True
elif val_str in ("no", "false"):
return False
else:
support_date = _parse_date(val_str)
return today <= support_date
def _nm_version_is_newer(nm_ver, nm_ver_from):
if nm_ver == "main":
return nm_ver_from != "main" # main is newer than anything except main itself
elif nm_ver_from == "main":
return False
nm_ver = nm_ver.split(".")
nm_ver_from = nm_ver_from.split(".")
if int(nm_ver[0]) > int(nm_ver_from[0]):
return True
elif nm_ver[0] == nm_ver_from[0] and int(nm_ver[1]) > int(nm_ver_from[1]):
return True
return False
def _print_usage():
print("Usage: distros_support.py [-a|--all] | <nm_version>")
print(" -a|--all: print NM versions still active in any distro")
print(" nm_version: print all info and config.yml file of the specified NM version")
if len(sys.argv) == 2 and sys.argv[1] in ("-h", "--help", "help"):
_print_usage()
quit()
elif len(sys.argv) > 2:
print("Error: wrong arguments.", file=sys.stderr)
_print_usage()
quit(code=1)
today = datetime.date.today()
with open(os.path.dirname(__file__) + "/distros-info.yml") as f:
distros_info = yaml.load(f, Loader=yaml.BaseLoader)
# Warn about EOL'd distros to remove them
for distro, versions in distros_info.items():
for info in versions:
if _is_supported(info["support"], today):
continue
if "extended-support" in info and _is_supported(
info["extended-support"], today
):
continue
print(
f"Warn: {distro} {info['version']} reached EOL, consider deleting this entry",
file=sys.stderr,
)
# If --all is selected, print all active NM versions and return
if len(sys.argv) < 2 or sys.argv[1] in ("-a", "--all"):
nm_versions = {}
for distro, versions in distros_info.items():
for info in versions:
if not _is_supported(info["support"], today):
continue
nm_versions.setdefault(info["nm"], []).append(f"{distro} {info['version']}")
for nm_ver, distros in sorted(nm_versions.items(), reverse=True):
print("- NM {}: {}".format(nm_ver, ", ".join(distros)))
quit()
# Otherwise, print all the info related to the specified NM version
nm_version = sys.argv[1]
# Print distros that uses this nm_version
print(f"# List of distros using NM {nm_version}")
print("---")
for distro, versions in distros_info.items():
for info in versions:
if nm_version == info["nm"] and _is_supported(info["support"], today):
try:
support_end_date = _parse_date(info["support"])
print(
f"- {distro} {info['version']}, supported until {info['support']}"
)
except ValueError:
print(f"- {distro} {info['version']}, supported")
# Collect info about what distros should be Tier 2 and 3
tier2 = {}
tier3 = {}
for distro, versions in distros_info.items():
if distro not in ci_distros:
continue
for info in versions:
if not _is_supported(info["support"], today):
continue
if nm_version == info["nm"]:
tier2.setdefault(distro, []).append(info["version"])
elif _nm_version_is_newer(nm_version, info["nm"]):
tier3.setdefault(distro, []).append(info["version"])
# Select a Tier1 distro
tier1_distro, tier1_version = "", ""
for distro in ci_distros:
for tier in (tier2, tier3):
if distro in tier:
# Exception: we want to use fedora:latest instead of fedora:rawhide because
# we don't want lot of build failures in Tier 1, which is run for every MR.
# We just ignore fedora:rawhide for Tier 1.
if distro == "fedora" and tier[distro][0] == "rawhide":
if len(tier[distro]) == 1:
continue
idx = 1
else:
idx = 0
tier1_distro = distro
tier1_version = tier[distro].pop(idx)
if not tier[distro]:
del tier[distro]
break
if tier1_distro:
break
if not tier1_distro or not tier1_version:
print("Warn: no suitable distro for Tier 1 found", file=sys.stderr)
# Print the config.yml needed for the corresponding stable branch
branch = "main" if nm_version == "main" else "nm-" + nm_version.replace(".", "-")
print("\n# .gitlab-ci/config.yml for branch '{}'".format(branch))
print(
"""---
# This file contains the configuration for the gitlab ci.
#
# To recreate the .gitlab-ci.yml file, run
# ci-fairy generate-template
#
# The ci-fairy tool is part of
# https://gitlab.freedesktop.org/freedesktop/ci-templates
#
# Some distros are fairly similar, and we reuse similar scripts.
# The base type maps the distro name to their base.
base_types:
fedora: fedora
centos: fedora
debian: debian
ubuntu: debian
alpine: alpine
# The list of all distributions we want to create job for.
distributions:
# TIER 1: CI run for all MRs.
# The first tier:1 in the list is used to build the pages and check-{tree,patch}."""
)
print(" - name: {}".format(tier1_distro))
print(" tier: 1")
print(" versions:")
print(" - '{}'".format(tier1_version))
print(
"""
# TIER 2: distribution versions that will or might use the current NM version.
# Run when doing a release."""
)
for distro, versions in tier2.items():
print(" - name: {}".format(distro))
print(" tier: 2")
print(" versions:")
for version in versions:
print(" - '{}'".format(version))
print(
"""
# TIER 3: distribution versions not in EOL but don't use the current NM version.
# Run when doing a release, but a failure won't be blocking for the release."""
)
for distro, versions in tier3.items():
print(" - name: {}".format(distro))
print(" tier: 3")
print(" versions:")
for version in versions:
print(" - '{}'".format(version))