Skip to content

Commit 53d9ed6

Browse files
committed
fix deduplucation
1 parent 9c18d71 commit 53d9ed6

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

ado-importer.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -901,20 +901,20 @@ function populateDuplicateDetectionData(existingWorkItems, duplicateDetectionDat
901901
const workItemId = workItem.id;
902902
const workItemState = workItem.fields['System.State'] || 'Unknown';
903903

904-
// Extract Veracode Flaw ID from title
905-
const veracodeFlawId = getVeracodeFlawIDFromTitle(title);
906-
if (!veracodeFlawId) {
907-
if (debug === 'true') {
908-
console.log(`No Veracode Flaw ID found in title: "${title}"`);
909-
}
910-
return;
911-
}
912-
913904
if (debug === 'true') {
914-
console.log(`Processing existing work item ${workItemId}: "${title}" -> Veracode ID: ${veracodeFlawId}`);
905+
console.log(`Processing existing work item ${workItemId}: "${title}"`);
915906
}
916907

917908
if (scanType === 'pipeline') {
909+
// Extract Veracode Flaw ID from title for pipeline scans
910+
const veracodeFlawId = getVeracodeFlawIDFromTitle(title);
911+
if (!veracodeFlawId) {
912+
if (debug === 'true') {
913+
console.log(`No Veracode Flaw ID found in title: "${title}"`);
914+
}
915+
return;
916+
}
917+
918918
// Parse pipeline flaw ID: [VID:CWE:filename:linenum]
919919
const flawInfo = parseVeracodeFlawID(veracodeFlawId);
920920
if (flawInfo && flawInfo.file) {
@@ -953,7 +953,11 @@ function populateDuplicateDetectionData(existingWorkItems, duplicateDetectionDat
953953
duplicateDetectionData.existingIssueStates[flawId] = workItemState;
954954

955955
if (debug === 'true') {
956-
console.log(`Added policy flaw data: FlawId=${flawId}, WorkItem=${workItemId}`);
956+
console.log(`✅ Added policy flaw data: FlawId=${flawId}, WorkItem=${workItemId}`);
957+
}
958+
} else {
959+
if (debug === 'true') {
960+
console.log(`❌ Failed to extract flaw ID from title: "${title}"`);
957961
}
958962
}
959963
}

0 commit comments

Comments
 (0)