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