feat(external-pr): surface in-flight reviews in the panel, not just completed

The PR-review queue only listed COMPLETED reviews and hid when empty, so while
a review was in_progress the panel showed nothing — no sign a review was
happening or where its findings go (the reviewer posts its change-request on
the PR itself). Add TaskService.list_external_pr_reviews (active reviews +
awaiting-decision, minus cancelled/decided/dismissed); the route uses it. The
panel card now shows active reviews with a 'Reviewing' badge and a link to the
PR where the change-request lands, and the Supersede/Dismiss actions only once
the review completes.
This commit is contained in:
Renn F
2026-06-17 07:16:49 +02:00
parent bca3b073ac
commit 9cc63125d2
4 changed files with 126 additions and 59 deletions
@@ -76,6 +76,17 @@ async def test_list_awaiting_decision_excludes_dismissed() -> None:
assert out == [pending]
@pytest.mark.asyncio
async def test_list_external_pr_reviews_excludes_dismissed() -> None:
# The panel queue surfaces in-flight reviews too (the status filter lives in
# SQL); here we pin the post-query behavior: dismissed reviews drop out.
reviewing = MagicMock(quick_context="external_pr_head=abc")
dismissed = MagicMock(quick_context="external_pr_head=def dismissed=1")
svc = _service([reviewing, dismissed])
out = await svc.list_external_pr_reviews()
assert out == [reviewing]
@pytest.mark.asyncio
async def test_dismiss_marks_and_is_idempotent() -> None:
task = MagicMock(source="external_pr", quick_context="external_pr_head=abc")