File Coverage

blib/lib/Tapper/Schema/TestrunDB/Result/DeniedHost.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Tapper::Schema::TestrunDB::Result::DeniedHost;
2             our $AUTHORITY = 'cpan:TAPPER';
3             $Tapper::Schema::TestrunDB::Result::DeniedHost::VERSION = '5.0.11';
4             # ABSTRACT: Tapper - Relation for hosts that are denied for testruns of a certain queue
5              
6 7     7   3211 use strict;
  7         16  
  7         177  
7 7     7   28 use warnings;
  7         15  
  7         158  
8              
9 7     7   28 use parent 'DBIx::Class';
  7         15  
  7         30  
10              
11             # Note: Technically, it would also be possible to extend QueueHost with another element that defines
12             # whether the QueueHost is bound or denied for the queue. Unfortunatelly, in this case all code using
13             # QueueHost would have to check this new flag and thus become more complicated. A new table may seem
14             # to introduce more complexity at first but in the end its the easier solution.
15              
16             __PACKAGE__->load_components("Core");
17             __PACKAGE__->table("denied_host");
18             __PACKAGE__->add_columns
19             (
20             "id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 11, is_auto_increment => 1, },
21             "queue_id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 11, is_foreign_key => 1, },
22             "host_id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 11, is_foreign_key => 1, },
23             );
24              
25             __PACKAGE__->set_primary_key(qw/id/);
26              
27             (my $basepkg = __PACKAGE__) =~ s/::\w+$//;
28              
29             __PACKAGE__->belongs_to( queue => "${basepkg}::Queue", { 'foreign.id' => 'self.queue_id' });
30             __PACKAGE__->belongs_to( host => "${basepkg}::Host", { 'foreign.id' => 'self.host_id' });
31              
32             1;
33              
34             __END__
35              
36             =pod
37              
38             =encoding UTF-8
39              
40             =head1 NAME
41              
42             Tapper::Schema::TestrunDB::Result::DeniedHost - Tapper - Relation for hosts that are denied for testruns of a certain queue
43              
44             =head1 AUTHORS
45              
46             =over 4
47              
48             =item *
49              
50             AMD OSRC Tapper Team <tapper@amd64.org>
51              
52             =item *
53              
54             Tapper Team <tapper-ops@amazon.com>
55              
56             =back
57              
58             =head1 COPYRIGHT AND LICENSE
59              
60             This software is Copyright (c) 2019 by Advanced Micro Devices, Inc..
61              
62             This is free software, licensed under:
63              
64             The (two-clause) FreeBSD License
65              
66             =cut