Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package MirrorCache for openSUSE:Factory 
checked in at 2022-06-30 13:18:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/MirrorCache (Old)
 and      /work/SRC/openSUSE:Factory/.MirrorCache.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "MirrorCache"

Thu Jun 30 13:18:31 2022 rev:16 rq:985974 version:1.035

Changes:
--------
--- /work/SRC/openSUSE:Factory/MirrorCache/MirrorCache.changes  2022-06-15 
00:34:11.138692801 +0200
+++ /work/SRC/openSUSE:Factory/.MirrorCache.new.1548/MirrorCache.changes        
2022-06-30 13:18:39.521546715 +0200
@@ -1,0 +2,10 @@
+Thu Jun 23 04:55:11 UTC 2022 - Andrii Nikitin <andrii.niki...@suse.com>
+
+- Update to version 1.035:
+  * Add project checkboxes to mirror report (#280)
+  * Collect report from subsidiaries (#282)
+  * Fix incorrect path in metalink for origin file (#281)
+  * Add config CUSTOM_FOOTER_MESSAGE (#283)
+  * CircleCI: ignore gh-pages branch (#279)
+
+-------------------------------------------------------------------

Old:
----
  MirrorCache-1.034.obscpio

New:
----
  MirrorCache-1.035.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ MirrorCache.spec ++++++
--- /var/tmp/diff_new_pack.GNRhbQ/_old  2022-06-30 13:18:40.145547184 +0200
+++ /var/tmp/diff_new_pack.GNRhbQ/_new  2022-06-30 13:18:40.149547186 +0200
@@ -22,7 +22,7 @@
 %define main_requires %{assetpack_requires} perl(Carp) perl(DBD::Pg) >= 3.7.4 
perl(DBI) >= 1.632 perl(DBIx::Class) >= 0.082801 
perl(DBIx::Class::DynamicDefault) perl(DateTime) perl(Encode) perl(Time::Piece) 
perl(Time::Seconds) perl(Time::ParseDate) perl(DateTime::Format::Pg) 
perl(Exporter) perl(File::Basename) perl(LWP::UserAgent) perl(Mojo::Base) 
perl(Mojo::ByteStream) perl(Mojo::IOLoop) perl(Mojo::JSON) perl(Mojo::Pg) 
perl(Mojo::URL) perl(Mojo::Util) perl(Mojolicious::Commands) 
perl(Mojolicious::Plugin) perl(Mojolicious::Plugin::RenderFile) 
perl(Mojolicious::Static) perl(Net::OpenID::Consumer) perl(POSIX) 
perl(Sort::Versions) perl(URI::Escape) perl(XML::Writer) perl(base) 
perl(constant) perl(diagnostics) perl(strict) perl(warnings) shadow 
rubygem(sass) perl(Net::DNS) perl(LWP::Protocol::https) perl(Digest::SHA)
 %define build_requires %{assetpack_requires} rubygem(sass) tidy sysuser-shadow 
sysuser-tools
 Name:           MirrorCache
-Version:        1.034
+Version:        1.035
 Release:        0
 Summary:        WebApp to redirect and manage mirrors
 License:        GPL-2.0-or-later

++++++ MirrorCache-1.034.obscpio -> MirrorCache-1.035.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MirrorCache-1.034/.circleci/config.yml 
new/MirrorCache-1.035/.circleci/config.yml
--- old/MirrorCache-1.034/.circleci/config.yml  2022-06-07 10:53:05.000000000 
+0200
+++ new/MirrorCache-1.035/.circleci/config.yml  2022-06-23 06:47:51.000000000 
+0200
@@ -36,6 +36,15 @@
     jobs:
       - environ:
           db: postgresql
+          filters:
+            branches:
+              ignore: gh-pages
       - environ:
           db: mariadb
-      - systemd
+          filters:
+            branches:
+              ignore: gh-pages
+      - systemd:
+          filters:
+              branches:
+                ignore: gh-pages
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MirrorCache-1.034/assets/javascripts/reporttable.js 
new/MirrorCache-1.035/assets/javascripts/reporttable.js
--- old/MirrorCache-1.034/assets/javascripts/reporttable.js     2022-06-07 
10:53:05.000000000 +0200
+++ new/MirrorCache-1.035/assets/javascripts/reporttable.js     2022-06-23 
06:47:51.000000000 +0200
@@ -1,17 +1,20 @@
-
 function setupReportTable() {
     // read columns from empty HTML table rendered by the server
     var columns = [];
-    var thElements = $('.reporttable thead th').each(function() {
-        var th = $(this);
-
-        // add column
-        var columnName;
-        columnName = th.text().trim().replace(/ 
/g,"").toLowerCase().replace(/\./g,"");
+    columns.push({ data: 'region', defaultContent: "" });
+    columns.push({ data: 'country', defaultContent: "" });
+    columns.push({ data: 'url', defaultContent: "" });
+    $('#checkboxes label').each(function() {
+        var columnName = $(this).text();
+        if (columnName == 'Blame') {
+            return;
+        }
+        columnName = columnName.trim().replace(/ 
/g,"").toLowerCase().replace(/\./g,"");
         if (columnName.match(/^\d/)) {
             columnName = 'c' + columnName;
         }
-        columns.push({ data: columnName, defaultContent: "" });
+        columns.push({ data: (columnName + 'score'), defaultContent: "" });
+        columns.push({ data: (columnName + 'victim'), defaultContent: "" });
     });
 
     var url = $("#reporttable_api_url").val();
@@ -30,4 +33,59 @@
         },
     });
     dataTable.rowData = [];
+
+
+    $('#checkboxes').on('change', ':checkbox', function () {
+        layoutReportTable();
+    });
+    layoutReportTable();
+}
+
+function layoutReportTable() {
+    var dt = $('.reporttable').DataTable();
+
+    var victim = 1;
+    if (!$('#victimcheckbox').is(":checked")) {
+        victim = 0;
+    }
+    var existchecked = 0;
+    $('#checkboxes label').each(function() {
+        var columnName = $(this).text();
+        if (columnName == 'Blame') {
+            return;
+        }
+        var vis = 1;
+        if ($("[ id='" + columnName + "checkbox' ]").is(":checked")) {
+            existchecked = 1;
+        }
+    });
+
+    var i = 0;
+    var firstColumnHack = 0;      // apparently setting .visible() doesn't 
work for first time,
+    var firstColumnIndex = 3;     // so we remember it here and (re-)set at 
the end again
+    $('#checkboxes label').each(function() {
+        var lbl = $(this);
+        var columnName = lbl.text();
+        if (columnName == 'Blame') {
+            return;
+        }
+        var vis = 1;
+        if (existchecked && !$("[ id='" + columnName + "checkbox' 
]").is(":checked")) {
+            vis = 0;
+        }
+        if (i == 0) {
+            firstColumnHack = vis;
+        }
+        var index = firstColumnIndex + 2*i;
+        if (vis != dt.columns(index).visible()) {
+            dt.columns(index).visible(vis);
+        }
+        if (vis && victim != dt.columns(index + 1).visible()) {
+            dt.columns(index + 1).visible(victim);
+        } else if (!vis && dt.columns(index + 1).visible()) {
+            dt.columns(index + 1).visible(vis);
+        }
+        i = i + 1;
+    });
+    dt.columns(firstColumnIndex).visible(firstColumnHack);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MirrorCache-1.034/lib/MirrorCache/Task/Report.pm 
new/MirrorCache-1.035/lib/MirrorCache/Task/Report.pm
--- old/MirrorCache-1.034/lib/MirrorCache/Task/Report.pm        2022-06-07 
10:53:05.000000000 +0200
+++ new/MirrorCache-1.035/lib/MirrorCache/Task/Report.pm        2022-06-23 
06:47:51.000000000 +0200
@@ -15,6 +15,7 @@
 
 package MirrorCache::Task::Report;
 use Mojo::Base 'Mojolicious::Plugin';
+use Mojo::UserAgent;
 use Mojo::JSON qw(decode_json encode_json);
 
 sub register {
@@ -66,6 +67,24 @@
             }
         }
     }
+
+    my @regions = $app->subsidiary->regions;
+    for my $region (@regions) {
+        next unless $region;
+        next if $app->subsidiary->local($region);
+        my $url = $app->subsidiary->url($region);
+        eval {
+            my $res = Mojo::UserAgent->new->get($url . "/rest/repmirror")->res;
+            if ($res->code < 500 && $res->code > 199) {
+                my $json = $res->json('/report');
+                my @elements = $json->@*;
+                push @report, @elements;
+            } else {
+                print STDERR "Error code accessing {$url}:" . $res->code . 
"\n";
+            }
+            1;
+        } or print STDERR "Error requesting {$url}:" . $@ . "\n";
+    }
     my $json = encode_json(\@report);
     my $sql = 'insert into report_body select 1, now(), ?';
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/MirrorCache-1.034/lib/MirrorCache/WebAPI/Plugin/RenderFileFromMirror.pm 
new/MirrorCache-1.035/lib/MirrorCache/WebAPI/Plugin/RenderFileFromMirror.pm
--- old/MirrorCache-1.034/lib/MirrorCache/WebAPI/Plugin/RenderFileFromMirror.pm 
2022-06-07 10:53:05.000000000 +0200
+++ new/MirrorCache-1.035/lib/MirrorCache/WebAPI/Plugin/RenderFileFromMirror.pm 
2022-06-23 06:47:51.000000000 +0200
@@ -82,28 +82,30 @@
         my $country = $dm->country;
         my $region  = $dm->region;
         if (!$folder || !$file) {
-            return $root->render_file($dm, $filepath . '.metalink')  if 
($dm->metalink && !$file); # file is unknown - cannot generate metalink
+            return $root->render_file($dm, $filepath . '.metalink')  if 
($dm->metalink && !$file && !$dm->metalink_accept); # file is unknown - cannot 
generate metalink
             return $root->render_file($dm, $filepath)
-              unless $dm->extra; # TODO we still can check file on mirrors 
even if it is missing in DB
+              if !$dm->extra || $dm->metalink_accept; # TODO we still can 
check file on mirrors even if it is missing in DB
         }
 
         if (!$folder || !$file) {
             return $c->render(status => 404, text => "File not found");
         }
-        my $url;
-        if ($dm->torrent || $dm->zsync || $dm->metalink) {
-            $url = $root->is_remote ? $root->location($dm, $folder->path) : 
$root->redirect($dm, $folder->path);
-            if (!$dm->metalink) {
-                if ($url && ! $dm->metalink) {
-                    $url = $url . "/" . $basename;
-                } else {
-                    ($url = $c->req->url->to_abs->to_string) =~ 
s/\.(torrent|zsync)$//;
-                }
+        my $baseurl; # just hostname + eventual urldir (without folder and 
file)
+        my $fullurl; # baseurl with path and filename
+        if ($dm->metalink || $dm->torrent || $dm->zsync || $dm->magnet) {
+           $baseurl = $root->is_remote ? $root->location($dm) : 
$root->redirect($dm, $folder->path) # we must pass $path here because it 
potenially has impact
+        }
+        if ($dm->torrent || $dm->zsync || $dm->magnet) {
+            if ($baseurl) {
+                $fullurl = $baseurl . '/' . $filepath;
+            } else {
+                ($fullurl = $c->req->url->to_abs->to_string) =~ 
s/\.(torrent|zsync|magnet)$//;
             }
-        }
+       }
+
 
         if ($dm->zsync) {
-            _render_zsync($c, $url, $basename, $file->{mtime}, $file->{size}, 
$file->{sha1}, $file->{zblock_size}, $file->{zlengths}, $file->{zhashes});
+            _render_zsync($c, $fullurl, $basename, $file->{mtime}, 
$file->{size}, $file->{sha1}, $file->{zblock_size}, $file->{zlengths}, 
$file->{zhashes});
             $c->stat->redirect_to_root($dm, 1);
             return 1;
         }
@@ -113,7 +115,7 @@
             return 1;
         }
         if ($dm->magnet) {
-            _render_magnet($c, $url, $basename, $file);
+            _render_magnet($c, $fullurl, $basename, $file);
             $c->stat->redirect_to_root($dm, 1);
             return 1;
         }
@@ -137,7 +139,7 @@
             }
         }
 
-        return _render_torrent($dm, $file, \@mirrors_country, 
\@mirrors_region, \@mirrors_rest, $url) if $dm->torrent;
+        return _render_torrent($dm, $file, \@mirrors_country, 
\@mirrors_region, \@mirrors_rest, $fullurl) if $dm->torrent;
 
         if ($dm->metalink && !($dm->metalink_accept && 'media.1/media' eq 
substr($filepath,length($filepath)-length('media.1/media')))) {
             my $origin;
@@ -145,7 +147,7 @@
                 $publisher_url =~ s/^https?:\/\///;
                 $origin = $dm->scheme . '://' . $publisher_url;
             } else {
-                my $originurl = $c->req->url->to_abs; 
+                my $originurl = $c->req->url->to_abs;
                 $origin = $dm->scheme . '://' . $originurl->host;
                 $origin = $origin . ":" . $originurl->port if $originurl->port 
&& $originurl->port != "80";
                 $origin = $origin . $dm->route;
@@ -153,14 +155,13 @@
             $origin = $origin . $filepath;
             my $xml    = _build_metalink(
                 $dm, $folder->path, $file, $country, $region, 
\@mirrors_country, \@mirrors_region,
-                \@mirrors_rest, $origin, 'MirrorCache', $url);
+                \@mirrors_rest, $origin, 'MirrorCache', $baseurl);
             $c->res->headers->content_disposition('attachment; filename="' 
.$basename. '.metalink"');
             $c->render(data => $xml, format => 'metalink');
             return 1;
         }
 
         if ($dm->mirrorlist) {
-            $url = $c->req->url->to_abs;
             my @mirrordata;
             if ($country and !$dm->avoid_countries || !(grep { $country eq $_ 
} $dm->avoid_countries)) {
                 for my $m (@mirrors_country) {
@@ -214,6 +215,7 @@
                     $fileorigin = $redirect;
                     $fileoriginpath = $folder->path . '/' . $file->{name};
                 } else {
+                    my $url = $c->req->url->to_abs;
                     $fileorigin = $dm->scheme . '://' . $url->host;
                     $fileorigin = $fileorigin . ":" . $url->port if $url->port 
&& $url->port != "80";
                     $fileorigin = $fileorigin . $dm->route;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/MirrorCache-1.034/lib/MirrorCache/WebAPI/Plugin/Subsidiary.pm 
new/MirrorCache-1.035/lib/MirrorCache/WebAPI/Plugin/Subsidiary.pm
--- old/MirrorCache-1.034/lib/MirrorCache/WebAPI/Plugin/Subsidiary.pm   
2022-06-07 10:53:05.000000000 +0200
+++ new/MirrorCache-1.035/lib/MirrorCache/WebAPI/Plugin/Subsidiary.pm   
2022-06-23 06:47:51.000000000 +0200
@@ -32,6 +32,8 @@
     if ($ENV{MIRRORCACHE_REGION}) {
         $subsidiary_region = lc($ENV{MIRRORCACHE_REGION});
         $app->helper('subsidiary.has'     => sub { return undef; });
+        $app->helper('subsidiary.url'     => sub { return undef; });
+        $app->helper('subsidiary.local'   => sub { return undef; });
         $app->helper('subsidiary.regions' => sub { return undef; });
     } else {
         eval { #the table may be missing - no big deal
@@ -100,6 +102,8 @@
          });
 
          $app->helper('subsidiary.has'     => \&_has_subsidiary);
+         $app->helper('subsidiary.url'     => \&_url_for_region);
+         $app->helper('subsidiary.local'   => \&_is_region_local);
          $app->helper('subsidiary.regions' => \&_regions);
     }
     return $self;
@@ -124,16 +128,36 @@
     return $url;
 }
 
+sub _url_for_region {
+    return undef unless keys %subsidiary_urls;
+    my ($c, $region) = @_;
+
+    my $arr = $subsidiary_urls{$region};
+    return undef if !$arr || 'ARRAY' ne ref $arr;
+    my $region_url = $arr->[rand @$arr]; # this how we respect weight of each 
node
+
+    return $region_url;
+}
+
+sub _is_region_local {
+    return undef unless keys %subsidiary_urls;
+    my ($c, $region) = @_;
+    return undef unless $region;
+    return $subsidiary_local{$region};
+}
+
 # return url for all subsidiaries
 sub _regions {
     return undef unless keys %subsidiary_urls;
     my ($c, $region, $country) = @_;
-    $region = $country if $subsidiary_country{$country};
-    my $url = $subsidiary_urls{$region};
+    $region = $country if ($country && $subsidiary_country{$country});
+    my $url;
+    $url = $subsidiary_urls{$region} if $region;
     my @res = ($url? $region : '');
 
     for my $s (@regions) {
-        next if $region eq $s;
+        next unless $s;
+        next if $region && $region eq $s;
         next if $subsidiary_local{$s};
         push @res, $s;
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MirrorCache-1.034/lib/MirrorCache/WebAPI.pm 
new/MirrorCache-1.035/lib/MirrorCache/WebAPI.pm
--- old/MirrorCache-1.034/lib/MirrorCache/WebAPI.pm     2022-06-07 
10:53:05.000000000 +0200
+++ new/MirrorCache-1.035/lib/MirrorCache/WebAPI.pm     2022-06-23 
06:47:51.000000000 +0200
@@ -86,6 +86,7 @@
     $self->version($current_version);
 
     $self->defaults(branding => $ENV{MIRRORCACHE_BRANDING});
+    $self->defaults(custom_footer_message => 
$ENV{MIRRORCACHE_CUSTOM_FOOTER_MESSAGE});
 
     $self->plugin('RenderFile');
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/MirrorCache-1.034/t/environ/01-smoke-mirror-hasall-remote.sh 
new/MirrorCache-1.035/t/environ/01-smoke-mirror-hasall-remote.sh
--- old/MirrorCache-1.034/t/environ/01-smoke-mirror-hasall-remote.sh    
1970-01-01 01:00:00.000000000 +0100
+++ new/MirrorCache-1.035/t/environ/01-smoke-mirror-hasall-remote.sh    
2022-06-23 06:47:51.000000000 +0200
@@ -0,0 +1,58 @@
+#!lib/test-in-container-environ.sh
+set -ex
+
+FAKEURL="notexists${RANDOM}.com"
+FAKEURL2="notexists2${RANDOM}.com"
+
+ap9=$(environ ap9)
+
+mc=$(environ mc $(pwd))
+
+$mc/gen_env \
+    MIRRORCACHE_ROOT=http://$($ap9/print_address) \
+    MIRRORCACHE_REDIRECT=$FAKEURL2
+
+$mc/start
+$mc/status
+
+ap8=$(environ ap8)
+ap7=$(environ ap7)
+
+for x in $mc $ap7 $ap8 $ap9; do
+    mkdir -p $x/dt/{folder1,folder2,folder3}
+    echo $x/dt/{folder1,folder2,folder3}/{file1.1,file2.1}.dat | xargs -n 1 
touch
+done
+
+$ap9/start
+$ap9/curl /folder1/ | grep file1.1.dat
+
+$ap7/start
+$ap7/curl /folder1/ | grep file1.1.dat
+
+$ap8/start
+$ap8/curl /folder1/ | grep file1.1.dat
+
+
+$mc/sql "insert into server(hostname,urldir,enabled,country,region) select 
'$($ap7/print_address)','','t','us','na'"
+$mc/sql "insert into server(hostname,urldir,enabled,country,region) select 
'$($ap8/print_address)','','t','de','eu'"
+$mc/sql "insert into server(hostname,urldir,enabled,country,region) select 
'$FAKEURL','','t','it','eu'"
+
+
+$mc/sql "insert into server_capability_declaration(server_id, capability, 
enabled) select id, 'hasall', 't' from server where hostname = '${FAKEURL}'";
+
+$mc/curl -Is /download/folder1/file1.1.dat.mirrorlist
+
+$mc/backstage/job folder_sync_schedule_from_misses
+$mc/backstage/job folder_sync_schedule
+$mc/backstage/shoot
+$mc/backstage/job mirror_scan_schedule
+$mc/backstage/shoot
+
+$mc/curl -I /download/folder1/file1.1.dat?COUNTRY=it | grep -C10 302 | grep 
"${FAKEURL}"
+$mc/curl /download/folder1/file1.1.dat.mirrorlist | grep "${FAKEURL}"
+$mc/curl /download/folder1/file1.1.dat.metalink | grep 
"${FAKEURL2}"/folder1/file1.1.dat
+# with pedantic we ignore it though
+rc=0
+$mc/curl -I /download/folder1/file1.1.dat?"COUNTRY=it&PEDANTIC=1" | grep 
"${FAKEURL}" || rc=$?
+test $rc -gt 0
+echo success
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/MirrorCache-1.034/t/environ/01-smoke-mirror-hasall.sh 
new/MirrorCache-1.035/t/environ/01-smoke-mirror-hasall.sh
--- old/MirrorCache-1.034/t/environ/01-smoke-mirror-hasall.sh   2022-06-07 
10:53:05.000000000 +0200
+++ new/MirrorCache-1.035/t/environ/01-smoke-mirror-hasall.sh   2022-06-23 
06:47:51.000000000 +0200
@@ -39,6 +39,7 @@
 
 $mc/curl -I /download/folder1/file1.1.dat?COUNTRY=it | grep -C10 302 | grep 
"${FAKEURL}"
 $mc/curl /download/folder1/file1.1.dat.mirrorlist | grep "${FAKEURL}"
+$mc/curl /download/folder1/file1.1.dat.metalink   | grep 
"${FAKEURL}"/folder1/file1.1.dat
 # with pedantic we ignore it though
 rc=0
 $mc/curl -I /download/folder1/file1.1.dat?"COUNTRY=it&PEDANTIC=1" | grep 
"${FAKEURL}" || rc=$?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MirrorCache-1.034/t/environ/01-smoke.sh 
new/MirrorCache-1.035/t/environ/01-smoke.sh
--- old/MirrorCache-1.034/t/environ/01-smoke.sh 2022-06-07 10:53:05.000000000 
+0200
+++ new/MirrorCache-1.035/t/environ/01-smoke.sh 2022-06-23 06:47:51.000000000 
+0200
@@ -72,6 +72,13 @@
 $mc/curl -sL /                  | tidy --drop-empty-elements no
 $mc/curl -sL /download/folder1/ | tidy --drop-empty-elements no
 
+echo MIRRORCACHE_CUSTOM_FOOTER_MESSAGE='"Sponsored by openSUSE"' >> 
$mc/conf.env
+$mc/stop
+$mc/start
+
+$mc/curl -sL /                  | tidy --drop-empty-elements no | grep 
'Sponsored by openSUSE'
+$mc/curl -sL /download/folder1/ | tidy --drop-empty-elements no | grep 
'Sponsored by openSUSE'
+
 $mc/curl -s '/download/folder1/file2.1.dat?mirrorlist' | grep 
'http://127.0.0.1:1304/folder1/file2.1.dat'
 $mc/curl -s '/download/folder1/file2.1.dat.mirrorlist' | grep 
'http://127.0.0.1:1304/folder1/file2.1.dat'
 $mc/curl -s '/download/folder1/file2.1.dat.mirrorlist' | tidy 
--drop-empty-elements no
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/MirrorCache-1.034/t/environ/14-project-hq.sh 
new/MirrorCache-1.035/t/environ/14-project-hq.sh
--- old/MirrorCache-1.034/t/environ/14-project-hq.sh    1970-01-01 
01:00:00.000000000 +0100
+++ new/MirrorCache-1.035/t/environ/14-project-hq.sh    2022-06-23 
06:47:51.000000000 +0200
@@ -0,0 +1,89 @@
+#!lib/test-in-container-environ.sh
+set -ex
+
+# environ by number:
+# 9 - headquarter
+# 6 - NA subsidiary
+# 7 - EU subsidiary (same DB as hq)
+# 8 - ASIA subsidiary
+
+# hq mirrors: ap1 ap2
+# na mirrors: ap3 ap4
+# eu mirrors: ap5 ap6
+# as mirrors: ap7 ap8
+
+for i in 6 7 8 9; do
+    x=$(environ mc$i $(pwd))
+    mkdir -p $x/dt/{project1,project2}/{folder1,folder2,folder3}
+    echo 
$x/dt/{project1,project2}/{folder1,folder2,folder3}/{file1.1,file2.1}.dat | 
xargs -n 1 touch
+    eval mc$i=$x
+done
+
+for i in 1 2 3 4 5 6 7 8; do
+    x=$(environ ap$i)
+    mkdir -p $x/dt/{project1,project2}/{folder1,folder2,folder3}
+    echo 
$x/dt/{project1,project2}/{folder1,folder2,folder3}/{file1.1,file2.1}.dat | 
xargs -n 1 touch
+    $x/start
+    eval ap$i=$x
+done
+
+hq_address=$($mc9/print_address)
+na_address=$($mc6/print_address)
+na_interface=127.0.0.2
+eu_address=$($mc7/print_address)
+eu_interface=127.0.0.3
+as_address=$($mc8/print_address)
+as_interface=127.0.0.4
+
+# deploy db
+$mc9/backstage/shoot
+
+$mc9/sql "insert into subsidiary(hostname,region) select '$na_address','na'"
+$mc9/sql "insert into subsidiary(hostname,region,local) select 
'$eu_address','eu','t'"
+$mc9/sql "insert into subsidiary(hostname,region) select '$as_address','as'"
+$mc9/sql "insert into server(hostname,urldir,enabled,country,region) select 
'$($ap1/print_address)','','t','br','sa'"
+$mc9/sql "insert into server(hostname,urldir,enabled,country,region) select 
'$($ap2/print_address)','','t','br','sa'"
+$mc9/sql "insert into server(hostname,urldir,enabled,country,region) select 
'$($ap5/print_address)','','t','de','eu'"
+$mc9/sql "insert into server(hostname,urldir,enabled,country,region) select 
'$($ap6/print_address)','','t','dk','eu'"
+
+$mc9/start
+
+$mc6/gen_env MIRRORCACHE_REGION=na MIRRORCACHE_HEADQUARTER=$hq_address
+$mc6/start
+$mc6/sql "insert into server(hostname,urldir,enabled,country,region) select 
'$($ap3/print_address)','','t','us','na'"
+$mc6/sql "insert into server(hostname,urldir,enabled,country,region) select 
'$($ap4/print_address)','','t','ca','na'"
+
+$mc7/gen_env MIRRORCACHE_REGION=eu MIRRORCACHE_HEADQUARTER=$hq_address
+rm -r $mc7/db
+ln -s $mc9/db $mc7/db
+$mc7/start
+
+$mc8/gen_env MIRRORCACHE_REGION=as MIRRORCACHE_HEADQUARTER=$hq_address
+$mc8/start
+$mc8/sql "insert into server(hostname,urldir,enabled,country,region) select 
'$($ap7/print_address)','','t','jp','as'"
+$mc8/sql "insert into server(hostname,urldir,enabled,country,region) select 
'$($ap8/print_address)','','t','jp','as'"
+
+for i in 6 8 9; do
+    mc$i/sql "insert into project(name,path,etalon) select 
'proj1','/project1', 1"
+    mc$i/sql "insert into project(name,path,etalon) select 'proj 
2','/project2', 1"
+    mc$i/backstage/job -e folder_sync -a '["/project1/folder1"]'
+    mc$i/backstage/job -e mirror_scan -a '["/project1/folder1"]'
+    mc$i/backstage/job -e folder_sync -a '["/project1/folder2"]'
+    mc$i/backstage/job -e mirror_scan -a '["/project1/folder2"]'
+    mc$i/backstage/job -e folder_sync -a '["/project2/folder1"]'
+    mc$i/backstage/job -e mirror_scan -a '["/project2/folder1"]'
+    mc$i/backstage/shoot
+    mc$i/backstage/job -e report -a '["once"]'
+    mc$i/backstage/shoot
+done
+
+# all countries present in report
+mc9/curl -s /rest/repmirror \
+          | grep '"country":"br"' \
+          | grep '"country":"de"' \
+          | grep '"country":"dk"' \
+          | grep '"country":"ca"' \
+          | grep '"country":"us"' \
+          | grep '"country":"jp"'
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/MirrorCache-1.034/templates/branding/default/footer.html.ep 
new/MirrorCache-1.035/templates/branding/default/footer.html.ep
--- old/MirrorCache-1.034/templates/branding/default/footer.html.ep     
2022-06-07 10:53:05.000000000 +0200
+++ new/MirrorCache-1.035/templates/branding/default/footer.html.ep     
2022-06-23 06:47:51.000000000 +0200
@@ -1,11 +1,23 @@
 <footer class='footer'>
+      % if (my $msg = eval '$custom_footer_message') {
+<div class="container">
+  <div class='d-flex justify-content-between'>
+    <div id="footer-links" class="list-inline">
+      % } else {
   <div class='container-fluid'>
     <div id="footer-links" class="text-center">
+      % }
       <a href="https://github.com/openSUSE/MirrorCache";><i class="fab 
fa-github"></i> Source code</a>
       <a href="https://github.com/openSUSE/MirrorCache/issues/new";><i 
class="fas fa-bug"></i> Report issue</a>
       % if (my $ver = eval '$current_version') {
         <i class="fas fa-code-branch"></i> Version <%= $ver %>
       % }
     </div>
+      % if (my $msg = eval '$custom_footer_message') {
+    <div id="footer-custom-message" class="list-inline">
+      <i class="fas fa-dollar-sign"></i> <%= $msg %>
+    </div>
+  </div>
+      % }
   </div>
 </footer>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/MirrorCache-1.034/templates/branding/openSUSE/footer.html.ep 
new/MirrorCache-1.035/templates/branding/openSUSE/footer.html.ep
--- old/MirrorCache-1.034/templates/branding/openSUSE/footer.html.ep    
2022-06-07 10:53:05.000000000 +0200
+++ new/MirrorCache-1.035/templates/branding/openSUSE/footer.html.ep    
2022-06-23 06:47:51.000000000 +0200
@@ -12,6 +12,11 @@
         <a>Version <%= $ver %></a>
         % }
       </div>
+      % if (my $msg = eval '$custom_footer_message') {
+      <div class="list-inline">
+        <%= $msg %>
+      </div>
+      % }
     </div>
   </div>
 </footer>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/MirrorCache-1.034/templates/report/mirror/index.html.ep 
new/MirrorCache-1.035/templates/report/mirror/index.html.ep
--- old/MirrorCache-1.034/templates/report/mirror/index.html.ep 2022-06-07 
10:53:05.000000000 +0200
+++ new/MirrorCache-1.035/templates/report/mirror/index.html.ep 2022-06-23 
06:47:51.000000000 +0200
@@ -5,12 +5,24 @@
     setupReportTable();
 % end
 
+<form id='ajaxform'>
 <div class="row">
     <div class="col-sm-12">
         <h2><%= title %></h2>
 
         %= include 'layouts/info'
-
+        <div id="checkboxes">
+            % my $i = 0;
+            % for my $project (@$projects) {
+            <input id="<%= $project %>checkbox" type="checkbox"<%= $i < 2? ' 
checked="checked"' : '' %>"/>
+            <label for="<%= $project %>checkbox"><%= $project %></label>
+            %     $i = $i + 1;
+            % }
+            % # <input value="1" name="proj2checkbox" type="checkbox" 
id="proj2checkbox"/>
+            % # <label for="filter-proj2">proj2</label>
+        </div>
+        <input name="victimcheckbox" type="checkbox" id="victimcheckbox"/>
+        <label for="victimcheckbox">Blame</label>
         <table id="servers" class="reporttable table table-striped">
             <thead>
                 <tr>
@@ -29,3 +41,4 @@
         <input type="hidden" id="reporttable_api_url" value="/rest/repmirror"/>
     </div>
 </div>
+</form>

++++++ MirrorCache.obsinfo ++++++
--- /var/tmp/diff_new_pack.GNRhbQ/_old  2022-06-30 13:18:40.429547396 +0200
+++ /var/tmp/diff_new_pack.GNRhbQ/_new  2022-06-30 13:18:40.433547399 +0200
@@ -1,5 +1,5 @@
 name: MirrorCache
-version: 1.034
-mtime: 1654591985
-commit: 2650bc3c1b58c91f67aabc3e58ca518015eca3cc
+version: 1.035
+mtime: 1655959671
+commit: 04f97244031e34226a586781f8a35cca0ec01c4a
 

++++++ cache.tar.xz ++++++

Reply via email to