Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package openQA for openSUSE:Factory checked in at 2026-01-17 21:42:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/openQA (Old) and /work/SRC/openSUSE:Factory/.openQA.new.1928 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openQA" Sat Jan 17 21:42:49 2026 rev:795 rq:1327811 version:5.1768564451.45d5d5b2 Changes: -------- --- /work/SRC/openSUSE:Factory/openQA/openQA.changes 2026-01-17 14:53:12.387312972 +0100 +++ /work/SRC/openSUSE:Factory/.openQA.new.1928/openQA.changes 2026-01-17 21:44:02.129081418 +0100 @@ -1,0 +2,9 @@ +Sat Jan 17 14:09:38 UTC 2026 - [email protected] + +- Update to version 5.1768564451.45d5d5b2: + * OpenSuseIssueReporter: Avoid multiple push calls + * unit_tests: Add unit tests for OpenSuseBugzillaUtils + * unit_tests: Adapt the UI tests to the new kernel bug button + * plugins: Introduce OpenSuseIssueReporter for external issue reporting + +------------------------------------------------------------------- Old: ---- openQA-5.1768402729.462b3957.obscpio New: ---- openQA-5.1768564451.45d5d5b2.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openQA-client-test.spec ++++++ --- /var/tmp/diff_new_pack.AeVtkr/_old 2026-01-17 21:44:04.141163840 +0100 +++ /var/tmp/diff_new_pack.AeVtkr/_new 2026-01-17 21:44:04.157164495 +0100 @@ -18,7 +18,7 @@ %define short_name openQA-client Name: %{short_name}-test -Version: 5.1768402729.462b3957 +Version: 5.1768564451.45d5d5b2 Release: 0 Summary: Test package for %{short_name} License: GPL-2.0-or-later ++++++ openQA-devel-test.spec ++++++ --- /var/tmp/diff_new_pack.AeVtkr/_old 2026-01-17 21:44:04.257168592 +0100 +++ /var/tmp/diff_new_pack.AeVtkr/_new 2026-01-17 21:44:04.261168755 +0100 @@ -18,7 +18,7 @@ %define short_name openQA-devel Name: %{short_name}-test -Version: 5.1768402729.462b3957 +Version: 5.1768564451.45d5d5b2 Release: 0 Summary: Test package for %{short_name} License: GPL-2.0-or-later ++++++ openQA-test.spec ++++++ --- /var/tmp/diff_new_pack.AeVtkr/_old 2026-01-17 21:44:04.373173344 +0100 +++ /var/tmp/diff_new_pack.AeVtkr/_new 2026-01-17 21:44:04.389173999 +0100 @@ -18,7 +18,7 @@ %define short_name openQA Name: %{short_name}-test -Version: 5.1768402729.462b3957 +Version: 5.1768564451.45d5d5b2 Release: 0 Summary: Test package for openQA License: GPL-2.0-or-later ++++++ openQA-worker-test.spec ++++++ --- /var/tmp/diff_new_pack.AeVtkr/_old 2026-01-17 21:44:04.433175802 +0100 +++ /var/tmp/diff_new_pack.AeVtkr/_new 2026-01-17 21:44:04.433175802 +0100 @@ -18,7 +18,7 @@ %define short_name openQA-worker Name: %{short_name}-test -Version: 5.1768402729.462b3957 +Version: 5.1768564451.45d5d5b2 Release: 0 Summary: Test package for %{short_name} License: GPL-2.0-or-later ++++++ openQA.spec ++++++ --- /var/tmp/diff_new_pack.AeVtkr/_old 2026-01-17 21:44:04.545180390 +0100 +++ /var/tmp/diff_new_pack.AeVtkr/_new 2026-01-17 21:44:04.545180390 +0100 @@ -99,7 +99,7 @@ %define devel_requires %devel_no_selenium_requires chromedriver Name: openQA -Version: 5.1768402729.462b3957 +Version: 5.1768564451.45d5d5b2 Release: 0 Summary: The openQA web-frontend, scheduler and tools License: GPL-2.0-or-later ++++++ openQA-5.1768402729.462b3957.obscpio -> openQA-5.1768564451.45d5d5b2.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openQA-5.1768402729.462b3957/lib/OpenQA/WebAPI/Plugin/IssueReporter/Context.pm new/openQA-5.1768564451.45d5d5b2/lib/OpenQA/WebAPI/Plugin/IssueReporter/Context.pm --- old/openQA-5.1768402729.462b3957/lib/OpenQA/WebAPI/Plugin/IssueReporter/Context.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/openQA-5.1768564451.45d5d5b2/lib/OpenQA/WebAPI/Plugin/IssueReporter/Context.pm 2026-01-16 12:54:11.000000000 +0100 @@ -0,0 +1,51 @@ +# Copyright SUSE LLC +# SPDX-License-Identifier: GPL-2.0-or-later + +package OpenQA::WebAPI::Plugin::IssueReporter::Context; +use Mojo::Base -strict, -signatures; +use Exporter qw(import); + +our @EXPORT_OK = qw(get_context get_regression_links); + +sub get_context ($c) { + my $job = $c->stash('job') or return undef; + my $module = $c->stash('moduleid') // ''; + my $step = $c->stash('stepid'); + my $step_url + = $step + ? $c->url_for('step', moduleid => $module, stepid => $step)->to_abs + : $c->url_for('step')->to_abs; + + return { + job => $job, + job_id => $job->id, + build => $job->BUILD, + distri => ($job->DISTRI // ''), + version => ($job->VERSION // ''), + flavor => ($job->FLAVOR // ''), + module => $module, + step_url => "$step_url", + }; +} + +# this takes the logic from the external_reporting.html.ep +sub get_regression_links ($c, $job) { + my $build_link = sub ($j) { + my $turl = $c->url_for('test', testid => $j->id)->to_abs; + return '[' . $j->BUILD . "]($turl)"; + }; + + my $first_known_bad = $build_link->($job) . ' (current job)'; + my $last_good = '(unknown)'; + + for my $prev ($job->_previous_scenario_jobs) { + if (($prev->result // '') =~ /(passed|softfailed)/) { + $last_good = $build_link->($prev); + last; + } + $first_known_bad = $build_link->($prev); + } + return ($first_known_bad, $last_good); +} + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openQA-5.1768402729.462b3957/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseBugzillaUtils.pm new/openQA-5.1768564451.45d5d5b2/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseBugzillaUtils.pm --- old/openQA-5.1768402729.462b3957/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseBugzillaUtils.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/openQA-5.1768564451.45d5d5b2/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseBugzillaUtils.pm 2026-01-16 12:54:11.000000000 +0100 @@ -0,0 +1,111 @@ +# Copyright SUSE LLC +# SPDX-License-Identifier: GPL-2.0-or-later + +package OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseBugzillaUtils; +use Mojo::Base -strict, -signatures; +use Exporter qw(import); + +our @EXPORT_OK = qw(get_bugzilla_url get_bugzilla_distri_name get_bugzilla_product_name); + +# below constants are taken directly from the external_reporting.html.ep +# ideally this should be in a config file to make openQA product/brand-agnostic +use constant DISTRI_TO_PRODUCT_URL => { + sle => 'https://bugzilla.suse.com/enter_bug.cgi', + 'sle-micro' => 'https://bugzilla.suse.com/enter_bug.cgi', + opensuse => 'https://bugzilla.opensuse.org/enter_bug.cgi', + caasp => 'https://bugzilla.suse.com/enter_bug.cgi', + openqa => 'https://progress.opensuse.org/projects/openqav3/issues/new', + kubic => 'https://bugzilla.opensuse.org/enter_bug.cgi', + microos => 'https://bugzilla.opensuse.org/enter_bug.cgi', + alp => 'https://bugzilla.suse.com/enter_bug.cgi', +}; + +use constant DISTRI_TO_PROD => { + sle => 'SUSE Linux Enterprise', + 'sle-micro' => 'SUSE Linux', + opensuse => 'openSUSE', + caasp => 'SUSE CaaS Platform', + kubic => 'openSUSE', + microos => 'openSUSE', + alp => 'ALP', +}; + +use constant FLAVOR_TO_PROD_SLE => { + Server => 'Server', + 'Server-Incidents' => 'Server', + 'Server-Updates' => 'Server', + 'Server-HA' => 'High Availability Extension', + 'Server-RT' => 'Real Time Extension', + Desktop => 'Desktop', + 'Desktop-Incidents' => 'Desktop', + 'Desktop-Updates' => 'Desktop', + SAP => 'for SAP Applications', + Leanos => 'Server', + Installer => 'Server', +}; + +use constant PUBLIC_SLE_PRODUCTS => { + Server => 'Server', + Desktop => 'Desktop', + 'High Availability Extension' => 'High Availability', # the public version leaves out the "Extension" suffix +}; + +sub get_bugzilla_url ($raw_distri) { + return DISTRI_TO_PRODUCT_URL->{$raw_distri} // DISTRI_TO_PRODUCT_URL->{sle}; +} + +sub get_bugzilla_distri_name ($raw_distri) { + return DISTRI_TO_PROD->{$raw_distri} // 'UNKNOWN DISTRI'; +} + +# taken from the external_reporting.html.ep +# likely this could be improved +sub get_bugzilla_product_name ($job, $raw_distri, $distri_ref) { + return _sle_product($job, $distri_ref) if $raw_distri eq 'sle'; + return _sle_micro_product($job) if $raw_distri eq 'sle-micro'; + return _opensuse_product($job) if $raw_distri eq 'opensuse' || $raw_distri eq 'microos'; + return _caasp_product($job) if $raw_distri eq 'caasp'; + return 'openQA' if $raw_distri eq 'openqa'; + return ''; +} + +sub _sle_product ($job, $distri_ref) { + my $subproduct = $job->FLAVOR // ''; + $subproduct =~ s/(\w*)(-\w*)?/$1/; + + return '' unless $subproduct; + + my $version = $job->VERSION // ''; + $version =~ s/-/ /g; + + $version = '12 (SLES 12)' if $subproduct eq 'Server' && $version eq '12'; + + my $sle_product = FLAVOR_TO_PROD_SLE->{$subproduct} // 'Server'; + + if (my $public = PUBLIC_SLE_PRODUCTS->{$sle_product}) { + if ($version =~ /(\d+)\s+SP(\d+)/ && $1 == 15 && $2 >= 3) { + $$distri_ref = "PUBLIC $$distri_ref"; + $sle_product = $public; + } + } + return "$sle_product $version"; +} + +sub _sle_micro_product ($job) { + my $version = $job->VERSION // ''; + my $product = "Micro $version"; + return ($version eq '6.1' || $version eq '6.2') ? $product : "Enterprise $product"; +} + +sub _opensuse_product ($job) { + return ($job->VERSION // '') eq 'Tumbleweed' + ? 'Tumbleweed' + : 'Distribution'; +} + +sub _caasp_product ($job) { + (my $version = $job->VERSION // '') =~ s/\.[0-9]//; + return $version; +} + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openQA-5.1768402729.462b3957/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseGenericBug.pm new/openQA-5.1768564451.45d5d5b2/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseGenericBug.pm --- old/openQA-5.1768402729.462b3957/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseGenericBug.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/openQA-5.1768564451.45d5d5b2/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseGenericBug.pm 2026-01-16 12:54:11.000000000 +0100 @@ -0,0 +1,83 @@ +# Copyright SUSE LLC +# SPDX-License-Identifier: GPL-2.0-or-later + +package OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseGenericBug; +use Mojo::Base -strict, -signatures; +use Mojo::Template; +use Mojo::Loader qw(data_section); +use Mojo::URL; +use OpenQA::WebAPI::Plugin::IssueReporter::Context qw(get_context get_regression_links); +use OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseBugzillaUtils + qw(get_bugzilla_url get_bugzilla_distri_name get_bugzilla_product_name); + +sub actions ($c) { + my $ctx = get_context($c) or return []; + my $job = $ctx->{job}; + my $raw_distri = $job->DISTRI // ''; + my $distri_name = get_bugzilla_distri_name($raw_distri); + my $bugzilla_product = get_bugzilla_product_name($job, $raw_distri, \$distri_name); + my $bugzilla_url = get_bugzilla_url($raw_distri); + my $scenario = $job->scenario_name // ''; + my $scenario_description = $job->scenario_description // ''; + my ($first_known_bad, $last_good) = get_regression_links($c, $job); + my $latest = $c->url_for('latest')->query($job->scenario_hash)->to_abs; + + my $body = _render( + 'generic_bug.txt.ep', + { + scenario => $scenario, + scenario_description => $scenario_description, + module => $ctx->{module}, + step_url => $ctx->{step_url}, + first_known_bad => $first_known_bad, + last_good => $last_good, + latest => "$latest", + }); + + my $url = Mojo::URL->new($bugzilla_url)->query( + { + short_desc => "[Build $ctx->{build}] openQA test fails in $ctx->{module}", + comment => $body, + product => "$distri_name $bugzilla_product", + bug_file_loc => $ctx->{step_url}, + cf_foundby => 'openQA', + cf_blocker => 'Yes', + }); + + return [ + { + id => 'generic_bugzilla', + label => 'Report product bug', + icon => 'fa-bug', + url => "$url", + }]; +} + +sub _render ($name, $vars) { + my $tmpl = data_section(__PACKAGE__, $name); + return Mojo::Template->new(vars => 1)->render($tmpl, $vars); +} + +1; + +__DATA__ +@@ generic_bug.txt.ep +## Observation + +openQA test in scenario <%= $scenario %> fails in +[<%= $module %>](<%= $step_url %>) + +## Test suite description +<%= $scenario_description %> + +## Reproducible + +Fails since (at least) Build <%= $first_known_bad %> + +## Expected result + +Last good: <%= $last_good %> (or more recent) + +## Further details + +Always latest result in this scenario: [latest](<%= $latest %>) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openQA-5.1768402729.462b3957/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseIssueReporter.pm new/openQA-5.1768564451.45d5d5b2/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseIssueReporter.pm --- old/openQA-5.1768402729.462b3957/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseIssueReporter.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/openQA-5.1768564451.45d5d5b2/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseIssueReporter.pm 2026-01-16 12:54:11.000000000 +0100 @@ -0,0 +1,22 @@ +# Copyright SUSE LLC +# SPDX-License-Identifier: GPL-2.0-or-later + +package OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseIssueReporter; +use Mojo::Base 'Mojolicious::Plugin', -signatures; + +use OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseKernelBug; +use OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseGenericBug; +use OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseProgressIssue; + +sub register ($self, $app, $config) { + $app->helper( + report_external_issue => sub ($c) { + return [ + @{OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseGenericBug::actions($c)}, + @{OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseKernelBug::actions($c)}, + @{OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseProgressIssue::actions($c)}, + ]; + }); +} + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openQA-5.1768402729.462b3957/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseKernelBug.pm new/openQA-5.1768564451.45d5d5b2/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseKernelBug.pm --- old/openQA-5.1768402729.462b3957/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseKernelBug.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/openQA-5.1768564451.45d5d5b2/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseKernelBug.pm 2026-01-16 12:54:11.000000000 +0100 @@ -0,0 +1,62 @@ +# Copyright SUSE LLC +# SPDX-License-Identifier: GPL-2.0-or-later + +package OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseKernelBug; +use Mojo::Base -strict, -signatures; +use Mojo::Template; +use Mojo::Loader qw(data_section); +use Mojo::URL; +use OpenQA::WebAPI::Plugin::IssueReporter::Context qw(get_context); +use OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseBugzillaUtils + qw(get_bugzilla_url get_bugzilla_distri_name get_bugzilla_product_name); + +sub actions ($c) { + my $ctx = get_context($c) or return []; + my $job = $ctx->{job}; + my $raw_distri = $job->DISTRI // ''; + my $bugzilla_distri = get_bugzilla_distri_name($raw_distri); + my $bugzilla_product = get_bugzilla_product_name($job, $raw_distri, \$bugzilla_distri); + my $bugzilla_url = get_bugzilla_url($raw_distri); + + # main part of the kernel bug report + my $kernel_bug = _render( + 'kernel_bug.txt.ep', + { + build => $ctx->{build}, + distri => $raw_distri, + version => $ctx->{version}, + }); + + my $url = Mojo::URL->new($bugzilla_url)->query( + { + short_desc => "[Build $ctx->{build}] Kernel test fails in $ctx->{module}", + comment => $kernel_bug, + product => "$bugzilla_distri $bugzilla_product", + }); + + return [ + { + id => 'kernel_bugzilla', + label => 'Report kernel product bug', + icon => 'fa-microchip', + url => "$url", + }]; +} + +sub _render ($name, $vars) { + my $tmpl = data_section(__PACKAGE__, $name); + return Mojo::Template->new(vars => 1)->render($tmpl, $vars); +} + +1; + +__DATA__ +@@ kernel_bug.txt.ep + +== EDIT == +IMPORTANT: For kernel bugs please provide detailed kernel information (`uname -a`, rpm -qi kernel-default, ...) + +Build details: +Build: <%= $build %> +Distri: <%= $distri %> +Version: <%= $version %> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openQA-5.1768402729.462b3957/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseProgressIssue.pm new/openQA-5.1768564451.45d5d5b2/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseProgressIssue.pm --- old/openQA-5.1768402729.462b3957/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseProgressIssue.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/openQA-5.1768564451.45d5d5b2/lib/OpenQA/WebAPI/Plugin/IssueReporter/OpenSuseProgressIssue.pm 2026-01-16 12:54:11.000000000 +0100 @@ -0,0 +1,81 @@ +# Copyright SUSE LLC +# SPDX-License-Identifier: GPL-2.0-or-later + +package OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseProgressIssue; +use Mojo::Base -strict, -signatures; +use Mojo::Template; +use Mojo::Loader qw(data_section); +use Mojo::URL; +use OpenQA::WebAPI::Plugin::IssueReporter::Context qw(get_context get_regression_links); + +# below constants are taken directly from the external_reporting.html.ep +# kept here as such since this single issue tracker is used with single category_id +use constant PROGRESS_URL => 'https://progress.opensuse.org/projects/openqatests/issues/new'; +use constant DEFAULT_CATEGORY_ID => 152; + +sub actions ($c) { + my $ctx = get_context($c) or return []; + + my $job = $ctx->{job}; + my $scenario = $job->scenario_name // ''; + my $scenario_description = $job->scenario_description // ''; + my ($first_known_bad, $last_good) = get_regression_links($c, $job); + my $latest = $c->url_for('latest')->query($job->scenario_hash)->to_abs; + + my $subject = "test fails in $ctx->{module}"; + my $body = _render( + 'progress_issue.txt.ep', + { + scenario => $scenario, + module => $ctx->{module}, + step_url => $ctx->{step_url}, + scenario_description => $scenario_description, + first_known_bad => $first_known_bad, + last_good => $last_good, + latest => "$latest", + }); + + my $url = Mojo::URL->new(PROGRESS_URL)->query( + { + 'issue[subject]' => $subject, + 'issue[description]' => $body, + 'issue[category_id]' => DEFAULT_CATEGORY_ID, + }); + + return [ + { + id => 'progress_issue', + label => 'Report test issue', + icon => 'fa-bolt', + url => "$url", + }]; +} + +sub _render ($name, $vars) { + my $tmpl = data_section(__PACKAGE__, $name); + return Mojo::Template->new(vars => 1)->render($tmpl, $vars); +} + +1; + +__DATA__ +@@ progress_issue.txt.ep +## Observation + +openQA test in scenario <%= $scenario %> fails in +[<%= $module %>](<%= $step_url %>) + +## Test suite description +<%= $scenario_description %> + +## Reproducible + +Fails since (at least) Build <%= $first_known_bad %> + +## Expected result + +Last good: <%= $last_good %> (or more recent) + +## Further details + +Always latest result in this scenario: [latest](<%= $latest %>) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openQA-5.1768402729.462b3957/t/ui/18-tests-details.t new/openQA-5.1768564451.45d5d5b2/t/ui/18-tests-details.t --- old/openQA-5.1768402729.462b3957/t/ui/18-tests-details.t 2026-01-14 15:58:49.000000000 +0100 +++ new/openQA-5.1768564451.45d5d5b2/t/ui/18-tests-details.t 2026-01-16 12:54:11.000000000 +0100 @@ -225,14 +225,23 @@ : $driver->find_elements('#preview_container_in .report'); my @title = map { $_->get_attribute('title') } @report_links; is($title[0], 'Report product bug', 'product bug report URL available'); - is($title[1], 'Report test issue', 'test issue report URL available'); + is($title[1], 'Report kernel product bug', 'product bug report URL available'); + is($title[2], 'Report test issue', 'test issue report URL available'); my @url = map { $_->get_attribute('href') } @report_links; like($url[0], qr{bugzilla.*enter_bug.*tests%2F99937}, 'bugzilla link referencing current test'); like($url[0], qr{in\+scenario\+opensuse-13\.1-DVD-i586-kde}, 'bugzilla link contains scenario'); - like($url[1], qr{progress.*new}, 'progress/redmine link for reporting test issues'); - like($url[1], qr{in\+scenario\+opensuse-13\.1-DVD-i586-kde}, 'progress/redmine link contains scenario'); + like($url[1], qr{bugzilla.*enter_bug}, 'kernel product bug uses bugzilla enter_bug'); + like($url[1], qr{(?:\?|&)product=openSUSE\+Distribution(?:&|$)}, 'kernel product bug sets product'); like( $url[1], + qr{(?:\?|&)short_desc=%5BBuild\+0091%5D\+Kernel\+test\+fails\+in\+bootloader}, + 'kernel short_desc correct' + ); + like($url[1], qr{(?:\?|&)comment=}, 'kernel product bug has comment template'); + like($url[2], qr{progress.*new}, 'progress/redmine link for reporting test issues'); + like($url[2], qr{in\+scenario\+opensuse-13\.1-DVD-i586-kde}, 'progress/redmine link contains scenario'); + like( + $url[2], qr{in.*$failed_module.*$failed_module%2Fsteps%2F$failed_step}, 'progress/redmine link refers to right module/step' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openQA-5.1768402729.462b3957/t/ui/30-issue-reporter-plugin.t new/openQA-5.1768564451.45d5d5b2/t/ui/30-issue-reporter-plugin.t --- old/openQA-5.1768402729.462b3957/t/ui/30-issue-reporter-plugin.t 1970-01-01 01:00:00.000000000 +0100 +++ new/openQA-5.1768564451.45d5d5b2/t/ui/30-issue-reporter-plugin.t 2026-01-16 12:54:11.000000000 +0100 @@ -0,0 +1,73 @@ +# Copyright SUSE LLC +# SPDX-License-Identifier: GPL-2.0-or-later + +use FindBin; +use Test::Most; +use Test::Warnings ':report_warnings'; +use lib "$FindBin::Bin/../lib", "$FindBin::Bin/../../external/os-autoinst-common/lib"; + +use OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseBugzillaUtils qw( + get_bugzilla_url get_bugzilla_distri_name get_bugzilla_product_name +); + +{ + + package Test::FakeJob; + use Mojo::Base -base; + has FLAVOR => undef; + has VERSION => undef; +} + +subtest 'get_bugzilla_url' => sub { + is get_bugzilla_url('sle'), 'https://bugzilla.suse.com/enter_bug.cgi', 'SLE uses bugzilla.suse.com'; + is get_bugzilla_url('opensuse'), 'https://bugzilla.opensuse.org/enter_bug.cgi', + 'openSUSE uses bugzilla.opensuse.org'; + is get_bugzilla_url('openqa'), 'https://progress.opensuse.org/projects/openqav3/issues/new', + 'Use progress for openqa button'; + is get_bugzilla_url('unknown'), 'https://bugzilla.suse.com/enter_bug.cgi', 'unknown: default (sle)'; +}; + +subtest 'get_bugzilla_distri_name' => sub { + is get_bugzilla_distri_name('sle'), 'SUSE Linux Enterprise', 'distri: sle->SUSE Linux Enterprise'; + is get_bugzilla_distri_name('opensuse'), 'openSUSE', 'distri: opensuse->openSUSE'; + is get_bugzilla_distri_name('alp'), 'ALP', 'distri: alp->ALP'; + is get_bugzilla_distri_name('test-unknown'), 'UNKNOWN DISTRI', 'distri: unknown->UNKNOWN DISTRI'; +}; + +subtest 'get_bugzilla_product_name' => sub { + my $distri = 'SUSE Linux Enterprise'; + + is get_bugzilla_product_name(Test::FakeJob->new(VERSION => '15 SP3'), 'sle', \$distri), '', 'sle empty FLAVOR'; + is $distri, 'SUSE Linux Enterprise', 'sle distri_ref unchanged'; + + $distri = 'SUSE Linux Enterprise'; + is get_bugzilla_product_name(Test::FakeJob->new(FLAVOR => 'Server', VERSION => '12'), 'sle', \$distri), + 'Server 12 (SLES 12)', 'sle Server 12 special-case'; + is $distri, 'SUSE Linux Enterprise', 'no PUBLIC rewrite for 12'; + + $distri = 'SUSE Linux Enterprise'; + is get_bugzilla_product_name(Test::FakeJob->new(FLAVOR => 'Server', VERSION => '15 SP3'), 'sle', \$distri), + 'Server 15 SP3', 'sle public product name for 15 SP3+'; + is $distri, 'PUBLIC SUSE Linux Enterprise', 'distri_ref gets PUBLIC prefix'; + + $distri = 'SUSE Linux Enterprise'; + is get_bugzilla_product_name(Test::FakeJob->new(FLAVOR => 'Server-Updates', VERSION => '15-SP3'), 'sle', \$distri), + 'Server 15 SP3', 'sle flavor suffix stripped and version "-" becomes space'; + is $distri, 'PUBLIC SUSE Linux Enterprise', 'PUBLIC rewrite still applies'; + + $distri = 'SUSE Linux Enterprise'; + is get_bugzilla_product_name(Test::FakeJob->new(FLAVOR => 'WeirdFlavor', VERSION => '15 SP2'), 'sle', \$distri), + 'Server 15 SP2', 'unknown flavor falls back to Server'; + is $distri, 'SUSE Linux Enterprise', 'no PUBLIC rewrite for SP2'; + + is get_bugzilla_product_name(Test::FakeJob->new(VERSION => '6.1'), 'sle-micro', undef), 'Micro 6.1', 'sle-micro'; + is get_bugzilla_product_name(Test::FakeJob->new(VERSION => 'Tumbleweed'), 'opensuse', undef), 'Tumbleweed', + 'opensuse TW'; + is get_bugzilla_product_name(Test::FakeJob->new(VERSION => 'Leap'), 'opensuse', undef), 'Distribution', + 'opensuse non-TW'; + is get_bugzilla_product_name(Test::FakeJob->new(VERSION => '4.5'), 'caasp', undef), '4', 'caasp'; + is get_bugzilla_product_name(Test::FakeJob->new(), 'openqa', undef), 'openQA', 'openqa'; + is get_bugzilla_product_name(Test::FakeJob->new(), 'test-unknown', undef), '', 'unknown'; +}; + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openQA-5.1768402729.462b3957/templates/webapi/branding/openSUSE/external_reporting.html.ep new/openQA-5.1768564451.45d5d5b2/templates/webapi/branding/openSUSE/external_reporting.html.ep --- old/openQA-5.1768402729.462b3957/templates/webapi/branding/openSUSE/external_reporting.html.ep 2026-01-14 15:58:49.000000000 +0100 +++ new/openQA-5.1768564451.45d5d5b2/templates/webapi/branding/openSUSE/external_reporting.html.ep 2026-01-16 12:54:11.000000000 +0100 @@ -1,158 +1,4 @@ -% my $build = $job->BUILD; -% my $step_url = url_for('step')->to_abs; -% my $module = stash('moduleid'); -% my $step = stash('stepid'); -% if ($step) { -% $step_url = url_for('step', moduleid => $module, stepid => $step)->to_abs; -% } -% my %product_details = (); -% my $scenario_description = $job->scenario_description // ''; - -<% my %distri_to_product_url_new = ( - sle => 'https://bugzilla.suse.com/enter_bug.cgi', - 'sle-micro' => 'https://bugzilla.suse.com/enter_bug.cgi', - opensuse => 'https://bugzilla.opensuse.org/enter_bug.cgi', - caasp => 'https://bugzilla.suse.com/enter_bug.cgi', - openqa => 'https://progress.opensuse.org/projects/openqav3/issues/new', - kubic => 'https://bugzilla.opensuse.org/enter_bug.cgi', - microos => 'https://bugzilla.opensuse.org/enter_bug.cgi', - alp => 'https://bugzilla.suse.com/enter_bug.cgi', -);%> -<% my %distri_to_prod = ( - sle => 'SUSE Linux Enterprise', - 'sle-micro' => 'SUSE Linux', - opensuse => 'openSUSE', - caasp => 'SUSE CaaS Platform', - kubic => 'openSUSE', - microos => 'openSUSE', - alp => 'ALP', -); %> -<% my %flavor_to_prod_sle = ( - Server => 'Server', - 'Server-Incidents' => 'Server', - 'Server-Updates' => 'Server', - 'Server-HA' => 'High Availability Extension', - 'Server-RT' => 'Real Time Extension', - Desktop => 'Desktop', - 'Desktop-Incidents' => 'Desktop', - 'Desktop-Updates' => 'Desktop', - SAP => 'for SAP Applications', - Leanos => 'Server', - Installer => 'Server', -); %> -<% my %public_sle_products = ( - Server => 'Server', - Desktop => 'Desktop', - 'High Availability Extension' => 'High Availability', # the public version leaves out the "Extension" suffix -); %> -% my $raw_distri = $job->DISTRI; -% my $distri = $distri_to_prod{$raw_distri} // 'DISTRI NOT FOUND: Adjust templates/openSUSE/external_reporting.html.ep'; -% my $product = ''; -% if ($raw_distri eq 'sle') { -% my $subproduct = $job->FLAVOR =~ s/(\w*)(-\w*)?/$1/r; -% if ($subproduct) { -% my $version = $job->VERSION =~ s/-/ /r; -% if ($subproduct eq 'Server' && $version eq '12') { -% $version = '12 (SLES 12)'; -% } -% if ($subproduct eq 'Desktop-Updates' && $version eq '12 SP1') { -% $version = "12 SP1\x{00A0}(SLED 12 SP1)"; -% } -% # fall back to 'Server' as the most common flavor -% my $sle_product = $flavor_to_prod_sle{$subproduct} // 'Server'; -% my $public_sle_product = $public_sle_products{$sle_product}; -% if ($public_sle_product && ($version =~ qr/(\d+) SP(\d+)/)) { -% # only 15-SP3 has a specific "public" bug reporting section in -% # bugzilla, 15-SP4 again does not -% # Apparently a new PUBLIC project was created *after* the -% # initial internal only product so we should still go with -% # PUBLIC as long as that exists. Hard to maintain. -% if ($1 == 15 && $2 >= 3) { -% $distri = "PUBLIC $distri" ; -% $sle_product = $public_sle_product; -% } -% } -% $product = "$sle_product $version"; -% } -% } -% elsif ($raw_distri eq 'sle-micro') { -% # "Enterprise" is removed in 6.1 and 6.2 -% my $version = $job->VERSION; -% $product = 'Micro ' . $version; -% $product = 'Enterprise ' . $product unless $version eq '6.1' || $version eq '6.2'; -% } -% elsif ($raw_distri eq 'opensuse' || $raw_distri eq 'microos') { -% $product = $job->VERSION eq 'Tumbleweed' ? 'Tumbleweed' : 'Distribution'; -% } -% elsif ($raw_distri eq 'caasp') { -% $product = $job->VERSION =~ s/\.[0-9]//r; -% } -% elsif ($raw_distri eq 'openqa') { -% $product = 'openQA'; -% } - -% sub build_link { -% my ($job) = @_; -% return '[' . $job->BUILD . '](' . url_for('test', testid => $job->id)->to_abs . ')'; -% } -% my $scenario = $job->scenario_name; -% my $first_known_bad = build_link($job) . ' (current job)'; -% my $last_good = '(unknown)'; -% for my $prev ($job->_previous_scenario_jobs) { -% if ($prev->result =~ '(passed|softfailed)') { -% $last_good = build_link($prev); -% last; -% } -% $first_known_bad = build_link($prev); -% } -% my $latest = url_for('latest')->query($job->scenario_hash)->to_abs; -<% my $description = "## Observation - -openQA test in scenario $scenario fails in -[$module]($step_url) - -## Test suite description -$scenario_description - - -## Reproducible - -Fails since (at least) Build $first_known_bad - - -## Expected result - -Last good: $last_good (or more recent) - - -## Further details - -Always latest result in this scenario: [latest]($latest) -"; %> - -% if ($product eq 'openQA') { -% $product_details{'issue[subject]'} = "test fails in $module"; -% $product_details{'issue[description]'} = $description; -% } -% else { -% $product_details{short_desc} = "[Build $build] openQA test fails in $module"; -% $product_details{comment} = $description; -% $product_details{product} = "$distri $product"; -% $product_details{bug_file_loc} = $step_url; -% $product_details{cf_foundby} = 'openQA'; -% $product_details{cf_blocker} = 'Yes'; -% } -% if ($distri eq 'kubic') { -% $product_details{component} = 'Kubic'; -% } -% my $product_url_new = $distri_to_product_url_new{$raw_distri}; -% if ($product) { - %= stepaction_for('Report product bug' => url_for($product_url_new)->query(%product_details), 'fa-bug', 'report product_bug'); -% } -<% my %test_issue_params = ( - 'issue[subject]' => "test fails in $module", - 'issue[description]' => $description, - 'issue[category_id]' => 152, -); %> -% my $test_url_new = 'https://progress.opensuse.org/projects/openqatests/issues/new'; -%= stepaction_for('Report test issue' => url_for($test_url_new)->query(%test_issue_params), 'fa-bolt', 'report test_issue'); +% app->plugin('OpenQA::WebAPI::Plugin::IssueReporter::OpenSuseIssueReporter'); +% for my $a (@{$c->report_external_issue}) { + %= stepaction_for($a->{label} => $a->{url}, $a->{icon}, "report $a->{id}"); +% } \ No newline at end of file ++++++ openQA.obsinfo ++++++ --- /var/tmp/diff_new_pack.AeVtkr/_old 2026-01-17 21:44:17.473709985 +0100 +++ /var/tmp/diff_new_pack.AeVtkr/_new 2026-01-17 21:44:17.489710641 +0100 @@ -1,5 +1,5 @@ name: openQA -version: 5.1768402729.462b3957 -mtime: 1768402729 -commit: 462b395724ddcfb8c648799d3d4e3b10dfea2835 +version: 5.1768564451.45d5d5b2 +mtime: 1768564451 +commit: 45d5d5b2e6506206866f823b651020f2a82a32ce
