fix: map truncated sentinel check id
This commit is contained in:
@@ -1560,7 +1560,7 @@ function mergeVisibleFindings(primary: readonly Record<string, unknown>[], artif
|
||||
const merged: Record<string, unknown>[] = [];
|
||||
const seen = new Set<string>();
|
||||
for (const item of [...primary, ...artifact]) {
|
||||
const id = findingIdentity(item);
|
||||
const id = canonicalFindingIdentity(item);
|
||||
const key = id ?? `${JSON.stringify(item).slice(0, 160)}:${stringOrNull(item.severity) ?? stringOrNull(item.level) ?? ""}`;
|
||||
if (seen.has(key)) continue;
|
||||
seen.add(key);
|
||||
@@ -1570,6 +1570,15 @@ function mergeVisibleFindings(primary: readonly Record<string, unknown>[], artif
|
||||
return merged;
|
||||
}
|
||||
|
||||
function canonicalFindingIdentity(item: Record<string, unknown>): string | null {
|
||||
const check = record(item.check);
|
||||
return stringOrNull(item.checkCode)
|
||||
?? stringOrNull(check.code)
|
||||
?? stringOrNull(item.checkId)
|
||||
?? stringOrNull(check.id)
|
||||
?? findingIdentity(item);
|
||||
}
|
||||
|
||||
function findingIdentity(item: Record<string, unknown>): string | null {
|
||||
return stringOrNull(item.finding_id)
|
||||
?? stringOrNull(item.findingId)
|
||||
|
||||
Reference in New Issue
Block a user