Skip to content

Commit

Permalink
FAI-13875 Wolken - Handle non str desc and fix inc-app impact (#1909)
Browse files Browse the repository at this point in the history
  • Loading branch information
ypc-faros authored Feb 4, 2025
1 parent 457db00 commit b4d5c16
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class Incidents extends WolkenConverter {
record: {
...incidentKey,
title: incident.subject,
description: Utils.cleanAndTruncate(incident.description),
description: typeof incident.description === 'string' ? Utils.cleanAndTruncate(incident.description) : null,
// TODO: Add severity
priority: this.getPriority(incident.priorityName) ?? null,
status: this.getStatus(incident.statusName) ?? null,
Expand All @@ -75,10 +75,11 @@ export class Incidents extends WolkenConverter {
});
}

if (!this.incidentCI.has(incidentKey.uid)) {
this.incidentCI.set(incidentKey.uid, new Set());
}

for (const ci of incident.ciRequestList ?? []) {
if (!this.incidentCI.has(incidentKey.uid)) {
this.incidentCI.set(incidentKey.uid, new Set());
}
this.incidentCI.get(incidentKey.uid).add(ci.ciId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ Array [

exports[`wolken incidents incident application impact 1`] = `
Array [
"Processed 2 records",
"Processed records by stream: {\\\\\\"mytestsource__wolken__configuration_items\\\\\\":1,\\\\\\"mytestsource__wolken__incidents\\\\\\":1}\\"},\\"type\\":\\"LOG\\"}",
"Would write 6 records",
"Would write records by model: {\\\\\\"__Flush\\\\\\":1,\\\\\\"compute_Application\\\\\\":1,\\\\\\"ims_Incident\\\\\\":1,\\\\\\"ims_IncidentApplicationImpact\\\\\\":1,\\\\\\"ims_IncidentApplicationImpact__Deletion\\\\\\":1,\\\\\\"ims_IncidentAssignment\\\\\\":1}\\"},\\"type\\":\\"LOG\\"}",
"Processed 3 records",
"Processed records by stream: {\\\\\\"mytestsource__wolken__configuration_items\\\\\\":1,\\\\\\"mytestsource__wolken__incidents\\\\\\":2}\\"},\\"type\\":\\"LOG\\"}",
"Would write 8 records",
"Would write records by model: {\\\\\\"__Flush\\\\\\":1,\\\\\\"compute_Application\\\\\\":1,\\\\\\"ims_Incident\\\\\\":2,\\\\\\"ims_IncidentApplicationImpact\\\\\\":1,\\\\\\"ims_IncidentApplicationImpact__Deletion\\\\\\":2,\\\\\\"ims_IncidentAssignment\\\\\\":1}\\"},\\"type\\":\\"LOG\\"}",
"Skipped 0 records",
"Errored 0 records",
]
Expand All @@ -120,6 +120,25 @@ Array [
"uid": "Test App_unknown",
},
},
Object {
"ims_Incident": Object {
"createdAt": "2025-01-08T09:54:48.000Z",
"description": "Support notification incident requiring investigation",
"priority": Object {
"category": "Low",
"detail": "Low - P4",
},
"resolvedAt": "2025-01-23T09:02:12.000Z",
"source": "Wolken",
"status": Object {
"category": "Resolved",
"detail": "Closed",
},
"title": "Inc_Support_Notification",
"uid": "123457",
"updatedAt": "2025-01-23T09:02:39.000Z",
},
},
Object {
"ims_Incident": Object {
"createdAt": "2025-01-08T09:54:48.000Z",
Expand Down Expand Up @@ -152,6 +171,18 @@ Array [
"source": "Wolken",
},
},
Object {
"ims_IncidentApplicationImpact__Deletion": Object {
"flushRequired": false,
"source": "Wolken",
"where": Object {
"incident": Object {
"source": "Wolken",
"uid": "123457",
},
},
},
},
Object {
"ims_IncidentApplicationImpact__Deletion": Object {
"flushRequired": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{"record":{"stream":"mytestsource__wolken__incidents","emitted_at":1737738990250,"data":{"ticketId":123456,"ticketFormattedId":"INC123456","originId":100,"originName":"Virtual Agent","subject":"Inc_Support_Notification","createdTime":"2025-01-08T09:54:48.000Z","requesterId":10001,"requesterName":"John Smith","creatorId":10001,"creatorName":"John Smith","unitId":1,"unitName":"IT Service Management","categoryId":1,"categoryName":"N/A","subCategoryId":1,"subCategoryName":"N/A","itemId":1,"itemName":"Generic Ticket Creation","teamId":20001,"teamName":"Cloud Support Team","priorityId":4,"priorityName":"Low - P4","impactId":2,"impactName":"Medium","urgencyId":3,"urgencyName":"Low","assignedUserId":10002,"assignedUserName":"Jane Doe","assignedUserPsNo":"[email protected]","updatedTimestamp":"2025-01-23T09:02:39.000Z","statusName":"Closed","subStatusName":"Closed","statusId":3,"subStatusId":3,"lastUpdatedByUser":"Bob Wilson","lastUpdatedByUserId":10003,"plannedStartDate":"","plannedEndDate":"","closedByUserID":10003,"closureTimeStamp":"2025-01-23 09:02:39","resolvedByUserID":10003,"resolvedByUserEmail":"[email protected]","resolvedByUserName":"Bob Wilson","resolutionTimeStamp":"2025-01-23T09:02:12.000Z","description":"Support notification incident requiring investigation","attachments":[],"flexFields":[{"flexId":12,"flexName":"Building","flexValue":"100 Main Street"}],"internalWatchers":[],"externalWatchers":[],"ciRequestList":[{"pkey":10000,"ciId":100,"ciName":"Mobile Platform","ciTypeId":1,"ciTypeName":"Applications"}],"teamMapping":{}}},"type":"RECORD"}
{"record":{"stream":"mytestsource__wolken__configuration_items","emitted_at":1738253745786,"data":{"ciId":100,"flexFields":[{"flexId":1,"flexName":"Service ID","flexValue":"A3F91B6D"},{"flexId":2,"flexName":"JIRA Key","flexValue":"FAROS"},{"flexId":3,"flexName":"Environment","flexValue":"Production"},{"flexId":4,"flexName":"Engineering Owner","flexValue":"[email protected]"}],"urgency":{"urgencyId":3}}},"type":"RECORD"}
{"record":{"stream":"mytestsource__wolken__incidents","emitted_at":1737738990250,"data":{"ticketId":123457,"ticketFormattedId":"INC123457","originId":100,"originName":"Virtual Agent","subject":"Inc_Support_Notification","createdTime":"2025-01-08T09:54:48.000Z","requesterId":10001,"requesterName":"John Smith","creatorId":10001,"creatorName":"John Smith","unitId":1,"unitName":"IT Service Management","categoryId":1,"categoryName":"N/A","subCategoryId":1,"subCategoryName":"N/A","itemId":1,"itemName":"Generic Ticket Creation","teamId":20001,"teamName":"Cloud Support Team","priorityId":4,"priorityName":"Low - P4","impactId":2,"impactName":"Medium","urgencyId":3,"urgencyName":"Low","updatedTimestamp":"2025-01-23T09:02:39.000Z","statusName":"Closed","subStatusName":"Closed","statusId":3,"subStatusId":3,"lastUpdatedByUser":"Bob Wilson","lastUpdatedByUserId":10003,"plannedStartDate":"","plannedEndDate":"","closedByUserID":10003,"closureTimeStamp":"2025-01-23 09:02:39","resolvedByUserID":10003,"resolvedByUserEmail":"[email protected]","resolvedByUserName":"Bob Wilson","resolutionTimeStamp":"2025-01-23T09:02:12.000Z","description":"Support notification incident requiring investigation","attachments":[],"flexFields":[{"flexId":12,"flexName":"Building","flexValue":"100 Main Street"}],"internalWatchers":[],"externalWatchers":[],"ciRequestList":[],"teamMapping":{}}},"type":"RECORD"}

0 comments on commit b4d5c16

Please sign in to comment.