fix(governance): link callback work item back to queue
All checks were successful
CD Pipeline / tests (push) Successful in 1m8s
Code Review / ai-code-review (push) Successful in 14s
CD Pipeline / build-and-deploy (push) Successful in 4m26s
CD Pipeline / post-deploy-checks (push) Successful in 1m32s

This commit is contained in:
Your Name
2026-05-25 08:27:06 +08:00
parent 390b13e873
commit 73aad41359
4 changed files with 17 additions and 2 deletions

View File

@@ -1195,6 +1195,13 @@ def _km_stale_callback_owner_review_work_item(
"callback_reply_status": "sent",
}
)
work_item_query = urlencode(
{
"project_id": project_id,
"work_item_id": work_item_id,
"incident_id": incident_id,
}
)
return {
"schema_version": "km_stale_callback_owner_review_work_item_v1",
"work_item_id": work_item_id,
@@ -1207,6 +1214,7 @@ def _km_stale_callback_owner_review_work_item(
"next_step": "review_or_queue_km_owner_review",
"target_surface": "awooop_runs_callback_evidence",
"target_href": f"/awooop/runs?{target_query}",
"work_item_href": f"/awooop/work-items?{work_item_query}",
"writes_on_read": False,
"manual_review_required": True,
"batch_writes_allowed": False,

View File

@@ -573,6 +573,11 @@ def test_km_stale_completion_summary_generates_owner_review_work_item() -> None:
"&incident_id=INC-20260524-16109D"
"&callback_reply_status=sent"
),
"work_item_href": (
"/awooop/work-items?project_id=awoooi"
"&work_item_id=km-callback-owner-review%3Aawoooi%3AINC-20260524-16109D"
"&incident_id=INC-20260524-16109D"
),
"writes_on_read": False,
"manual_review_required": True,
"batch_writes_allowed": False,

View File

@@ -306,6 +306,7 @@ interface KmStaleCallbackOwnerReviewWorkItem {
next_step?: string | null;
target_surface?: string | null;
target_href?: string | null;
work_item_href?: string | null;
writes_on_read?: boolean | null;
manual_review_required?: boolean | null;
batch_writes_allowed?: boolean | null;
@@ -1530,9 +1531,9 @@ function CallbackKmCompletionSummary({
) : (
<p className="text-[#77736a]">{t("noRelated")}</p>
)}
{workItem?.target_href ? (
{workItem?.work_item_href || workItem?.target_href ? (
<Link
href={workItem.target_href as never}
href={(workItem.work_item_href ?? workItem.target_href) as never}
className="mt-1 inline-flex w-fit items-center gap-1.5 border border-[#d8d3c7] bg-[#faf9f3] px-2 py-1 text-xs font-semibold text-[#2e2b26] hover:border-[#d97757] hover:text-[#8a4a2f]"
>
<SearchCheck className="h-3.5 w-3.5" aria-hidden="true" />

View File

@@ -783,6 +783,7 @@ type KmStaleCallbackOwnerReviewWorkItem = {
next_step?: string | null;
target_surface?: string | null;
target_href?: string | null;
work_item_href?: string | null;
writes_on_read?: boolean | null;
manual_review_required?: boolean | null;
batch_writes_allowed?: boolean | null;