Skip to content

Commit 7a1ef6b

Browse files
committed
BUGFIX: process the report-fields only once
Some fields from the json were processed multiple times, this leaves them empty as they are removed from the source the first time they are processed. Restyle to `qw< >` (with spaces inside) Depend on the fixed version of Perl5::SmokeDB::Schema
1 parent e8cef95 commit 7a1ef6b

File tree

2 files changed

+31
-28
lines changed

2 files changed

+31
-28
lines changed

cpanfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ requires 'DBD::SQLite' => '0';
1111
requires 'DBIx::Class' => '0';
1212
requires 'Dancer2::Plugin::DBIC' => '0';
1313
requires 'Moo' => '2';
14-
requires 'Perl5::CoreSmokeDB::Schema' => '1.08';
14+
requires 'Perl5::CoreSmokeDB::Schema' => '1.10';
1515
requires 'namespace::autoclean' => '0';
1616
requires 'Starman' => '0.4015';

lib/Perl5/CoreSmokeDB/Client/Database.pm

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
package Perl5::CoreSmokeDB::Client::Database;
22
use Moo;
33

4-
with(
5-
'Perl5::CoreSmokeDB::ValidationTemplates',
6-
'MooX::Params::CompiledValidators'
7-
);
4+
with qw<
5+
Perl5::CoreSmokeDB::ValidationTemplates
6+
MooX::Params::CompiledValidators
7+
>;
8+
9+
our $VERSION = '1.001';
810

911
use version;
1012
use DateTime;
11-
use Date::Parse qw( str2time );
13+
use Date::Parse qw< str2time >;
1214

1315
=head1 NAME
1416
@@ -22,15 +24,13 @@ An instance of L<Perl5::CoreSmokeDB::Schema>.
2224
2325
=cut
2426

25-
use Types::Standard qw( InstanceOf );
27+
use Types::Standard qw< InstanceOf >;
2628
has schema => (
2729
is => 'ro',
2830
isa => InstanceOf["Perl5::CoreSmokeDB::Schema"],
2931
required => 1
3032
);
3133

32-
my @_binary_data = qw/ log_file out_file manifest_msgs compiler_msgs nonfatal_msgs /;
33-
3434
=head1 DESCRIPTION
3535
3636
This is the interface between the database and the API, it executes queries and
@@ -244,15 +244,15 @@ sub get_latest_reports {
244244
},
245245
},
246246
{
247-
columns => [qw/
247+
columns => [qw<
248248
id architecture hostname osname osversion
249249
perl_id git_id git_describe plevel smoke_branch
250250
username smoke_date summary cpu_count cpu_description
251-
/],
251+
>],
252252
order_by => [
253253
{ '-desc' => 'smoke_date' },
254254
{ '-desc' => 'plevel' },
255-
qw/architecture osname osversion hostname/
255+
qw< architecture osname osversion hostname >,
256256
],
257257
}
258258
);
@@ -661,12 +661,12 @@ sub get_reports_by_perl_version {
661661
$self->get_filter_query_report(\%$raw_filter),
662662
},
663663
{
664-
columns => [qw/
664+
columns => [qw<
665665
id architecture hostname osname osversion
666666
perl_id git_id git_describe plevel smoke_branch
667667
username smoke_date summary cpu_count cpu_description
668-
/],
669-
order_by => [qw/architecture hostname osname osversion/],
668+
>],
669+
order_by => [qw< architecture hostname osname osversion >],
670670
}
671671
);
672672
return [ $reports->all() ];
@@ -699,7 +699,7 @@ sub count_reports_by_filter {
699699
},
700700
{
701701
join => 'configs',
702-
columns => [qw/id/],
702+
columns => [qw< id >],
703703
distinct => 1,
704704
}
705705
)->count();
@@ -736,11 +736,11 @@ sub get_reports_by_filter {
736736
},
737737
{
738738
join => 'configs',
739-
columns => [qw/
739+
columns => [qw<
740740
id architecture hostname osname osversion
741741
perl_id git_id git_describe plevel smoke_branch
742742
username smoke_date summary cpu_count cpu_description
743-
/],
743+
>],
744744
distinct => 1,
745745
order_by => { -desc => 'smoke_date' },
746746
page => $page,
@@ -762,9 +762,9 @@ sub get_architecture_host_os {
762762
my $architecture = $self->schema->resultset('Report')->search(
763763
undef,
764764
{
765-
columns => [qw/architecture hostname osname osversion/],
766-
group_by => [qw/architecture hostname osname osversion/],
767-
order_by => [qw/architecture hostname osname osversion/],
765+
columns => [qw< architecture hostname osname osversion >],
766+
group_by => [qw< architecture hostname osname osversion >],
767+
order_by => [qw< architecture hostname osname osversion >],
768768
},
769769
);
770770
return [ $architecture->all() ];
@@ -782,9 +782,9 @@ sub get_compilers {
782782
my $compilers = $self->schema->resultset('Config')->search(
783783
undef,
784784
{
785-
columns => [qw/cc ccversion/],
786-
group_by => [qw/cc ccversion/],
787-
order_by => [qw/cc ccversion/],
785+
columns => [qw< cc ccversion >],
786+
group_by => [qw< cc ccversion >],
787+
order_by => [qw< cc ccversion >],
788788
}
789789
);
790790
return [ $compilers->all() ];
@@ -834,13 +834,16 @@ sub post_report {
834834
time_zone => 'UTC',
835835
);
836836

837-
my @to_unarray = qw/
837+
my @log_data = qw< log_file out_file >;
838+
$report_data->{$_} = delete $data->{$_} for @log_data;
839+
840+
my @to_unarray = qw<
838841
skipped_tests applied_patches
839842
compiler_msgs manifest_msgs nonfatal_msgs
840-
/;
843+
>;
841844
$report_data->{$_} = join("\n", @{delete($data->{$_}) || []}) for @to_unarray;
842845

843-
my @other_data = qw/harness_only harness3opts summary/;
846+
my @other_data = qw< harness_only harness3opts summary >;
844847
$report_data->{$_} = delete $data->{$_} for @other_data;
845848

846849
my $configs = delete $data->{'configs'};
@@ -851,7 +854,7 @@ sub post_report {
851854

852855
for my $config (@$configs) {
853856
my $results = delete $config->{'results'};
854-
for my $field (qw/cc ccversion/) {
857+
for my $field (qw< cc ccversion >) {
855858
$config->{$field} ||= '?';
856859
}
857860
$config->{started} = DateTime->from_epoch(

0 commit comments

Comments
 (0)