From: Dylan William Hardison Date: Thu, 28 Mar 2019 22:19:41 +0000 (-0400) Subject: Bug 1538957 - Add debugging information to emails for investigating in more detail... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de76d834337af06cdf91721360f5286ed074c108;p=thirdparty%2Fbugzilla.git Bug 1538957 - Add debugging information to emails for investigating in more detail later. --- diff --git a/scripts/secbugsreport.pl b/scripts/secbugsreport.pl index a23a6efe5..67141e97e 100644 --- a/scripts/secbugsreport.pl +++ b/scripts/secbugsreport.pl @@ -25,18 +25,21 @@ use Bugzilla::Report::SecurityRisk; use DateTime; use URI; use JSON::MaybeXS; -use Mojo::File; +use Mojo::File qw(path); +use Data::Dumper; +use Types::Standard qw(Int); BEGIN { Bugzilla->extensions } Bugzilla->usage_mode(USAGE_MODE_CMDLINE); +my ($year, $month, $day) = @ARGV; + exit 0 unless Bugzilla->params->{report_secbugs_active}; -exit 0 unless defined $ARGV[0] && defined $ARGV[1] && defined $ARGV[2]; +exit 0 unless Int->check($year) && Int->check($month) && Int->check($day); my $html; -my $template = Bugzilla->template(); -my $end_date - = DateTime->new(year => $ARGV[0], month => $ARGV[1], day => $ARGV[2]); +my $template = Bugzilla->template(); +my $end_date = DateTime->new(year => $year, month => $month, day => $day); my $start_date = $end_date->clone()->subtract(months => 12); my $report_week = $end_date->ymd('-'); my $teams = decode_json(Bugzilla->params->{report_secbugs_teams}); @@ -107,6 +110,9 @@ my $email = Email::MIME->create( MessageToMTA($email); +my $report_dump_file = path(bz_locations->{datadir}, "$year-$month-$day.dump"); +$report_dump_file->spurt(Dumper($report)); + sub build_bugs_link { my ($arr, $product) = @_; my $uri = URI->new(Bugzilla->localconfig->{urlbase} . 'buglist.cgi');