Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package MirrorCache for openSUSE:Factory checked in at 2024-08-09 16:14:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/MirrorCache (Old) and /work/SRC/openSUSE:Factory/.MirrorCache.new.7232 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "MirrorCache" Fri Aug 9 16:14:42 2024 rev:44 rq:1192563 version:1.080 Changes: -------- --- /work/SRC/openSUSE:Factory/MirrorCache/MirrorCache.changes 2024-08-01 22:06:25.245394943 +0200 +++ /work/SRC/openSUSE:Factory/.MirrorCache.new.7232/MirrorCache.changes 2024-08-09 16:15:09.916186958 +0200 @@ -1,0 +2,8 @@ +Thu Aug 01 08:59:31 UTC 2024 - Andrii Nikitin <andrii.nikitin@suse.com> + +- Update to version 1.080: + * Add /rest/project_last_modified route (#506) + * Display project size in human friendly format (#503) + * Add flag mysql_enable_utf8mb4 when connectin to MariaDB (#505) + +------------------------------------------------------------------- Old: ---- MirrorCache-1.079.obscpio New: ---- MirrorCache-1.080.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ MirrorCache.spec ++++++ --- /var/tmp/diff_new_pack.vq6sMZ/_old 2024-08-09 16:15:11.708261759 +0200 +++ /var/tmp/diff_new_pack.vq6sMZ/_new 2024-08-09 16:15:11.708261759 +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) perl(Config::IniFiles) %define build_requires %{assetpack_requires} rubygem(sass) tidy sysuser-shadow sysuser-tools Name: MirrorCache -Version: 1.079 +Version: 1.080 Release: 0 Summary: WebApp to redirect and manage mirrors License: GPL-2.0-or-later ++++++ MirrorCache-1.079.obscpio -> MirrorCache-1.080.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.079/assets/javascripts/admintable.js new/MirrorCache-1.080/assets/javascripts/admintable.js --- old/MirrorCache-1.079/assets/javascripts/admintable.js 2024-07-24 16:14:18.000000000 +0200 +++ new/MirrorCache-1.080/assets/javascripts/admintable.js 2024-08-01 10:38:57.000000000 +0200 @@ -265,6 +265,24 @@ return data ? data : ''; } +function renderAdminSize(data, type, row, meta) { + if(type === 'display' && data) { + if (Math.abs(data) < 1024) { + return data; + } + const units = ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; + let u = -1; + + do { + data /= 1024; + ++u; + } while (Math.round(Math.abs(data) * 10) >= 1024 && u < units.length - 1); + + return data.toFixed(1) + ' ' + units[u]; + } + return data ? data : ''; +} + function renderAdminTableSettingsList(data, type, row, meta) { var plainText = type !== 'display'; var edit = isEditingAdminTableRow(meta); @@ -442,7 +460,7 @@ } emptyRow[columnName] = ""; } else if (th.hasClass('col_ro')) { - columnDef.render = renderAdminReadonly; + columnDef.render = (columnName == 'size'? renderAdminSize : renderAdminReadonly); emptyRow.settings = {}; } else if (th.hasClass('col_unixtime')) { columnDef.render = renderAdminUnixtime; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.079/lib/MirrorCache/Schema/Result/Server.pm new/MirrorCache-1.080/lib/MirrorCache/Schema/Result/Server.pm --- old/MirrorCache-1.079/lib/MirrorCache/Schema/Result/Server.pm 2024-07-24 16:14:18.000000000 +0200 +++ new/MirrorCache-1.080/lib/MirrorCache/Schema/Result/Server.pm 2024-08-01 10:38:57.000000000 +0200 @@ -64,7 +64,7 @@ "MirrorCache::Schema::Result::ServerCapabilityDeclaration", sub { my $args = shift; - return { + return { "$args->{foreign_alias}.server_id" => { -ident => "$args->{self_alias}.id" }, "$args->{foreign_alias}.extra" => { '=', 'region' }, }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.079/lib/MirrorCache/Schema.pm new/MirrorCache-1.080/lib/MirrorCache/Schema.pm --- old/MirrorCache-1.079/lib/MirrorCache/Schema.pm 2024-07-24 16:14:18.000000000 +0200 +++ new/MirrorCache-1.080/lib/MirrorCache/Schema.pm 2024-08-01 10:38:57.000000000 +0200 @@ -32,13 +32,15 @@ $PROVIDER = $provider; unless ($SINGLETON) { + my @attr; if (pg()) { require Mojo::Pg; } else { require 'Mojo/' . $PROVIDER . '.pm'; + @attr = (mysql_enable_utf8 => 1); } - $SINGLETON = __PACKAGE__->connect($dsn, $user, $pass); + $SINGLETON = __PACKAGE__->connect($dsn, $user, $pass, { @attr }); if ($our_regions) { my @regions = split ',', $our_regions; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.079/lib/MirrorCache/Task/ReportProjectSize.pm new/MirrorCache-1.080/lib/MirrorCache/Task/ReportProjectSize.pm --- old/MirrorCache-1.079/lib/MirrorCache/Task/ReportProjectSize.pm 2024-07-24 16:14:18.000000000 +0200 +++ new/MirrorCache-1.080/lib/MirrorCache/Task/ReportProjectSize.pm 2024-08-01 10:38:57.000000000 +0200 @@ -30,9 +30,6 @@ return $job->finish('Previous report job is still active for ' . $path) unless my $guard = $minion->guard('report_project_size_' . $path, 30*60); - my $realpath = $app->mc->root->rootpath($path); - return $job->fail('Path not found: ' . $path) unless $realpath; - my ($size, $file_cnt, $lm) = $app->schema->resultset('Folder')->calculate_disk_usage($path); $job->note("total size" => $size, "file count" => $file_cnt, "last modified" => $lm); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.079/lib/MirrorCache/WebAPI/Controller/Rest/Project.pm new/MirrorCache-1.080/lib/MirrorCache/WebAPI/Controller/Rest/Project.pm --- old/MirrorCache-1.079/lib/MirrorCache/WebAPI/Controller/Rest/Project.pm 2024-07-24 16:14:18.000000000 +0200 +++ new/MirrorCache-1.080/lib/MirrorCache/WebAPI/Controller/Rest/Project.pm 2024-08-01 10:38:57.000000000 +0200 @@ -34,4 +34,13 @@ $self->render(json => $list); } +sub last_modified { + my ($self) = @_; + + my $name = $self->param("project"); + my $prj = $self->schema->resultset('Project')->find({ name => $name }); + + $self->render(text => $prj->lm, status => 200); +} + 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.079/lib/MirrorCache/WebAPI/Plugin/Backstage.pm new/MirrorCache-1.080/lib/MirrorCache/WebAPI/Plugin/Backstage.pm --- old/MirrorCache-1.079/lib/MirrorCache/WebAPI/Plugin/Backstage.pm 2024-07-24 16:14:18.000000000 +0200 +++ new/MirrorCache-1.080/lib/MirrorCache/WebAPI/Plugin/Backstage.pm 2024-08-01 10:38:57.000000000 +0200 @@ -34,7 +34,7 @@ } my @permanent_jobs = - qw(folder_sync_schedule_from_misses folder_sync_schedule mirror_scan_schedule_from_misses mirror_scan_schedule_from_path_errors mirror_scan_schedule project_sync_schedule cleanup stat_agg_schedule mirror_check_from_stat report); + qw(folder_sync_schedule_from_misses folder_sync_schedule mirror_scan_schedule_from_misses mirror_scan_schedule_from_path_errors mirror_scan_schedule project_sync_schedule cleanup stat_agg_schedule mirror_check_from_stat report report_project_size_schedule); sub register_tasks { my $self = shift; @@ -46,10 +46,6 @@ if ($app->mcconfig->mirror_provider) { push @permanent_jobs, 'mirror_provider_sync'; } - eval { - my $projects = $app->mcproject->list; - push @permanent_jobs, 'report_project_size_schedule' if @$projects; - }; $app->plugin($_) for ( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.079/lib/MirrorCache/WebAPI.pm new/MirrorCache-1.080/lib/MirrorCache/WebAPI.pm --- old/MirrorCache-1.079/lib/MirrorCache/WebAPI.pm 2024-07-24 16:14:18.000000000 +0200 +++ new/MirrorCache-1.080/lib/MirrorCache/WebAPI.pm 2024-08-01 10:38:57.000000000 +0200 @@ -182,6 +182,7 @@ # $rest_r->get('/project/:name')->to('project#show'); $rest_r->get('/project/:id')->to('table#list', table => 'Project'); $rest_r->get('/project/propagation/:project_id')->to('project_propagation#list'); + $rest_r->get('/project_last_modified')->to('project#last_modified'); $rest_r->get('/rollout_server/:version')->to('rollout_server#list'); my $rest_operator_auth; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.079/t/environ/13-mirror-management.sh new/MirrorCache-1.080/t/environ/13-mirror-management.sh --- old/MirrorCache-1.079/t/environ/13-mirror-management.sh 2024-07-24 16:14:18.000000000 +0200 +++ new/MirrorCache-1.080/t/environ/13-mirror-management.sh 2024-08-01 10:38:57.000000000 +0200 @@ -21,19 +21,20 @@ # Update mirror urldir and sponsor $mc/curl '/rest/server/2' \ -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \ - --data-raw 'id=2&urldir=/somedir&sponsor=SUSE&hostname=127.0.0.1:1314&country=eu&enabled=0' + --data-raw 'id=2&urldir=/somedir&sponsor=Kormányzati&hostname=127.0.0.1:1314&country=eu&enabled=0' -$mc/sql_test SUSE == 'select sponsor from server where id = 2' +$mc/sql_test Kormányzati == 'select sponsor from server where id = 2' +$mc/curl /rest/server | grep Kormányzati # Look for server_update event with both ids: who executed action and what was affected -$mc/curl '/admin/auditlog/ajax?search\[value\]=event:server_update' | grep 'server_update' | grep '"user_id":-2' | grep '\\\"id\\\":\\\"2\\\"' +$mc/curl '/admin/auditlog/ajax?search\[value\]=event:server_update' | grep 'server_update' | grep '"user_id":-2' | grep '\\"id\\":\\"2\\"' # Delete mirror $mc/curl '/rest/server/2' -X DELETE >/dev/null $mc/curl '/rest/server/2' -X DELETE | grep 'error' # Look for server_delete event with both ids: who executed action and what was affected -$mc/curl '/admin/auditlog/ajax?search\[value\]=event:server_delete' | grep 'server_delete' | grep '"user_id":-2' | grep '\\\"id\\\":2' +$mc/curl '/admin/auditlog/ajax?search\[value\]=event:server_delete' | grep 'server_delete' | grep '"user_id":-2' | grep '\\"id\\":2' $mc/curl -X POST /logout diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.079/t/environ/14-project-report.sh new/MirrorCache-1.080/t/environ/14-project-report.sh --- old/MirrorCache-1.079/t/environ/14-project-report.sh 2024-07-24 16:14:18.000000000 +0200 +++ new/MirrorCache-1.080/t/environ/14-project-report.sh 2024-08-01 10:38:57.000000000 +0200 @@ -83,6 +83,10 @@ $mc/sql_test 2 == "select file_cnt from project where path = '/project2/folder1'" $mc/sql_test 13 == "select size from project where path = '/project2/folder2'" +lm=$($mc/curl /rest/project_last_modified?project=proj1) + +test "$lm" == "$(date +%s -r $mc/dt/project1/folder2/file1.1.dat)" + $mc/curl /report/mirrors | tidy --drop-empty-elements no | \ grep -A4 -F '<div class="repo">' | \ grep -A2 -F '"http://127.0.0.1:1304/project2/folder2">' | \ ++++++ MirrorCache.obsinfo ++++++ --- /var/tmp/diff_new_pack.vq6sMZ/_old 2024-08-09 16:15:12.152280292 +0200 +++ /var/tmp/diff_new_pack.vq6sMZ/_new 2024-08-09 16:15:12.156280459 +0200 @@ -1,5 +1,5 @@ name: MirrorCache -version: 1.079 -mtime: 1721830458 -commit: 1fd848f467a79f3c2697593716894e3ee3ea7238 +version: 1.080 +mtime: 1722501537 +commit: 584c1402d72e0d9782d6f7ccf5ef4a27f25ca82b