action #178771
Updated by tinita 2 months ago
## Motivation The code for bugrefs can be improved. The urls are currently hardcoded. https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/Utils.pm#L41-L73 There is code that handles some exceptions for certain bugtrackers: https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/Utils.pm#L459-L460 ``` my $issuetext = $+{marker} eq 'pio' ? 'issue' : 'issues'; return $BUGREFS{$+{marker}} . ($+{repo} ? "$+{repo}/$issuetext/" : '') . $+{id}; ``` There is a regex that tries to make it work for all bugtrackers but this is hard to understand by now: https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/Utils.pm#L477 ``` $regex = qr{(?<!["\(\[])(?<url_root>$regex)((?<repo>.*?)/(-/)?(issues?|pull)/)?(?<id>([A-Z]+-)?\d+)(?![\w])}; ``` We have extra code for matching `recognized_referers` that needs to be improved to only match links to issues: #176826 issues. We should not invent a second list or mapping, if we are basically talking about the same urls. The configured bugtrackers are usually the same urls that you would want for referer matching. A configuration section would probably be a bit more verbose, but easier to understand and maintain, and we don't need to add all possible bugtrackers just because other openQA instances are using them. This would block or replace #176826