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.15'; |
4
|
11
|
|
|
11
|
|
5970
|
use strict; |
|
11
|
|
|
|
|
32
|
|
|
11
|
|
|
|
|
342
|
|
5
|
11
|
|
|
11
|
|
68
|
use warnings; |
|
11
|
|
|
|
|
28
|
|
|
11
|
|
|
|
|
393
|
|
6
|
|
|
|
|
|
|
|
7
|
11
|
|
|
11
|
|
66
|
use parent 'Tapper::Reports::Web::Controller::Base'; |
|
11
|
|
|
|
|
33
|
|
|
11
|
|
|
|
|
79
|
|
8
|
11
|
|
|
11
|
|
764
|
use Tapper::Cmd::Precondition; |
|
11
|
|
|
|
|
30
|
|
|
11
|
|
|
|
|
260
|
|
9
|
11
|
|
|
11
|
|
60
|
use Tapper::Model 'model'; |
|
11
|
|
|
|
|
24
|
|
|
11
|
|
|
|
|
1854
|
|
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
|
11
|
|
|
11
|
|
88
|
} |
|
11
|
|
|
|
|
34
|
|
|
11
|
|
|
|
|
85
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
11
|
|
|
11
|
0
|
129715
|
sub base : Chained PathPrefix CaptureArgs(0) { } |
|
11
|
|
|
0
|
|
34
|
|
|
11
|
|
|
|
|
66
|
|
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
|
11
|
|
|
11
|
|
11611
|
} |
|
11
|
|
|
|
|
34
|
|
|
11
|
|
|
|
|
69
|
|
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
|
11
|
|
|
11
|
|
11602
|
} |
|
11
|
|
|
|
|
33
|
|
|
11
|
|
|
|
|
60
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub similar : Chained('id') PathPart('similar') Args(0) |
58
|
|
|
|
0
|
0
|
|
{ |
59
|
11
|
|
|
11
|
|
10135
|
} |
|
11
|
|
|
|
|
36
|
|
|
11
|
|
|
|
|
55
|
|
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
|
11
|
|
|
11
|
|
12406
|
} |
|
11
|
|
|
|
|
28
|
|
|
11
|
|
|
|
|
80
|
|
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) 2020 by Advanced Micro Devices, Inc.. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
This is free software, licensed under: |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
The (two-clause) FreeBSD License |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=cut |