Skip to content

Commit

Permalink
MTA v7: Add states to provide more details when failure
Browse files Browse the repository at this point in the history
Signed-off-by: gabriel-farache <[email protected]>
  • Loading branch information
gabriel-farache authored and masayag committed Sep 15, 2024
1 parent 754f547 commit 689f31c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
2 changes: 1 addition & 1 deletion mta-v7.x/mta.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 38 additions & 8 deletions mta-v7.x/mta.sw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,15 @@ states:
transition: pollResults
name: taskNotCompleted
- condition: (.taskgroup.state == "Ready" and .taskgroup.tasks[0].state == "Failed")
transition: NotifyFailureBackstage
transition: TaskFailedError
name: taskFailed
defaultCondition:
transition: GetApplicationAnalysis
- name: TaskFailedError
type: inject
data:
exitMessage: '"The 1st task of the taskGroup " + .taskgroup.id + " is in failed state"'
transition: NotifyFailureBackstage
- name: GetApplicationAnalysis
type: operation
actionMode: sequential
Expand Down Expand Up @@ -234,7 +239,12 @@ states:
- condition: (.trackers != null)
transition: GetTracker
defaultCondition:
transition: NotifyFailureBackstage
transition: TrackersDoesNotExistError
- name: TrackersDoesNotExistError
type: inject
data:
exitMessage: '"There are no trackers configured in MTA, cannot export to the issue manager"'
transition: NotifyFailureBackstage
- name: GetTracker
type: operation
actions:
Expand All @@ -252,7 +262,12 @@ states:
- condition: (.tracker != null)
transition: GetTrackerProjects
defaultCondition:
transition: NotifyFailureBackstage
transition: TrackerDoesNotExistError
- name: TrackerDoesNotExistError
type: inject
data:
exitMessage: '"The tracker with the id " + .trackers[0].id + " does not exist, cannot export to the issue manager"'
transition: NotifyFailureBackstage
- name: GetTrackerProjects
type: operation
actions:
Expand All @@ -270,7 +285,12 @@ states:
- condition: (.trackerProjects != null)
transition: GetTrackerProject
defaultCondition:
transition: NotifyFailureBackstage
transition: TrackerProjectsDoesNotExistError
- name: TrackerProjectsDoesNotExistError
type: inject
data:
exitMessage: '"There are no trackerProjects associated with the tracker with the id " + .tracker.id + ", cannot export to the issue manager"'
transition: NotifyFailureBackstage
- name: GetTrackerProject
type: operation
actions:
Expand All @@ -289,7 +309,12 @@ states:
- condition: (.trackerProject != null)
transition: GetTrackerProjectIssueTypes
defaultCondition:
transition: NotifyFailureBackstage
transition: TrackerProjectDoesNotExistError
- name: TrackerProjectDoesNotExistError
type: inject
data:
exitMessage: '"The trackerProject with the id " + .trackerProjects[0].id + " of the tracker with the id " + .tracker.id + " does not exist, cannot export to the issue manager"'
transition: NotifyFailureBackstage
- name: GetTrackerProjectIssueTypes
type: operation
actions:
Expand All @@ -298,7 +323,7 @@ states:
refName: getTrackerProjectIssueTypes
arguments:
id: .tracker.id
id2: .trackerProjects[0].id
id2: .trackerProject.id
actionDataFilter:
toStateData: ".trackerProjectIssueTypes"
transition: TrackerProjectIssueTypesExist
Expand All @@ -308,7 +333,12 @@ states:
- condition: (.trackerProjectIssueTypes != null)
transition: CreateMigrationWave
defaultCondition:
transition: NotifyFailureBackstage
transition: TrackerProjectIssueTypesDoesNotExistError
- name: TrackerProjectIssueTypesDoesNotExistError
type: inject
data:
exitMessage: '"There are no trackerProjectIssueTypes in the trackerProject with the id " + .trackerProject.id + " of the tracker with the id "+ .tracker.id +" does not exist, cannot export to the issue manager"'
transition: NotifyFailureBackstage
- name: CreateMigrationWave
type: operation
actions:
Expand Down Expand Up @@ -415,7 +445,7 @@ states:
entityRef: .recipients
payload:
title: "MTA analysis failed"
description: '"MTA analysis for " + .application.repository.url + " failed. Check logs of task pod: " + .taskgroup.tasks[0].pod'
description: '"MTA analysis for " + .application.repository.url + " failed: " + .exitMessage + ". Check logs of task pod: " + .taskgroup.tasks[0].pod'
topic: "MTA Analysis Workflow"
severity: "critical"
end: true

0 comments on commit 689f31c

Please sign in to comment.