Skip to content

Commit 2a276bf

Browse files
committed
Make needs_rebase_since and failing_since inforamtion available to users (#47)
1 parent 75f7fd8 commit 2a276bf

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

pgcommitfest/commitfest/templates/commitfest.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ <h3>{{p.is_open|yesno:"Active patches,Closed patches"}}</h3>
9494
{%with p.cfbot_results as cfb%}
9595
{%if not cfb %}
9696
<span class="label label-default">Not processed</span>
97-
{%elif cfb.needs_rebase %}
98-
<a href="{{cfb.apply_url}}" title="View git apply logs">
97+
{%elif p.needs_rebase_since %}
98+
<a href="{{cfb.apply_url}}" title="View git apply logs. Needs rebase since {{p.needs_rebase_since|timesince}}. {%if p.failing_since and p.failing_since != p.needs_rebase_since %}Failing since {{p.failing_since|timesince}}.{%endif%}">
9999
<span class="label label-warning">Needs rebase!</span>
100100
</a>
101101
{%else%}
102102
<a href="https://github.com/postgresql-cfbot/postgresql/compare/cf/{{p.id}}~1...cf/{{p.id}}" title="View last patch set on GitHub"><img class="github-logo" src="/media/commitfest/github-mark.svg"/></a>
103103
<a href="https://cirrus-ci.com/github/postgresql-cfbot/postgresql/cf%2F{{p.id}}"
104-
title="View CI history{%if cfb.failed_task_names %}. Failed jobs: {{cfb.failed_task_names}}{%endif%}">
104+
title="View CI history. {%if p.failing_since%}Failing since {{p.failing_since|timesince}}. {%endif%}{%if cfb.failed_task_names %}Failed jobs: {{cfb.failed_task_names}}{%endif%}">
105105
{%if cfb.failed > 0 or cfb.branch_status == 'failed' or cfb.branch_status == 'timeout' %}
106106
<img src="/media/commitfest/new_failure.svg"/>
107107
{%elif cfb.completed < cfb.total %}

pgcommitfest/commitfest/templates/patch.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
<td>
1818
{%if not cfbot_branch %}
1919
<span class="label label-default">Not processed</span></a>
20-
{%elif not cfbot_branch.commit_id %}
20+
{%elif cfbot_branch.needs_rebase_since %}
2121
<a href="{{cfbot_branch.apply_url}}">
2222
<span class="label label-warning" title="View git apply logs">Needs rebase!</span></a>
23-
Additional links previous successfully applied patch (outdated):
23+
Needs rebase since {{cfbot_branch.needs_rebase_since|timesince}}. {%if cfbot_branch.failing_since and cfbot_branch.failing_since != cfbot_branch.needs_rebase_since %}Failing since {{cfbot_branch.failing_since|timesince}}. {%endif%}<br>Additional links previous successfully applied patch (outdated):<br>
2424
<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>
2525
<a href="https://cirrus-ci.com/github/postgresql-cfbot/postgresql/cf%2F{{patch.id}}">
2626
<span class="label label-default">Summary</span></a>

pgcommitfest/commitfest/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ def commitfest(request, cfid):
298298
(SELECT string_agg(first_name || ' ' || last_name || ' (' || username || ')', ', ') FROM auth_user INNER JOIN commitfest_patch_authors cpa ON cpa.user_id=auth_user.id WHERE cpa.patch_id=p.id) AS author_names,
299299
(SELECT string_agg(first_name || ' ' || last_name || ' (' || username || ')', ', ') FROM auth_user INNER JOIN commitfest_patch_reviewers cpr ON cpr.user_id=auth_user.id WHERE cpr.patch_id=p.id) AS reviewer_names,
300300
(SELECT count(1) FROM commitfest_patchoncommitfest pcf WHERE pcf.patch_id=p.id) AS num_cfs,
301+
branch.needs_rebase_since,
302+
branch.failing_since,
301303
(
302304
SELECT row_to_json(t) as cfbot_results
303305
from (
@@ -307,7 +309,6 @@ def commitfest(request, cfid):
307309
count(*) FILTER (WHERE task.status in ('ABORTED', 'ERRORED', 'FAILED')) failed,
308310
count(*) total,
309311
string_agg(task.task_name, ', ') FILTER (WHERE task.status in ('ABORTED', 'ERRORED', 'FAILED')) as failed_task_names,
310-
branch.commit_id IS NULL as needs_rebase,
311312
branch.status as branch_status,
312313
branch.apply_url,
313314
branch.patch_count,

0 commit comments

Comments
 (0)