Skip to content

Commit f09a36e

Browse files
authored
Hide inactive Copilot reviewers from the PR dashboard (#479)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4e5e0e0c-672d-47ce-a574-c14cd922e235 Copilot-Session: c9399e63-6f28-4efb-a756-5982e91179d6
1 parent 90ab223 commit f09a36e

4 files changed

Lines changed: 79 additions & 5 deletions

File tree

‎.github/scripts/pull-request-dashboard/RATIONALE.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,10 @@ the implementation understandable and operationally cheap.
530530
stale review is the ordinary state between a push and the next re-review, and
531531
an icon that is always present says nothing about which PRs are actually
532532
waiting.
533+
- Copilot appears in the reviewers column only for unresolved inline feedback
534+
or a pending review that holds the PR. It reviews nearly every PR, so completed
535+
participation alone adds noise rather than identifying work that remains.
536+
This is a display filter only; review state and routing still use all feedback.
533537
- An effective reviewer-routing override is a break-glass handoff. It bypasses
534538
required checks, Copilot review, merge conflicts, and discussion actions across
535539
later pushes. The approval threshold determines whether it waits on reviewers

‎.github/scripts/pull-request-dashboard/render.py‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,15 @@ def copilot_review_pending(facts: DashboardFacts) -> bool:
185185

186186

187187
def display_reviewers(facts: DashboardFacts) -> list[ReviewerSummary]:
188-
# Copilot only joins the reviewer list once it has reviewed, so a review
189-
# that is still in flight has to be added for the wait to be visible at all.
190-
reviewers = list(facts.reviewers)
191-
if not copilot_review_pending(facts):
188+
copilot_pending = copilot_review_pending(facts)
189+
reviewers = [
190+
reviewer
191+
for reviewer in facts.reviewers
192+
if not is_copilot_reviewer_login(reviewer.login)
193+
or reviewer.unresolved_thread
194+
or copilot_pending
195+
]
196+
if not copilot_pending:
192197
return reviewers
193198
for reviewer in reviewers:
194199
if is_copilot_reviewer_login(reviewer.login):

‎.github/scripts/pull-request-dashboard/test_render.py‎

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,57 @@ def test_human_rereview_keeps_the_changes_requested_badge(self) -> None:
8686

8787
self.assertEqual("reviewer&nbsp;⏳\u2060🔴", cell)
8888

89+
def test_copilot_without_unresolved_feedback_is_hidden(self) -> None:
90+
for login in (
91+
"copilot",
92+
"Copilot",
93+
"copilot[bot]",
94+
"copilot-pull-request-reviewer",
95+
"copilot-pull-request-reviewer[bot]",
96+
):
97+
for status in (
98+
{},
99+
{"approved": True},
100+
{"approved_non_team": True},
101+
{"changes_requested": True},
102+
{"top_level_feedback": True},
103+
{"pending_review": True},
104+
):
105+
with self.subTest(login=login, status=status):
106+
cell = reviewers_cell_text(dashboard_facts(
107+
reviewers=[
108+
{"login": login, **status},
109+
{"login": "reviewer"},
110+
],
111+
copilot_review_exists=True,
112+
))
113+
114+
self.assertEqual("reviewer", cell)
115+
116+
def test_copilot_with_unresolved_feedback_remains_visible(self) -> None:
117+
for login in (
118+
"copilot",
119+
"Copilot",
120+
"copilot[bot]",
121+
"copilot-pull-request-reviewer",
122+
"copilot-pull-request-reviewer[bot]",
123+
):
124+
with self.subTest(login=login):
125+
cell = reviewers_cell_text(dashboard_facts(
126+
reviewers=[{"login": login, "unresolved_thread": True}],
127+
))
128+
129+
self.assertEqual("Copilot&nbsp;💬", cell)
130+
131+
def test_copilot_is_hidden_after_its_last_thread_is_resolved(self) -> None:
132+
cell = reviewers_cell_text(dashboard_facts(
133+
reviewers=[{"login": "copilot-pull-request-reviewer"}],
134+
copilot_review_exists=True,
135+
copilot_review_outstanding=True,
136+
))
137+
138+
self.assertEqual("", cell)
139+
89140
def test_requested_copilot_review_is_listed_as_pending(self) -> None:
90141
cell = reviewers_cell_text(dashboard_facts(
91142
reviewers=[{"login": "reviewer", "approved": True}],
@@ -95,12 +146,25 @@ def test_requested_copilot_review_is_listed_as_pending(self) -> None:
95146

96147
self.assertEqual("Copilot&nbsp;⏳<br>reviewer&nbsp;✅", cell)
97148

149+
def test_requested_copilot_review_keeps_its_entry_without_open_feedback(self) -> None:
150+
cell = reviewers_cell_text(dashboard_facts(
151+
reviewers=[{"login": "Copilot"}],
152+
copilot_review_exists=True,
153+
copilot_review_outstanding=True,
154+
copilot_review_requested=True,
155+
))
156+
157+
self.assertEqual("Copilot&nbsp;⏳", cell)
158+
98159
def test_requested_copilot_review_on_an_ungated_branch_is_not_pending(self) -> None:
99160
# Nothing holds the pull request there, and a requested human reviewer
100161
# who has not responded is left off the row, so Copilot gets no row
101162
# either. The gate is what makes the wait someone's turn.
102163
cell = reviewers_cell_text(dashboard_facts(
103-
reviewers=[{"login": "reviewer", "approved": True}],
164+
reviewers=[
165+
{"login": "copilot-pull-request-reviewer"},
166+
{"login": "reviewer", "approved": True},
167+
],
104168
copilot_review_outstanding=False,
105169
copilot_review_requested=True,
106170
))

‎pull-request-dashboard/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ The dashboard groups open non-draft pull requests by who is expected to act next
108108
- 🔴 requested changes
109109
- ⏳ a review is in flight (a human reviewer other than the effective author was requested again after reviewing, or a Copilot review is pending while it holds the PR)
110110
- Icons combine when multiple states apply. For example, 💬📌 means the reviewer has unresolved inline feedback and top-level feedback that still needs author action; ✅ may accompany either or both.
111+
- Copilot appears only with unresolved inline feedback (💬) or a pending review that holds the PR (⏳). Completed reviews alone do not add Copilot to the column.
111112
- **CI** — Aggregate check status across the PR's required status checks. Optional checks do not affect this column:
112113
- ✅ all required checks passing
113114
- ⏳ at least one required check pending, none failing

0 commit comments

Comments
 (0)