CI: remove upstream compatibility checks (!1085)

Do not run upstream compatibility checks whenever pushing to master.
This is confusing, because if the upstream compatibility check fails,
then it appears that the last patch was broken in some way although it
isn't related.

I've moved the upstream compatibility checks to a separate repository
already, and added a badge to the pmaports gitlab project that indicates
whether they are currently succeding or not. The checks run hourly now.

Related: https://gitlab.com/postmarketOS/monitoring
Fixes: #457
This commit is contained in:
Oliver Smith 2020-03-21 16:36:38 +01:00
parent e1e1d7fa07
commit 0e5ba649a5
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 1 additions and 191 deletions

View file

@ -69,8 +69,7 @@ aports-static:
- .gitlab-ci/install_pmbootstrap.sh pytest
script:
- apk -q add git
- su pmos -c ".gitlab-ci/run_testcases.sh
-m 'not pmaports_upstream_compat'"
- su pmos -c ".gitlab-ci/run_testcases.sh"
- su pmos -c ".gitlab-ci/check_changed_aports_versions.py"
artifacts:
when: on_failure
@ -117,24 +116,6 @@ mr-settings:
script:
- .gitlab-ci/check_mr_settings.py
# aports checks (upstream compatibility)
aports-static-upstream:
stage: second
only:
- master@postmarketOS/pmaports
before_script:
- .gitlab-ci/install_pmbootstrap.sh pytest
script:
- su pmos -c ".gitlab-ci/run_testcases.sh
-m 'pmaports_upstream_compat'"
artifacts:
when: on_failure
paths:
- log.txt
- log_testsuite_pmaports.txt
- pmbootstrap.cfg
expire_in: 1 week
# build changed aports
aports-build:
stage: second

View file

@ -1,58 +0,0 @@
#!/usr/bin/env python3
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
"""
This file uses pmb.helper.pkgrel_bump to check if the aports need a pkgrel bump
for any package, caused by a soname bump. Example: A new libressl/openssl
version was released, which increased the soname version, and now all packages
that link against it, need to be rebuilt.
"""
import os
import pytest
import sys
import add_pmbootstrap_to_import_path
import pmb.helpers.pkgrel_bump
import pmb.helpers.logging
import pmb.parse
@pytest.fixture
def args(request):
# Initialize args
sys.argv = ["pmbootstrap",
"--aports", os.path.dirname(__file__) + "/../..",
"--log", "$WORK/log_testsuite_pmaports.txt"
"chroot"]
args = pmb.parse.arguments()
# Initialize logging
pmb.helpers.logging.init(args)
request.addfinalizer(args.logfd.close)
return args
@pytest.mark.pmaports_upstream_compat
def test_soname_bump(args):
# Temporarily disabled, because the postmarketOS binary repository has
# armhf packages for various kde related packages depending on
# qt5-qtwebengine-dev, although qt5-qtwebengine-dev isn't available for
# armhf anymore. All related pmaports were disabled for armhf, however
# currently the binary repository does not delete binary packages yet,
# after the corresponding pmaport was deleted/disabled for a given arch.
# I'll work on this with high priority, so we can enable the test again.
# Related: https://gitlab.com/postmarketOS/build.postmarketos.org/issues/38
# - ollieparanoid
return True
if pmb.helpers.pkgrel_bump.auto(args, True):
raise RuntimeError("One or more packages need to be rebuilt, because"
" a library they link against had an incompatible"
" upgrade (soname bump). Run 'pmbootstrap"
" pkgrel_bump --auto' to automatically increase the"
" pkgrel in order to trigger a rebuild. If this"
" test case failed during a pull request, the issue"
" needs to be fixed on the 'master' branch first,"
" then rebase your PR on 'master' afterwards.")

View file

@ -1,113 +0,0 @@
#!/usr/bin/env python3
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import os
import sys
import glob
import pytest
import add_pmbootstrap_to_import_path
import pmb.helpers.logging
import pmb.parse.apkindex
import pmb.parse
@pytest.fixture
def args(request):
# Initialize args
sys.argv = ["pmbootstrap",
"--aports", os.path.dirname(__file__) + "/../..",
"--log", "$WORK/log_testsuite_pmaports.txt"
"chroot"]
args = pmb.parse.arguments()
# Initialize logging
pmb.helpers.logging.init(args)
request.addfinalizer(args.logfd.close)
return args
@pytest.mark.pmaports_upstream_compat
def test_qt_versions(args):
"""
Verify, that all postmarketOS qt5- package versions match with Alpine's
qt5-qtbase version.
"""
# Upstream version
index = pmb.helpers.repo.alpine_apkindex_path(args, "community", "x86_64")
index_data = pmb.parse.apkindex.package(args, "qt5-qtbase",
indexes=[index])
pkgver_upstream = index_data["version"].split("-r")[0]
# Iterate over our packages
failed = []
for path in glob.glob(args.aports + "/*/qt5-*/APKBUILD"):
# Read the pkgver
apkbuild = pmb.parse.apkbuild(args, path)
pkgname = apkbuild["pkgname"]
pkgver = apkbuild["pkgver"]
# When we temporarily override packages from Alpine, we set the pkgver
# to 9999 and _pkgver contains the real version (see #994).
if pkgver == "9999":
pkgver = apkbuild["_pkgver"]
# We had to add a few qt5 git packages for unity8 (!27), obviously we
# can't compare the version there.
if "_git" in pkgver:
continue
# Compare
if pkgver == pkgver_upstream:
continue
failed.append(pkgname + ": " + pkgver + " != " +
pkgver_upstream)
assert [] == failed
@pytest.mark.pmaports_upstream_compat
def test_aportgen_versions(args):
"""
Verify that the packages generated by 'pmbootstrap aportgen' have
the same version (pkgver *and* pkgrel!) as the upstream packages
they are based on.
"""
# Get Alpine's "main" repository APKINDEX path
index = pmb.helpers.repo.alpine_apkindex_path(args, "main", "x86_64")
# Alpine packages and patterns for our derivatives
map = {"binutils": "binutils-*",
"busybox": "busybox-static-*",
"gcc": "gcc-*",
"grub": "grub-efi-*",
"musl": "musl-*"}
# Iterate over Alpine packages
failed = []
generated = "# Automatically generated aport, do not edit!"
for pkgname, pattern in map.items():
# Upstream version
index_data = pmb.parse.apkindex.package(args, pkgname,
indexes=[index])
version_upstream = index_data["version"]
# Iterate over our packages
for path in glob.glob(args.aports + "/*/" + pattern + "/APKBUILD"):
# Skip non-aportgen APKBUILDs
with open(path) as handle:
if generated not in handle.read():
continue
# Compare the version
print("Checking " + path)
apkbuild = pmb.parse.apkbuild(args, path)
version = apkbuild["pkgver"] + "-r" + apkbuild["pkgrel"]
if version != version_upstream:
failed.append(apkbuild["pkgname"] + ": " + version +
" != " + version_upstream +
" (from " + pkgname + ")")
continue
assert [] == failed