From 7657cc7a8b455ff2669e0c1899592fbb9cd7bfdb Mon Sep 17 00:00:00 2001 From: Dan King Date: Thu, 3 Mar 2022 10:32:32 -0500 Subject: [PATCH] [ci] use two-level header for more succinct table (#11447) * [ci] use two-level header for more succinct table * remove unnecessary newline * fix * fix jinja2 * Update pr-table.html * Update pr-table.html --- ci/ci/ci.py | 3 +++ ci/ci/templates/pr-table.html | 29 +++++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/ci/ci/ci.py b/ci/ci/ci.py index 483c6008b1f..3967714de72 100644 --- a/ci/ci/ci.py +++ b/ci/ci/ci.py @@ -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: @@ -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(), @@ -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, } diff --git a/ci/ci/templates/pr-table.html b/ci/ci/templates/pr-table.html index 428f7bcf1ec..8e1339ba3f3 100644 --- a/ci/ci/templates/pr-table.html +++ b/ci/ci/templates/pr-table.html @@ -4,13 +4,18 @@ - - - - - - - + + + + + + + + + + {% for name in wb.gh_status_names %} + + {% endfor %} @@ -31,13 +36,9 @@ * {% endif %} - + {% for name in wb.gh_status_names %} + + {% endfor %}
PRBuild StateGithub StatusesLabelsBranchReview StateAuthorPRBuild StateGitHub StatusesLabelsBranchReview StateAuthor
{{ name }}
-
    - {% for context, status in pr['gh_statuses'].items() %} -
  1. {{ context }}: {{ status }}
  2. - {% endfor %} -
-
{{ pr['gh_statuses'][name] | default("") }} {{ pr.labels|join(", ") }}