public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/python] main: Use reinstall and distrosync instead of downgrade to cover more use-cases
@ 2026-07-14 9:10 Lumir Balhar
0 siblings, 0 replies; only message in thread
From: Lumir Balhar @ 2026-07-14 9:10 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : tests/python
Branch : main
Commit : a83a4480c009c4ac68566c019116f77863d30cae
Author : Lumir Balhar <lbalhar@redhat.com>
Date : 2026-07-13T19:35:24+02:00
Stats : +19/-12 in 1 file(s)
URL : https://src.fedoraproject.org/tests/python/c/a83a4480c009c4ac68566c019116f77863d30cae?branch=main
Log:
Use reinstall and distrosync instead of downgrade to cover more use-cases
---
diff --git a/required-symbols/check.sh b/required-symbols/check.sh
index f0727f9..797f024 100755
--- a/required-symbols/check.sh
+++ b/required-symbols/check.sh
@@ -20,12 +20,12 @@ PYVER=${VERSION}
SCRIPT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
WORK_DIR=""
-DOWNGRADED=false
+PKGS_MODIFIED=false
cleanup() {
- if [[ "$DOWNGRADED" == true ]]; then
+ if [[ "$PKGS_MODIFIED" == true ]]; then
echo ""
- echo "=== Reverting package downgrade ==="
+ echo "=== Reverting package changes ==="
dnf history undo last -y 2>&1 || echo "WARNING: dnf history undo failed" >&2
fi
[[ -n "$WORK_DIR" ]] && rm -rf "$WORK_DIR"
@@ -53,14 +53,10 @@ WORK_DIR=$(mktemp -d)
echo "=== Collecting PR build symbols ==="
python${PYVER} "$SCRIPT_DIR/collect_symbols.py" "${SCAN_ARGS[@]}" > "$WORK_DIR/new.json"
-# Downgrade to the latest stable version in the distribution repos.
-# If no older version is available, there is nothing to compare against → skip.
echo ""
echo "=== Available repos ==="
dnf repolist --all
-echo ""
-echo "=== Downgrading to the latest stable version in repos ==="
# Discover packages dynamically from the installed source RPM so we don't need
# to hardcode subpackage names — works regardless of which subpackages were built.
readarray -t PKGS < <(
@@ -68,13 +64,24 @@ readarray -t PKGS < <(
awk -v src="python${PYVER}" '$1 ~ "^" src "-[0-9]" { print $2 }' |
sort -u
)
-echo "Packages to downgrade: ${PKGS[*]}"
+echo "Packages to install from stable repos: ${PKGS[*]}"
-if ! dnf downgrade -y "${PKGS[@]}" 2>&1; then
- echo "INFO: dnf downgrade failed or no stable version available; skipping comparison." >&2
- exit 0
+# Install the stable version from distribution repos, excluding the artifact repo
+# that carries the PR build, so we always compare against what is publicly available.
+#
+# Strategy:
+# 1. dnf reinstall — works when the PR did not bump NVR (same version in stable repos)
+# 2. dnf distro-sync — fallback when the PR bumped NVR; installs the latest stable NVR
+echo ""
+echo "=== Installing stable version from repos ==="
+if ! dnf reinstall -y --disablerepo=test-artifacts "${PKGS[@]}" 2>&1; then
+ echo "INFO: reinstall failed (NVR not in stable repos), falling back to distro-sync" >&2
+ if ! dnf distro-sync -y --disablerepo=test-artifacts "${PKGS[@]}" 2>&1; then
+ echo "INFO: distro-sync failed; no stable version available, skipping comparison." >&2
+ exit 0
+ fi
fi
-DOWNGRADED=true
+PKGS_MODIFIED=true
echo ""
echo "=== Collecting stable version symbols ==="
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-14 9:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-14 9:10 [tests/python] main: Use reinstall and distrosync instead of downgrade to cover more use-cases Lumir Balhar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox