-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathpatch.html
More file actions
302 lines (298 loc) · 13.1 KB
/
patch.html
File metadata and controls
302 lines (298 loc) · 13.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
{%extends "base.html"%}
{%load commitfest%}
{%block contents%}
{%include "patch_commands.inc"%}
<table class="table table-bordered">
<tbody>
<tr>
<th>ID</th>
<td><a href="/patch/{{patch.id}}">{{patch.id}}</a></td>
</tr>
<tr>
<th>Title</th>
<td>{{patch.name}}</td>
</tr>
<tr>
<th>CI (CFBot)</th>
<td>
{%if not cfbot_branch %}
<span class="badge bg-secondary">Not processed</span></a>
{%elif cfbot_branch.needs_rebase_since %}
<a href="{{cfbot_branch.apply_url}}">
<span class="badge bg-warning" title="View git apply logs">Needs rebase!</span></a>
Needs rebase {% cfsince cfbot_branch.needs_rebase_since %}. {%if cfbot_branch.failing_since and cfbot_branch.failing_since != cfbot_branch.needs_rebase_since %}Failing {% cfsince cfbot_branch.failing_since %}. {%endif%}<br>Additional links previous successfully applied patch (outdated):<br>
<a href="https://github.com/postgresql-cfbot/postgresql/compare/cf/{{patch.id}}~1...cf/{{patch.id}}" title="View previous successfully applied patch set on GitHub"><img class="github-logo" src="/media/commitfest/github-mark.svg"/></a>
<a href="https://cirrus-ci.com/github/postgresql-cfbot/postgresql/cf%2F{{patch.id}}">
<span class="badge bg-secondary">Summary</span></a>
{%else%}
<a href="https://github.com/postgresql-cfbot/postgresql/compare/cf/{{patch.id}}~1...cf/{{patch.id}}" title="View last patch set on GitHub"><img class="github-logo" src="/media/commitfest/github-mark.svg"/></a>
<a href="https://cirrus-ci.com/github/postgresql-cfbot/postgresql/cf%2F{{patch.id}}">
<span class="badge bg-secondary">Summary</span></a>
{%for c in cfbot_tasks %}
{%if c.status == 'COMPLETED'%}
<a href="https://cirrus-ci.com/task/{{c.task_id}}" title="{{c.task_name}}: {{c.status}}"><img src="/media/commitfest/new_success.svg"/></a>
{%elif c.status == 'PAUSED'%}
<a href="https://cirrus-ci.com/task/{{c.task_id}}" title="{{c.task_name}}: {{c.status}}"><img src="/media/commitfest/paused.svg"/></a>
{%elif c.status == 'CREATED' or c.status == 'SCHEDULED' %}
<a href="https://cirrus-ci.com/task/{{c.task_id}}" title="{{c.task_name}}: {{c.status}}"><img src="/media/commitfest/waiting_to_start.svg"/></a>
{%elif c.status == 'EXECUTING' %}
<a href="https://cirrus-ci.com/task/{{c.task_id}}" title="{{c.task_name}}: {{c.status}}"><img src="/media/commitfest/running.svg"/></a>
{%else %}
{%if c.task_name == 'FormattingCheck' %}
<a href="https://cirrus-ci.com/task/{{c.task_id}}" title="{{c.task_name}}: {{c.status}}"><img src="/media/commitfest/formatting_failure.svg"/></a>
{%else%}
<a href="https://cirrus-ci.com/task/{{c.task_id}}" title="{{c.task_name}}: {{c.status}}"><img src="/media/commitfest/new_failure.svg"/></a>
{%endif%}
{%endif%}
{%endfor%}
{%endif%}
{%if cfbot_branch %}
<button class="btn btn-secondary" title="This adds the following to your clipboard (needs to be run in an existing git repo):
git remote add commitfest https://github.com/postgresql-cfbot/postgresql.git
git fetch commitfest cf/{{patch.id}}
git checkout commitfest/cf/{{patch.id}}" onclick="addGitCheckoutToClipboard({{patch.id}})">Copy git checkout commands</button>
{%endif%}
{%if user.is_authenticated%}
<form method="post" action="/patch/{{patch.id}}/cfbot_requeue/" style="display: inline;">
{%csrf_token%}
<button type="submit" class="btn btn-secondary" title="Requeue this patch for CFBot processing">Requeue CFBot</button>
</form>
{%endif%}
</a>
</td>
</tr>
<tr>
<th>Stats (from CFBot)</th>
<td>
{%if cfbot_branch and cfbot_branch.commit_id %}
{%if cfbot_branch.version %}
Patch version: {{ cfbot_branch.version }},
{%endif%}
Patch count: {{ cfbot_branch.patch_count }},
First patch: <span class="additions">+{{ cfbot_branch.first_additions }}</span><span class="deletions">−{{ cfbot_branch.first_deletions }}</span>,
All patches: <span class="additions">+{{ cfbot_branch.all_additions }}</span><span class="deletions">−{{ cfbot_branch.all_deletions }}</span>
{%else%}
Unknown
{%endif%}
</tr>
<tr>
<th>Tags</th>
<td>
{%for tag in patch.tags.all%}
<span class="badge" style="background-color: {{tag|tagcolor}};" title="{{tag.description}}">{{tag.name}}</span>
{%endfor%}
</td>
</tr>
<tr>
<th>Created</th>
<td>{{patch.created}}</td>
</tr>
<tr>
<th style="white-space: nowrap;">Last modified</th>
<td>{{patch.modified}} ({% cfwhen patch.modified %})</td>
</tr>
<tr>
<th style="white-space: nowrap;">Latest email</th>
<td>{%if patch.lastmail%}{{patch.lastmail}} ({% cfwhen patch.lastmail %}){%endif%}</td>
</tr>
<tr>
<th>Status</th>
<td>{%for c in patch_commitfests %}
<div style="margin-bottom: 3px;"><a href="/{{c.commitfest.id}}/">{{c.commitfest}}</a> ({{c.commitfest.periodstring}}): <span class="badge bg-{{c.status|patchstatuslabel}}">{{c.statusstring}}</span></div>
{%endfor%}
</td>
</tr>
<tr>
<th>Target version</th>
<td>{%if patch.targetversion%}<span class="badge bg-secondary">{{patch.targetversion}}</span>{%endif%}</td>
</tr>
<tr>
<th>Authors</th>
<td>{{patch.authors_string}}</td>
</tr>
<tr>
<th>Reviewers</th>
<td>{{patch.reviewers_string}}<a href="reviewer/{{is_reviewer|yesno:"remove,become"}}/" class="btn btn-secondary float-end">{{is_reviewer|yesno:"Remove from reviewers,Become reviewer"}}</a></td>
</tr>
<tr>
<th>Committer</th>
<td>{%if patch.committer%}{{patch.committer.fullname}}{%endif%}
{%if is_committer%}<a href="committer/{{is_this_committer|yesno:"remove,become"}}/" class="btn btn-secondary float-end">{{is_this_committer|yesno:"Unclaim as committer,Claim as committer"}}</a>{%endif%}
</td>
</tr>
<tr>
<th>Links</th>
<td>
{% if patch.wikilink %}
<a href="{{ patch.wikilink }}">Wiki</a>
{% endif %}
{% if patch.gitlink %}
<a href="{{ patch.gitlink }}">Git</a>
{% endif %}
</td>
</tr>
<tr>
<th>Emails</th>
<td>
{%if user.is_authenticated%}
<div style="float:right"><button class="btn btn-secondary" onclick="attachThread({{cf.id}},{{patch.id}})">Attach thread</button></div>
{%else%}
<div style="float:right"><button class="btn btn-secondary" onclick="location.href='/account/login/?next=/{{cf.id}}/{{patch.id}}/%3Fattachthreadnow'">Attach thread</button></div>
{%endif%}
<dl>
{%for t in patch.mailthread_set.all%}
<dt><a href="https://www.postgresql.org/message-id/flat/{{t.messageid}}">{{t.subject}}</a> <button type="button" class="btn-close btn-close-nofloat" title="Detach this thread" onclick="detachThread({{cf.id}},{{patch.id}},'{{t.messageid}}')"></button></dt>
<dd>
First at <a href="https://www.postgresql.org/message-id/{{t.messageid}}">{{t.firstmessage}}</a> by {{t.firstauthor|hidemail}}<br/>
Latest at <a href="https://www.postgresql.org/message-id/{{t.latestmsgid}}">{{t.latestmessage}}</a> by {{t.latestauthor|hidemail}}<br/>
{%for ta in t.mailthreadattachment_set.all%}
{%if forloop.first%}
Latest attachment (<a href="https://www.postgresql.org/message-id/attachment/{{ta.attachmentid}}/{{ta.filename}}">{{ta.filename}}</a>) at <a href="https://www.postgresql.org/message-id/{{ta.messageid}}">{{ta.date}}</a> from {{ta.author|hidemail}} <button type="button" class="btn btn-secondary btn-sm" data-bs-toggle="collapse" data-bs-target="#att{{t.pk}}" title="Show all attachments">+</button>
<div id="att{{t.pk}}" class="collapse">
{%endif%}
Attachment (<a href="https://www.postgresql.org/message-id/attachment/{{ta.attachmentid}}/{{ta.filename}}">{{ta.filename}}</a>) at <a href="https://www.postgresql.org/message-id/{{ta.messageid}}">{{ta.date}}</a> from {{ta.author|hidemail}} (Patch: {{ta.ispatch|yesno:"Yes,No,Pending check"}})<br/>
{%if forloop.last%}</div>{%endif%}
{%endfor%}
<div>
{%for a in t.mailthreadannotation_set.all%}
{%if forloop.first%}
<h4>Annotations</h4>
<table class="table table-bordered table-striped small">
<thead>
<tr>
<th>When</th>
<th>Who</th>
<th>Mail</th>
<th>Annotation</th>
</tr>
</thead>
<tbody>
{%endif%}
<tr>
<td>{{a.date}}</td>
<td style="white-space: nowrap">{{a.user_string}}</td>
<td style="white-space: nowrap">From {{a.mailauthor}}<br/>at <a href="https://www.postgresql.org/message-id/{{a.msgid}}">{{a.maildate}}</a></td>
<td width="99%">{{a.annotationtext}} <button type="button" class="btn btn-outline-danger btn-sm ms-2" title="Delete this annotation" onclick="deleteAnnotation({{a.id}})">×</button></td>
</tr>
{%if forloop.last%}
</body>
</table>
{%endif%}
{%endfor%}
{%if user.is_authenticated%}<button class="btn btn-sm btn-secondary" onclick="addAnnotation({{t.id}})">Add annotation</button>{%endif%}
</div>
</dd>
{%endfor%}
</dl>
</td>
</tr>
<tr>
<th>History</th>
<td>
<div style="max-height: 200px; overflow-y: scroll;">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>When</th>
<th>Who</th>
<th>What</th>
</tr>
</thead>
<tbody>
{%for h in patch.history %}
<tr>
<td style="white-space: nowrap;">{{h.date}}</td>
<td style="white-space: nowrap;">{{h.by_string}}</td>
<td width="99%">{{h.what}}</td>
</tr>
{%endfor%}
</tbody>
</table>
</div>
{%if user.is_authenticated%}
<a href="{{is_subscribed|yesno:"unsubscribe,subscribe"}}/" class="btn btn-secondary">{{is_subscribed|yesno:"Unsubscribe from patch update emails,Subscribe to patch update emails"}}</a>
{%endif%}
</td>
</tr>
</tbody>
</table>
<div class="dropup" >
{%include "patch_commands.inc"%}
</div>
{%comment%}commit dialog{%endcomment%}
<div class="modal fade" id="commitModal" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Flag as committed</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form>
<div class="mb-3">
<label for="committerSelect" class="form-label">Committer</label>
<select id="committerSelect" class="enable-selectize form-select">
<option value="" style="display:none;"></option>
{%for c in committers%}
<option value="{{c.user.username}}">{{c.user.first_name}} {{c.user.last_name}}</option>
{%endfor%}
</select>
</div>
</form>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-secondary" data-bs-dismiss="modal">Close</a>
<a href="#" class="btn btn-primary" id="doCommitButton">Flag as committed</a>
</div>
</div>
</div>
</div>
{%include "thread_attach.inc"%}
{%comment%}Modal dialog for adding annotation{%endcomment%}
<div class="modal fade" id="annotateModal" role="dialog">
<div class="modal-dialog modal-lg"><div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Add annotation</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div id="annotateMessageBody" class="modal-body">
<form>
<div class="mb-3">
<label for="annotateMessageList" class="form-label">Pick one of the messages in this thread</label>
<div id="annotateListWrap">
<select id="annotateMessageList" class="form-select" onChange="annotateMsgPicked()">
</select>
</div>
</div>
<div class="mb-3">
<label for="annotateMsgId" class="form-label">Or copy/paste the message-id:</label>
<div id="annotateMsgidWrap">
<input id="annotateMsgId" type="text" class="form-control" onKeyUp="annotateChanged()">
</div>
</div>
<div class="mb-3">
<label for="annotateMessage" class="form-label">Enter a message for the annotation</label>
<div id="annotateTextWrap">
<input id="annotateMessage" type="text" class="form-control" onKeyUp="annotateChanged()">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-secondary" data-bs-dismiss="modal">Close</a>
<a href="#" id="doAnnotateMessageButton" class="btn btn-primary disabled">Add annotation</a>
</div>
</div></div>
</div>
{%endblock%}
{%block morescript%}
<script>
{%if attachnow%}
$(document).ready(function() {
attachThread({{cf.id}},{{patch.id}}, function() {
document.location.replace('/{{cf.id}}/{{patch.id}}/');
});
});
{%endif%}
</script>
{%endblock%}