Project

General

Profile

Actions

action #178771

open

coordination #154768: [saga][epic][ux] State-of-art user experience for openQA

coordination #154771: [epic] Improved test developer user experience

[beginner][easy] Support for custom bugrefs (e.g. with configurable sections)

Added by tinita about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Feature requests
Target version:
Start date:
2025-03-12
Due date:
% Done:

0%

Estimated time:

Description

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

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

Benefit for users: They can add additional bugtrackers themselves and don't have to patch the source.
If it's a known kind, e.g. gitea, gitlab, redmine, jira it's very easy to do.
If it's a new kind that would require to update our horrible regex it is probably also easier to use the new format.

Benefit for us: cleaner code. I wouldn't be proud of the current code. And also we are users.


Related issues 1 (1 open0 closed)

Copied from openQA Project (public) - action #176826: Automatic label link is "broken" when job link is followed from the issue creation preview size:SBlockedokurz2025-02-09

Actions
Actions

Also available in: Atom PDF