summary refs log tree commit diff
path: root/.gitlab-ci
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2025-02-12 13:46:50 +0100
committerMichael Biebl <biebl@debian.org>2025-02-12 13:46:50 +0100
commit8bdf070ff046f482f6eb5e2b15ebc216f5d1e3da (patch)
treef706478d189d54c6532e8863d4b0d5ff5575af60 /.gitlab-ci
parent818258cf34b83fbc754633295e1052d4752d7b15 (diff)
New upstream version 1.51.90 upstream/1.51.90
Diffstat (limited to '.gitlab-ci')
-rw-r--r--.gitlab-ci/README.md4
-rw-r--r--.gitlab-ci/ci.template17
-rw-r--r--.gitlab-ci/config.yml26
-rw-r--r--.gitlab-ci/distros-info.yml42
-rwxr-xr-x.gitlab-ci/distros_support.py234
-rwxr-xr-x.gitlab-ci/run-test.sh48
6 files changed, 317 insertions, 54 deletions
diff --git a/.gitlab-ci/README.md b/.gitlab-ci/README.md
index 5619a418..5214f7bc 100644
--- a/.gitlab-ci/README.md
+++ b/.gitlab-ci/README.md
@@ -19,8 +19,8 @@ Regenerate the yml by running `ci-fairy generate-template`.
 There are also tests for checking that the yml is correct:
 
 1) run `tools/check-gitlab-ci.sh`
-2) run `make check-local-gitlab-ci`, which runs 1). This also
-  runs as part of `make check`.
+2) run `meson test check-local-gitlab-ci`, which runs 1). This also
+  runs as part of `meson test`.
 
 In both cases, the test is skipped if `ci-fairy` is not in the path.
 Install the correct `ci-fairy` version.
diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template
index a804a2ee..3af5cac4 100644
--- a/.gitlab-ci/ci.template
+++ b/.gitlab-ci/ci.template
@@ -119,8 +119,10 @@ tier{{distro.tier}}:{{distro.name}}:{{version}}@prep:
     FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
     FDO_DISTRIBUTION_EXEC: ${{distro.name.upper()}}_EXEC
   rules:
+{% if distro.tier == 1 %}
+    - if: $CI_PIPELINE_SOURCE != 'schedule' || $SCHEDULED_PIPELINE_NAME == "weekly"
+{% else %}
     - if: $CI_PIPELINE_SOURCE != 'schedule'
-{% if distro.tier > 1 %}
       when: manual
       allow_failure: true
 {% endif %}
@@ -225,7 +227,7 @@ check-tree:
     - date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc
     - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh -n
     - date '+%Y%m%d-%H%M%S'; ci-fairy generate-template && git diff --exit-code
-    - date '+%Y%m%d-%H%M%S'; ./autogen.sh --disable-autotools-deprecation && [ "$(LANG=C make -C po update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ]
+    - date '+%Y%m%d-%H%M%S'; meson setup build && [ "$(LANG=C ninja -C build NetworkManager-update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ]
 
 pages:
   stage: deploy
@@ -257,17 +259,18 @@ triage:issues:
 
 coverity:
   extends:
-    - .fdo.distribution-image@fedora
+    - .fdo.distribution-image@{{default_distro.name}}
   variables:
-    FDO_DISTRIBUTION_VERSION: '40'
-    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
+    FDO_DISTRIBUTION_VERSION: '{{default_distro.versions[0]}}'
+    FDO_DISTRIBUTION_TAG: ${{default_distro.name.upper()}}_TAG
   stage: coverity
-  needs: []
+  needs:
+    - "tier{{default_distro.tier}}:{{default_distro.name}}:{{default_distro.versions[0]}}@prep"
   rules:
     - if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly"
   script:
     - dnf install -y curl
-    - BUILD_TYPE=meson CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
+    - CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
     - cd build
     - ../.gitlab-ci/coverity.sh download
     - cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja
diff --git a/.gitlab-ci/config.yml b/.gitlab-ci/config.yml
index 8b9fcac3..39607308 100644
--- a/.gitlab-ci/config.yml
+++ b/.gitlab-ci/config.yml
@@ -27,10 +27,27 @@ distributions:
 
   # 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: ubuntu
+    tier: 2
+    versions:
+      - 'devel'
+  - name: debian
+    tier: 2
+    versions:
+      - 'testing'
+      - 'sid'
   - name: alpine
     tier: 2
     versions:
-      - '3.21'
+      - '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.
@@ -52,10 +69,7 @@ distributions:
   - name: alpine
     tier: 3
     versions:
+      - '3.21'
       - '3.20'
       - '3.19'
-      - '3.18'
-  - name: centos
-    tier: 3
-    versions:
-      - 'stream9'
\ No newline at end of file
+      - '3.18'
\ No newline at end of file
diff --git a/.gitlab-ci/distros-info.yml b/.gitlab-ci/distros-info.yml
index 53a63e21..d96ec125 100644
--- a/.gitlab-ci/distros-info.yml
+++ b/.gitlab-ci/distros-info.yml
@@ -2,25 +2,25 @@
 #   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: 2025-11-19
+  nm: 1.50
+  tier1-default: yes
 - version: 40
   support: 2025-05-13
   nm: 1.46
-- version: 39
-  support: 2024-11-12
-  nm: 1.44
 
 # CentOS Stream
 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 +29,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 +71,18 @@ 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.10
+  name: oracular
+  support: 2025-07-10
+  nm: 1.48
 - version: 24.04
-  name: focal
+  name: noble
   support: 2029-05-31
   extended-support: 2034-04-25
   nm: 1.46
@@ -82,7 +92,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 +100,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,10 +125,15 @@ 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
   nm: main
+- version: 3.21
+  support: 2026-11-01
+  nm: 1.50
 - version: 3.20
   support: 2026-04-01
   nm: 1.46
@@ -126,6 +143,3 @@ alpine:
 - version: 3.18
   support: 2025-05-09
   nm: 1.42
-- version: 3.17
-  support: 2024-11-22
-  nm: 1.40
diff --git a/.gitlab-ci/distros_support.py b/.gitlab-ci/distros_support.py
new file mode 100755
index 00000000..f4989fba
--- /dev/null
+++ b/.gitlab-ci/distros_support.py
@@ -0,0 +1,234 @@
+#!/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 fed_ver_info in distros_info["fedora"]:
+    # We prefer the Fedora version marked as tier1-default
+    if fed_ver_info.get("tier1-default", False):
+        for tier in (tier2, tier3):
+            if fed_ver_info["version"] in tier.get("fedora", []):
+                tier1_distro = "fedora"
+                tier1_version = fed_ver_info["version"]
+                tier["fedora"].remove(fed_ver_info["version"])
+                if not tier["fedora"]:
+                    del tier["fedora"]
+
+for distro in ci_distros:
+    if tier1_distro:
+        break
+
+    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 not tier1_distro or not tier1_version:
+    print("Warn: no suitable distro for Tier 1 found", file=sys.stderr)
+
+# Always add CentOS Stream at least as Tier 3
+for centos_ver_info in distros_info["centos"]:
+    version = centos_ver_info["version"]
+    found = False
+
+    if tier1_distro == "centos" and tier1_version == version:
+        found = True
+    for tier in (tier2, tier3):
+        if "centos" in tier and version in tier["centos"]:
+            found = True
+            break
+
+    if not found:
+        tier3.setdefault("centos", []).append(version)
+
+# 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))
diff --git a/.gitlab-ci/run-test.sh b/.gitlab-ci/run-test.sh
index 2008c189..265dbd54 100755
--- a/.gitlab-ci/run-test.sh
+++ b/.gitlab-ci/run-test.sh
@@ -50,7 +50,7 @@ meson --version
 export NMTST_SKIP_CHECK_GITLAB_CI=1
 
 # Assert that "$1" is one of the valid values for NM_TEST_SELECT_RUN. die() otherwise.
-check_run_assert() {
+is_run_selected_assert() {
     { set +x; } 2>/dev/null
     local run="$1"
     local a
@@ -83,27 +83,19 @@ check_run_assert() {
 }
 
 [ -z "$NM_TEST_SELECT_RUN" ] && NM_TEST_SELECT_RUN=all
-check_run_assert "$NM_TEST_SELECT_RUN"
+is_run_selected_assert "$NM_TEST_SELECT_RUN"
 
-check_run() {
-    local test_no="$1"
+is_run_selected() {
+    local run="$1"
 
-    check_run_assert "$test_no"
+    is_run_selected_assert "$run"
 
     # Usually, we run the build several times. However, for testing
     # the build script manually, it can be useful to explicitly select
     # one step to run. For example, if step 3 is known to fail, you
     # can still manually run step A by setting NM_TEST_SELECT_RUN=A.
 
-    test "$NM_TEST_SELECT_RUN" = all -o "$NM_TEST_SELECT_RUN" = "$test_no"
-}
-
-check_run_clean() {
-    if ! check_run "$1" ; then
-        return 1
-    fi
-    do_clean
-    return 0
+    test "$NM_TEST_SELECT_RUN" = all -o "$NM_TEST_SELECT_RUN" = "$run"
 }
 
 die_with_testlog() {
@@ -111,30 +103,35 @@ die_with_testlog() {
     exit 1
 }
 
-if check_run_clean meson+gcc+docs+valgrind ; then
-    BUILD_TYPE=meson CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh || die_with_testlog
+if is_run_selected meson+gcc+docs+valgrind ; then
+    do_clean
+    CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh || die_with_testlog
     mv INST/share/gtk-doc/html "$ARTIFACT_DIR/docs-html"
 fi
 
-if check_run_clean meson+clang; then
-    BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh || die_with_testlog
+if is_run_selected meson+clang; then
+    do_clean
+    CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh || die_with_testlog
 fi
 
-if check_run_clean rpm+meson; then
+if is_run_selected rpm+meson; then
+    do_clean
     if [[ $IS_FEDORA = 1 ]]; then
         ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson || die_with_testlog
     fi
 fi
 
-if check_run_clean tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then
+if is_run_selected tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then
+    do_clean
     SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r || die_with_testlog
     mv ./build/meson-dist/NetworkManager-1*.tar.xz "$ARTIFACT_DIR/"
     mv ./contrib/fedora/rpm/latest/SRPMS/NetworkManager-1*.src.rpm "$ARTIFACT_DIR/"
     do_clean
 fi
 
-if check_run_clean tarball+meson; then
-    BUILD_TYPE=meson CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh || die_with_testlog
+if is_run_selected tarball+meson; then
+    do_clean
+    CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh || die_with_testlog
 fi
 
 ###############################################################################
@@ -162,7 +159,8 @@ test_subtree() {
     popd
 }
 
-if check_run_clean subtree; then
+if is_run_selected subtree; then
+    do_clean
     for d in c-list c-rbtree c-siphash c-stdaux n-acd n-dhcp4 ; do
         for cc in gcc clang; do
             test_subtree "$d" "$cc"
@@ -174,10 +172,10 @@ fi
 
 if [ "$NM_BUILD_TARBALL" = 1 ]; then
     do_clean
-    if check_run meson+gcc+docs+valgrind ; then
+    if is_run_selected meson+gcc+docs+valgrind ; then
         mv "$ARTIFACT_DIR/docs-html/" ./
     fi
-    if check_run tarball ; then
+    if is_run_selected tarball ; then
         mv \
            "$ARTIFACT_DIR"/NetworkManager-1*.tar.xz \
            "$ARTIFACT_DIR"/NetworkManager-1*.src.rpm \