openqa/SOURCES/0001-fix-Support-invent.kde.org-and-work_items-in-bug-URL.patch
Andrew Lukoshko 990da3102b Update to 5^20260604git6376095 (sync with Fedora)
- Update openQA 4.6 -> 5 to match Fedora; refresh the Fedora messaging /
  update-restart plugins, configs, and pre-generated asset cache for the
  new snapshot.
- Re-sync the spec with Fedora v5 (drop the stale older baseline).
- Carry Fedora backports: skip tests_dependencies.t earlier, and support
  invent.kde.org / work_items in bug URLs.
- Pairs with os-autoinst 5 (the worker no longer caps os-autoinst < 5).
2026-07-20 19:45:53 +02:00

76 lines
3.3 KiB
Diff

From a5465d3a37632a503c772f0c87f4d03f198ecdbf Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Fri, 5 Jun 2026 16:14:57 -0700
Subject: [PATCH] fix: Support invent.kde.org and 'work_items' in bug URL
handling
https://invent.kde.org is another issue tracker we should know
about. It's Gitlab.
While we're here, also handle Gitlab URLs with 'work_items' in
them instead of 'issues', as Gitlab rebranded that recently. We
don't need to support this in the other direction (ref to URL)
yet, fortunately - Gitlab redirects /issues/ to /work_items/.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
lib/OpenQA/Utils.pm | 7 ++++++-
t/16-utils.t | 2 ++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/OpenQA/Utils.pm b/lib/OpenQA/Utils.pm
index 4bb40db6e..e73617d15 100644
--- a/lib/OpenQA/Utils.pm
+++ b/lib/OpenQA/Utils.pm
@@ -49,6 +49,7 @@ BEGIN {
poo => 'https://progress.opensuse.org/issues/',
gh => 'https://github.com/',
kde => 'https://bugs.kde.org/show_bug.cgi?id=',
+ kdi => 'https://invent.kde.org/',
fdo => 'https://bugs.freedesktop.org/show_bug.cgi?id=',
jsc => 'https://jira.suse.com/browse/',
pio => 'https://pagure.io/',
@@ -66,6 +67,7 @@ BEGIN {
$BUGREFS{poo} => 'poo',
$BUGREFS{gh} => 'gh',
$BUGREFS{kde} => 'kde',
+ $BUGREFS{kdi} => 'kdi',
$BUGREFS{fdo} => 'fdo',
$BUGREFS{jsc} => 'jsc',
$BUGREFS{pio} => 'pio',
@@ -441,6 +443,8 @@ sub bugurl ($bugref) {
# same page as https://github.com/os-autoinst/openQA/pull/966 and vice
# versa for both an issue as well as pull request
# for pagure.io it has to be "issue", not "issues"
+ # gitlab rebranded "issues" to "work_items" in 2026, but so far
+ # they're keeping a redirect so we can still use "issues" for now
$bugref =~ BUGREF_REGEX or return $bugref;
my $issuetext = $+{marker} eq 'pio' ? 'issue' : 'issues';
return $BUGREFS{$+{marker}} . ($+{repo} ? "$+{repo}/$issuetext/" : '') . $+{id};
@@ -464,7 +468,8 @@ sub href_to_bugref ($text) {
# interchangeable, see comment in 'bugurl', too
# gitlab URLs have an odd /-/ after the repo name, e.g.
# https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5244
- $regex = qr{(?<!["\(\[])(?<url_root>$regex)((?<repo>.*?)/(-/)?(issues?|pull)/)?(?<id>([A-Z]+-)?\d+)(?![\w])};
+ $regex
+ = qr{(?<!["\(\[])(?<url_root>$regex)((?<repo>.*?)/(-/)?(issues?|pull|work_items)/)?(?<id>([A-Z]+-)?\d+)(?![\w])};
$text =~ s{$regex}{@{[$BUGURLS{$+{url_root}} . ($+{repo} ? '#' . $+{repo} : '')]}#$+{id}}gi;
return $text;
}
diff --git a/t/16-utils.t b/t/16-utils.t
index 111acb6ff..fc910cb6c 100644
--- a/t/16-utils.t
+++ b/t/16-utils.t
@@ -142,6 +142,8 @@ is href_to_bugref('https://gitlab.gnome.org/GNOME/foo/-/issues/1234'), 'ggo#GNOM
is href_to_bugref('https://gitlab.com/fedora/sigs/flatpak/fedora-flatpaks/-/issues/26'),
'gfs#flatpak/fedora-flatpaks#26',
'Fedora SIGs gitlab url to bugref';
+is href_to_bugref('https://invent.kde.org/plasma/systemsettings/-/work_items/49'), 'kdi#plasma/systemsettings#49',
+ 'KDE Invent gitlab url to bugref (with newer "work_items" name)';
is find_bug_number('yast_roleconf-ntp-servers-empty-bsc1114818-20181115.png'), 'bsc1114818',
'find the bug number from the needle name';
--
2.54.0