bug fixes for show git log on detail pages feature
[buildfarm-server.git] / templates / log.tt
1 [% PERL %]
2         use POSIX qw(ceil);
3         my $lrfactor = 6;
4         $stash->set(lrfactor => $lrfactor);
5         my $rows = $stash->get('log_file_names'); 
6         my $logrows = ceil(scalar(@$rows)/$lrfactor);
7         my $logcells = $lrfactor * $logrows;
8         $stash->set( logcells => $logcells);
9         $stash->set( logrows => $logrows ); 
10 [% END -%]
11 [% mytitle = BLOCK %]PostgreSQL BuildFarm | [% IF stage != 'OK' %]Log for system "[% system %]" failure on snapshot taken [% urldt ; ELSE %]Configuration summary for system "[% system %]" snapshot taken [% urldt ; END ; END -%]
12 [%
13         cvsurl = 'http://anoncvs.postgresql.org/cvsweb.cgi';
14         giturl = scmurl || 'http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=';
15 -%]
16 [% WRAPPER 'page.tt' 
17         title = mytitle
18         bodyclass = 'none'
19         pagebutton = 'none'
20 %]
21 [%- BLOCK gitlog ;
22         loglines = clog.split('\n');
23         firstline = loglines.shift;
24         commitref = firstline.replace('commit ([0-9A-Fa-f]+)','$1');
25 %]
26 commit <a href="[% giturl ; commitref %]">[% commitref %]</a>
27 [% loglines.join("\n")  | html %]
28
29 [% END -%]
30 <h1>PostgreSQL Build Farm Log</h1>
31 <h2>Details for system "[% system %]"[% IF stage != 'OK' %] failure at stage [% stage ; ELSE %], status 'OK'[% END %], snapshot taken [% urldt %]</h2>
32 <table cellspacing="0">
33     <tr>
34         <th class="head" rowspan="2">System Information</th>
35         <th>Farm member</th>
36         <th>Branch</th>
37         <th>OS</th>
38         <th>Compiler</th>
39         <th>Architecture</th>
40         <th>Owner</th>
41     </tr>
42     <tr>
43         <td>[% system %]</td>
44         <td><a href="/cgi-bin/show_history.pl?nm=[% system %]&amp;br=[% branch %]">[% branch %]</a></td>
45         <td>[% info_row.operating_system %] [% info_row.os_version %]</td>
46         <td>[% info_row.compiler %] [% info_row.compiler_version %]</td>
47         <td>[% info_row.architecture %]</td>
48         <td>[% info_row.owner_email %]</td>
49     </tr>
50   </table>
51 [% IF info_row.sys_notes %]
52     <br />
53     <table>
54      <tr>
55        <th class="head" rowspan="2">System Notes</th>
56        <th>Date</th>
57        <th>Notes</th>
58      </tr>
59      <tr>
60       <td>[% info_row.sys_notes_date %]</td>
61       <td>[% info_row.sys_notes %]</td>
62      </tr>
63    </table>
64 [% END %]
65 [% cell = 0; FOREACH logstage  IN log_file_names ; striplog = logstage.replace('\.log$','') ; cell = loop.count %]
66   [% IF loop.first %] 
67     <br /> <table><tr><th class='head' rowspan='[% logrows %]'>Stage Logs</th>
68   [% END %]
69     [% IF loop.count > 1 and loop.count % lrfactor == 1 %]<tr>[% END %]
70     <td><a href='show_stage_log.pl?nm=[% system %]&amp;dt=[% urldt | uri %]&amp;stg=[% striplog %]'>[% striplog %]</a></td>
71     [% IF loop.count % lrfactor == 0 %]</tr>[% END %]
72 [% END %]
73
74 [% IF cell > 0 ; nrcell = cell + 1; ncells = [ nrcell .. logcells ] ; FOREACH rcell IN ncells %]
75         [% IF rcell > 1 and rcell % lrfactor == 1 %]<tr>[% END %]
76         <td>&nbsp;</td>
77         [% IF rcell % lrfactor == 0 %]</tr>[% END %]
78     [% END %]
79     </table>
80 [% END %]
81
82 <h3>Configuration summary</h3>
83 <pre>
84 [% conf | html %]
85 </pre>
86 <h3>Files changed this run</h3>
87 [%- IF changed_this_run.0 -%]
88 <pre>
89 [%- FOREACH changed IN changed_this_run %]
90 <a href="[% IF scm == 'git' ; giturl; changed.1; ELSE ; cvsurl ; changed.0; 'rev='; changed.1; END %]">[% changed.0 ; IF scm == 'cvs'; ' '; changed.1; END %]</a>
91 [%- END -%]
92 </pre>
93 [% END %]
94 [% IF changed_this_run_logs.0 %]
95 <h5>Git log</h5>
96 <blockquote><pre>
97 [%- FOREACH clog IN changed_this_run_logs ; PROCESS gitlog -%]
98 [%IF not loop.last %]
99 ===================================================================
100 [% END -%]
101 [%- END -%]
102 </pre></blockquote>
103 [%- ELSE %]
104 <pre>
105 not recorded
106 </pre>
107 [% END -%]
108 [% IF stage != 'OK' %]
109 <h3>Files changed since last success</h3>
110 [%- IF changed_since_success.0 %]
111 <pre>
112 [%- FOREACH changed IN changed_since_success %]
113 <a href="[% IF scm == 'git' ; giturl; changed.1; ELSE ; cvsurl ; changed.0; 'rev='; changed.1; END %]">[% changed.0 ; IF scm == 'cvs'; ' '; changed.1; END %]</a>
114 [%- END -%]
115 </pre>
116 [% END %]
117 [% IF changed_since_success_logs.0 %]
118 <h5>Git log</h5>
119 <blockquote><pre>
120 [%- FOREACH clog IN changed_since_success_logs ; PROCESS gitlog -%]
121 [%IF not loop.last %]
122 ===================================================================
123 [% END -%]
124 [%- END -%]
125 </pre></blockquote>
126 [%- ELSE %]
127 <pre>
128 not recorded
129 </pre>
130 [% END -%]
131 [% END %]
132 <h3>Log</h3>
133 <pre>
134 [% log | html %]
135 </pre>
136 [% END %]