| null;
+ if (
+ row?.version !== 1 ||
+ typeof row.pullRequest?.repository !== "string" ||
+ row.pullRequest.repository.toLowerCase() !== link.repository.toLowerCase() ||
+ row.pullRequest.number !== link.number ||
+ !commitSha.test(row.pullRequest.head) ||
+ (row.candidate !== null &&
+ (typeof row.candidate !== "string" || !commitSha.test(row.candidate))) ||
+ typeof row.qa?.status !== "string" ||
+ typeof row.ci?.status !== "string"
+ )
+ return null;
+ return row as PullRequestDelivery;
+ } catch {
+ return null;
+ }
+}
+
+function PullRequestEvidence({ delivery }: { delivery: PullRequestDelivery }) {
+ const { pullRequest, candidate, qa, ci } = delivery;
+ const fields = [
+ ["Current PR commit", pullRequest.head],
+ ["Verified candidate", candidate ?? "No managed candidate"],
+ ["QA reviewed commit", qa.head ?? "Unavailable"],
+ ["Independent QA", qa.freshness === "stale" ? `${qa.status} (stale)` : qa.status],
+ ["CI tested commit", ci.head ?? "Unavailable"],
+ ["CI", ci.head && ci.head !== pullRequest.head ? "stale" : ci.status],
+ ];
+ return (
+
+
+ {pullRequest.repository} #{pullRequest.number}
+
+
+ {fields.map(([label, value]) => (
+
+
- {label}
+ - {value}
+
+ ))}
+
+
+ );
+}
+
function DeliveryPage() {
const router = useRouter();
const navigate = useNavigate({ from: Route.fullPath });
- const { ticket } = Route.useSearch();
- const delivery = Route.useLoaderData();
+ const { ticket, pr } = Route.useSearch();
+ const { delivery, pullRequestDelivery } = Route.useLoaderData();
const loading = useRouterState({ select: (state) => state.isLoading });
const ciStatus =
delivery?.ci.status === "passed" && delivery.ci.head !== delivery.pullRequest.head
@@ -124,6 +191,46 @@ function DeliveryPage() {
Open ticket
+
+ {pr && (loading || !pullRequestDelivery) && (
+
+ {loading
+ ? "Reading pull request evidence…"
+ : "Pull request evidence unavailable. Check GitHub access and the sidecar connection."}
+
+ )}
+ {pullRequestDelivery && !loading && }
{ticket && (loading || !delivery) && (
{loading ? "Reading delivery evidence…" : "Delivery sidecar unavailable."}
@@ -157,14 +264,25 @@ function DeliveryPage() {
}
export const Route = createFileRoute("/_chat/delivery")({
- validateSearch: (search: Record) => ({
+ validateSearch: (
+ search: Record,
+ ): { ticket?: string | undefined; pr?: string | undefined } => ({
ticket:
typeof search.ticket === "string" && validTicket.test(search.ticket)
? search.ticket
: undefined,
+ pr:
+ typeof search.pr === "string" && parseDeliveryPullRequestUrl(search.pr)
+ ? search.pr
+ : undefined,
+ }),
+ loaderDeps: ({ search }) => ({ ticket: search.ticket, pr: search.pr }),
+ loader: async ({ abortController, deps }) => ({
+ delivery:
+ !deps.pr && deps.ticket ? await readDelivery(deps.ticket, abortController.signal) : null,
+ pullRequestDelivery: deps.pr
+ ? await readPullRequestDelivery(deps.pr, abortController.signal)
+ : null,
}),
- loaderDeps: ({ search }) => ({ ticket: search.ticket }),
- loader: ({ abortController, deps }) =>
- deps.ticket ? readDelivery(deps.ticket, abortController.signal) : null,
component: DeliveryPage,
});
From 8526776ccc95af34a0efe589947e4a389d017e53 Mon Sep 17 00:00:00 2001
From: InTheta <17220028+InTheta@users.noreply.github.com>
Date: Mon, 16 Nov 2026 08:57:56 +0000
Subject: [PATCH 4/4] Show stale CI while the current PR check runs
---
apps/web/src/routes/_chat.delivery.tsx | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/apps/web/src/routes/_chat.delivery.tsx b/apps/web/src/routes/_chat.delivery.tsx
index b6874fda8cf8c..b91976696e732 100644
--- a/apps/web/src/routes/_chat.delivery.tsx
+++ b/apps/web/src/routes/_chat.delivery.tsx
@@ -69,6 +69,7 @@ interface PullRequestDelivery {
candidate: string | null;
qa: { status: string; head?: string; freshness?: string };
ci: { status: string; head?: string; runId?: number };
+ previousCi?: { status: string; head: string; runId?: number } | null;
}
async function readPullRequestDelivery(value: string, signal: AbortSignal) {
@@ -109,6 +110,15 @@ function PullRequestEvidence({ delivery }: { delivery: PullRequestDelivery }) {
["Independent QA", qa.freshness === "stale" ? `${qa.status} (stale)` : qa.status],
["CI tested commit", ci.head ?? "Unavailable"],
["CI", ci.head && ci.head !== pullRequest.head ? "stale" : ci.status],
+ ...(delivery.previousCi && delivery.previousCi.head !== pullRequest.head
+ ? [
+ ["Previous CI commit", delivery.previousCi.head],
+ [
+ "Previous CI",
+ delivery.previousCi.runId ? `stale · run ${delivery.previousCi.runId}` : "stale",
+ ],
+ ]
+ : []),
];
return (