Skip to content

Commit

Permalink
[ci] use two-level header for more succinct table (hail-is#11447)
Browse files Browse the repository at this point in the history
* [ci] use two-level header for more succinct table

* remove unnecessary newline

* fix

* fix jinja2

* Update pr-table.html

* Update pr-table.html
  • Loading branch information
danking authored Mar 3, 2022
1 parent 9e694a6 commit 7657cc7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
3 changes: 3 additions & 0 deletions ci/ci/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class WatchedBranchConfig(TypedDict):
deploy_state: Optional[str]
repo: str
prs: List[PRConfig]
gh_status_names: Set[str]


async def watched_branch_config(app, wb: WatchedBranch, index: int) -> WatchedBranchConfig:
Expand All @@ -105,6 +106,7 @@ async def watched_branch_config(app, wb: WatchedBranch, index: int) -> WatchedBr
else:
pr_configs = []
# FIXME recent deploy history
gh_status_names = {k for pr in pr_configs for k in pr['gh_statuses'].keys()}
return {
'index': index,
'branch': wb.branch.short_str(),
Expand All @@ -114,6 +116,7 @@ async def watched_branch_config(app, wb: WatchedBranch, index: int) -> WatchedBr
'deploy_state': wb.deploy_state,
'repo': wb.branch.repo.short_str(),
'prs': pr_configs,
'gh_status_names': gh_status_names,
}


Expand Down
29 changes: 15 additions & 14 deletions ci/ci/templates/pr-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
<table id="{{ id }}" class="data-table">
<thead>
<tr>
<th>PR</th>
<th>Build State</th>
<th>Github Statuses</th>
<th>Labels</th>
<th>Branch</th>
<th>Review State</th>
<th>Author</th>
<th rowspan="2">PR</th>
<th rowspan="2">Build State</th>
<th colspan="{{ wb.gh_status_names | length }}">GitHub Statuses</th>
<th rowspan="2">Labels</th>
<th rowspan="2">Branch</th>
<th rowspan="2">Review State</th>
<th rowspan="2">Author</th>
</tr>
<tr>
{% for name in wb.gh_status_names %}
<th>{{ name }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
Expand All @@ -31,13 +36,9 @@
*
{% endif %}
</td>
<td>
<ol>
{% for context, status in pr['gh_statuses'].items() %}
<li>{{ context }}: {{ status }}</li>
{% endfor %}
</ol>
</td>
{% for name in wb.gh_status_names %}
<td>{{ pr['gh_statuses'][name] | default("") }}</td>
{% endfor %}
<td>
{{ pr.labels|join(", ") }}
</td>
Expand Down

0 comments on commit 7657cc7

Please sign in to comment.