public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/openqa] f44: Backport PR #7688 to add forge.fp.o bugurl/bugref support
@ 2026-07-29 20:37 Adam Williamson
  0 siblings, 0 replies; only message in thread
From: Adam Williamson @ 2026-07-29 20:37 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/openqa
Branch : f44
Commit : aaa59f615748645c2203dbd3e79e1e844d4754e6
Author : Adam Williamson <awilliam@redhat.com>
Date   : 2026-07-29T13:37:13-07:00
Stats  : +67/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/openqa/c/aaa59f615748645c2203dbd3e79e1e844d4754e6?branch=f44

Log:
Backport PR #7688 to add forge.fp.o bugurl/bugref support

---
diff --git a/0001-fix-Add-forge.fedoraproject.org-to-the-bugurl-bugref.patch b/0001-fix-Add-forge.fedoraproject.org-to-the-bugurl-bugref.patch
new file mode 100644
index 0000000..0b0c78f
--- /dev/null
+++ b/0001-fix-Add-forge.fedoraproject.org-to-the-bugurl-bugref.patch
@@ -0,0 +1,64 @@
+From d940a1a5152c49b8ad90585c41eec53e6922b8ea Mon Sep 17 00:00:00 2001
+From: Adam Williamson <awilliam@redhat.com>
+Date: Wed, 29 Jul 2026 11:40:17 -0700
+Subject: [PATCH] fix: Add forge.fedoraproject.org to the bugurl/bugref complex
+
+This is Fedora's new forge (replacing pagure.io). It follows
+github behavior for issues/pull requests (they're interchangeable).
+The URL for pull requests is `pulls/`, not `pull/`, so we need to
+handle this in the regex.
+
+Signed-off-by: Adam Williamson <awilliam@redhat.com>
+---
+ lib/OpenQA/Utils.pm | 4 +++-
+ t/16-utils.t        | 5 +++++
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/lib/OpenQA/Utils.pm b/lib/OpenQA/Utils.pm
+index 52d246a01..988771dc8 100644
+--- a/lib/OpenQA/Utils.pm
++++ b/lib/OpenQA/Utils.pm
+@@ -55,6 +55,7 @@ BEGIN {
+         pio => 'https://pagure.io/',
+         ggo => 'https://gitlab.gnome.org/',
+         gfs => 'https://gitlab.com/fedora/sigs/',
++        ffo => 'https://forge.fedoraproject.org/',
+     );
+     %BUGURLS = (
+         'https://bugzilla.novell.com/show_bug.cgi?id=' => 'bsc',
+@@ -73,6 +74,7 @@ BEGIN {
+         $BUGREFS{pio} => 'pio',
+         $BUGREFS{ggo} => 'ggo',
+         $BUGREFS{gfs} => 'gfs',
++        $BUGREFS{ffo} => 'ffo',
+     );
+ 
+     $MARKER_REFS = join '|', keys %BUGREFS;
+@@ -473,7 +475,7 @@ sub href_to_bugref ($text) {
+     # 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|work_items)/)?(?<id>([A-Z]+-)?\d+)(?![\w])};
++      = qr{(?<!["\(\[])(?<url_root>$regex)((?<repo>.*?)/(-/)?(issues?|pulls?|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 6bac52886..e9e938575 100644
+--- a/t/16-utils.t
++++ b/t/16-utils.t
+@@ -144,6 +144,11 @@ is href_to_bugref('https://gitlab.com/fedora/sigs/flatpak/fedora-flatpaks/-/issu
+   '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 bugurl('ffo#foo/bar#1234'), 'https://forge.fedoraproject.org/foo/bar/issues/1234', 'forge.fp.o bugurl';
++is href_to_bugref('https://forge.fedoraproject.org/foo/bar/issues/1234'), 'ffo#foo/bar#1234',
++  'forge.fp.o url to bugref';
++is href_to_bugref('https://forge.fedoraproject.org/foo/bar/pulls/1235'), 'ffo#foo/bar#1235',
++  'forge.fp.o PR url to bugref';
+ is find_bug_number('yast_roleconf-ntp-servers-empty-bsc1114818-20181115.png'), 'bsc1114818',
+   'find the bug number from the needle name';
+ 
+-- 
+2.55.0
+

diff --git a/openqa.spec b/openqa.spec
index 8962b0f..06c28ab 100644
--- a/openqa.spec
+++ b/openqa.spec
@@ -150,6 +150,9 @@ Patch:          0001-fix-Support-invent.kde.org-and-work_items-in-bug-URL.patch
 # https://github.com/os-autoinst/openQA/pull/7634
 # Drop token equality test that is invalid with Mojolicious 9.48+
 Patch:          0001-fix-test-Drop-test-for-token-equality.patch
+# https://github.com/os-autoinst/openQA/pull/7688
+# Add forge.fp.o support for bugurl/bugref stuff
+Patch:          0001-fix-Add-forge.fedoraproject.org-to-the-bugurl-bugref.patch
 
 BuildRequires: make
 BuildRequires:  %{python_scripts_requires}

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-29 20:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-29 20:37 [rpms/openqa] f44: Backport PR #7688 to add forge.fp.o bugurl/bugref support Adam Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox