line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tapper::Reports::Web::Controller::Tapper::Preconditions; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TAPPER'; |
3
|
|
|
|
|
|
|
$Tapper::Reports::Web::Controller::Tapper::Preconditions::VERSION = '5.0.14'; |
4
|
10
|
|
|
10
|
|
5571
|
use strict; |
|
10
|
|
|
|
|
31
|
|
|
10
|
|
|
|
|
348
|
|
5
|
10
|
|
|
10
|
|
70
|
use warnings; |
|
10
|
|
|
|
|
30
|
|
|
10
|
|
|
|
|
328
|
|
6
|
|
|
|
|
|
|
|
7
|
10
|
|
|
10
|
|
71
|
use parent 'Tapper::Reports::Web::Controller::Base'; |
|
10
|
|
|
|
|
26
|
|
|
10
|
|
|
|
|
67
|
|
8
|
10
|
|
|
10
|
|
756
|
use Tapper::Cmd::Precondition; |
|
10
|
|
|
|
|
28
|
|
|
10
|
|
|
|
|
253
|
|
9
|
10
|
|
|
10
|
|
65
|
use Tapper::Model 'model'; |
|
10
|
|
|
|
|
42
|
|
|
10
|
|
|
|
|
1807
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub index :Path :Args(0) |
12
|
|
|
|
|
|
|
{ |
13
|
0
|
|
|
0
|
|
0
|
my ( $self, $c ) = @_; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
0
|
my $precond_search = $c->model('TestrunDB')->resultset('Precondition'); |
16
|
0
|
|
|
|
|
0
|
while (my $this_precond = $precond_search->next()) { |
17
|
0
|
|
|
|
|
0
|
my $hash = $this_precond->precondition_as_hash; |
18
|
0
|
|
|
|
|
0
|
$hash->{id} = $this_precond->id; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
0
|
push @{$c->stash->{preconditions}}, $hash; |
|
0
|
|
|
|
|
0
|
|
21
|
|
|
|
|
|
|
} |
22
|
0
|
|
|
|
|
0
|
return; |
23
|
10
|
|
|
10
|
|
109
|
} |
|
10
|
|
|
|
|
31
|
|
|
10
|
|
|
|
|
84
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
10
|
|
|
10
|
0
|
128517
|
sub base : Chained PathPrefix CaptureArgs(0) { } |
|
10
|
|
|
0
|
|
39
|
|
|
10
|
|
|
|
|
54
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub id : Chained('base') PathPart('') CaptureArgs(1) |
29
|
|
|
|
|
|
|
{ |
30
|
0
|
|
|
0
|
0
|
0
|
my ( $self, $c, $precondition_id ) = @_; |
31
|
0
|
|
|
|
|
0
|
$c->stash(precondition => $c->model('TestrunDB')->resultset('Precondition')->find($precondition_id)); |
32
|
0
|
0
|
|
|
|
0
|
if (not $c->stash->{precondition}) { |
33
|
0
|
|
|
|
|
0
|
$c->response->body(qq(No precondition with id "$precondition_id" found in the database!)); |
34
|
0
|
|
|
|
|
0
|
return; |
35
|
|
|
|
|
|
|
} |
36
|
10
|
|
|
10
|
|
11482
|
} |
|
10
|
|
|
|
|
29
|
|
|
10
|
|
|
|
|
59
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub delete : Chained('id') PathPart('delete') |
39
|
|
|
|
|
|
|
{ |
40
|
0
|
|
|
0
|
0
|
0
|
my ( $self, $c, $force) = @_; |
41
|
|
|
|
|
|
|
# when "done" is true, the precondition will already be deleted by the |
42
|
|
|
|
|
|
|
# controller once we get into the template, hence the name |
43
|
0
|
|
|
|
|
0
|
$c->stash(done => 0); |
44
|
|
|
|
|
|
|
|
45
|
0
|
0
|
|
|
|
0
|
return if not $force; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
0
|
my $cmd = Tapper::Cmd::Precondition->new(); |
48
|
0
|
|
|
|
|
0
|
my $retval = $cmd->del($c->stash->{precondition}->id); |
49
|
0
|
0
|
|
|
|
0
|
if ($retval) { |
50
|
0
|
|
|
|
|
0
|
$c->response->body(qq(Can't delete precondition: $retval)); |
51
|
0
|
|
|
|
|
0
|
return; |
52
|
|
|
|
|
|
|
} |
53
|
0
|
|
|
|
|
0
|
$c->stash(done => 1); |
54
|
10
|
|
|
10
|
|
11399
|
} |
|
10
|
|
|
|
|
33
|
|
|
10
|
|
|
|
|
65
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub similar : Chained('id') PathPart('similar') Args(0) |
58
|
|
|
|
0
|
0
|
|
{ |
59
|
10
|
|
|
10
|
|
10120
|
} |
|
10
|
|
|
|
|
44
|
|
|
10
|
|
|
|
|
52
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub new_create : Chained('base') :PathPart('create') :Args(0) :FormConfig |
64
|
|
|
|
|
|
|
{ |
65
|
0
|
|
|
0
|
0
|
|
my ($self, $c) = @_; |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
my $form = $c->stash->{form}; |
68
|
|
|
|
|
|
|
|
69
|
0
|
0
|
|
|
|
|
if ($form->submitted_and_valid) { |
70
|
0
|
|
|
|
|
|
my $cmd = Tapper::Cmd::Precondition->new(); |
71
|
0
|
|
|
|
|
|
my $file = $form->param('precondition'); |
72
|
0
|
|
|
|
|
|
my $data = $file->slurp; |
73
|
0
|
|
|
|
|
|
my @preconditions; |
74
|
0
|
|
|
|
|
|
eval { @preconditions = $cmd->add($data)}; |
|
0
|
|
|
|
|
|
|
75
|
0
|
0
|
|
|
|
|
if($@) { |
76
|
0
|
|
|
|
|
|
$c->stash(error => $@); |
77
|
|
|
|
|
|
|
} |
78
|
0
|
|
|
|
|
|
$c->stash(preconditions => \@preconditions); |
79
|
|
|
|
|
|
|
} else { |
80
|
0
|
|
|
|
|
|
print STDERR "created form for new precondition"; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
10
|
|
|
10
|
|
11950
|
} |
|
10
|
|
|
|
|
30
|
|
|
10
|
|
|
|
|
78
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
__END__ |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=pod |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=encoding UTF-8 |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 NAME |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Tapper::Reports::Web::Controller::Tapper::Preconditions |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 DESCRIPTION |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Catalyst Controller. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 NAME |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Tapper::Reports::Web::Controller::Tapper::Preconditions - Catalyst Controller |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 METHODS |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head2 index |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 AUTHOR |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Steffen Schwigon,,, |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 LICENSE |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
This program is released under the following license: freebsd |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 AUTHORS |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=over 4 |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=item * |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
AMD OSRC Tapper Team <tapper@amd64.org> |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=item * |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Tapper Team <tapper-ops@amazon.com> |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=back |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
This software is Copyright (c) 2019 by Advanced Micro Devices, Inc.. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
This is free software, licensed under: |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
The (two-clause) FreeBSD License |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=cut |