feat(awooop): expose source refs on incidents
All checks were successful
Code Review / ai-code-review (push) Successful in 11s
CD Pipeline / tests (push) Successful in 3m58s
CD Pipeline / build-and-deploy (push) Successful in 3m36s
CD Pipeline / post-deploy-checks (push) Successful in 1m20s

This commit is contained in:
Your Name
2026-05-20 15:35:13 +08:00
parent a60896bd78
commit 3aa90b8ecf
6 changed files with 150 additions and 0 deletions

View File

@@ -88,6 +88,31 @@ export interface AwoooPStatusChain {
}>;
};
};
source_refs?: {
inbound_total?: number | null;
outbound_total?: number | null;
inbound_channels?: string[];
refs?: {
alert_ids?: string[];
sentry_issue_ids?: string[];
signoz_alerts?: string[];
fingerprints?: string[];
incident_ids?: string[];
};
latest_inbound?: {
channel_type?: string | null;
provider_event_id?: string | null;
content_type?: string | null;
is_duplicate?: boolean | null;
received_at?: string | null;
};
latest_outbound?: {
channel_type?: string | null;
message_type?: string | null;
send_status?: string | null;
sent_at?: string | null;
};
};
}
function toneClass(chain?: AwoooPStatusChain | null) {

View File

@@ -380,6 +380,22 @@ export function IncidentCard({ incident, decision, statusChain, onApprovalChange
playbook: executionPlaybook,
})
: null
const sourceRefs = statusChain?.source_refs
const latestSource = sourceRefs?.latest_inbound?.channel_type
? `${sourceRefs.latest_inbound.channel_type}/${chainValue(sourceRefs.latest_inbound.provider_event_id)}`
: sourceRefs?.latest_outbound?.channel_type
? `${sourceRefs.latest_outbound.channel_type}/${chainValue(sourceRefs.latest_outbound.message_type)}`
: '--'
const statusChainSourceRefDetail = hasTruthChain
? t('flowSourceRefsDetail', {
inbound: sourceRefs?.inbound_total ?? 0,
outbound: sourceRefs?.outbound_total ?? 0,
alert: sourceRefs?.refs?.alert_ids?.length ?? 0,
sentry: sourceRefs?.refs?.sentry_issue_ids?.length ?? 0,
signoz: sourceRefs?.refs?.signoz_alerts?.length ?? 0,
latest: latestSource,
})
: null
const serviceName = incident.affected_services?.[0] ?? '--'
const duration = formatDuration(incident.created_at)
@@ -659,6 +675,10 @@ export function IncidentCard({ incident, decision, statusChain, onApprovalChange
<span data-testid="incident-execution-evidence" style={{ color: '#555550' }}>
{statusChainExecutionDetail}
</span>
<span style={{ color: '#b0ad9f' }}>/</span>
<span data-testid="incident-source-ref-evidence" style={{ color: '#555550' }}>
{statusChainSourceRefDetail}
</span>
</>
)}
</div>