Skip to content

Commit

Permalink
MTA V7: create app for each run
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-farache committed Aug 1, 2024
1 parent 2fdaa42 commit a2d0c4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 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.
27 changes: 4 additions & 23 deletions mta-v7.x/mta.sw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: "1.0"
timeouts:
workflowExecTimeout:
duration: PT1H
start: GetApplication
start: CreateApplication
dataInputSchema:
schema: schemas/mta-input.json
failOnValidationErrors: false
Expand Down Expand Up @@ -69,25 +69,6 @@ functions:
operation: .applicationAnalysis | [select (.issues[].category!="mandatory")][0] | [.issues[]?.incidents //[]] | .[-1][-1].id

states:
- name: GetApplication
type: operation
actionMode: sequential
actions:
- name: getApp
functionRef: getApplication
actionDataFilter:
toStateData: ".applications"
stateDataFilter:
output: "{recipients: .recipients, repositoryURL: .repositoryURL, migrationStartDatetime: .migrationStartDatetime, migrationEndDatetime: .migrationEndDatetime, exportToIssueManager: .exportToIssueManager, application: .repositoryURL as $r| if .applications == null then null else .applications|map(select(.repository.url == $r))[0] end}"
transition: AppExist
- name: AppExist
type: switch
dataConditions:
- condition: ".application != null"
transition:
nextState: CreateTaskgroup
defaultCondition:
transition: CreateApplication
- name: CreateApplication
type: operation
actions:
Expand All @@ -97,7 +78,7 @@ states:
functionRef:
refName: createApplication
arguments:
name: ".repositoryURL"
name: '$WORKFLOW.instanceId + "_" + .repositoryURL'
repository:
url: ".repositoryURL"
kind: git
Expand Down Expand Up @@ -434,7 +415,7 @@ states:
entityRef: .recipients
payload:
title: "MTA analysis completed"
description: '"MTA analysis is completed and the report for " + .application.repository.url + " is ready."'
description: '"MTA analysis is completed and the report for " + .application.repository.url + " is ready." + (if .migrationWaveJiraTicket != null then "Application was exported to issue manager" else "" end)'
topic: "MTA Analysis Workflow"
link: '$SECRET.mta.url + "/hub/applications/" + (.application.id|tostring) + "/analysis/report"'
severity: "normal"
Expand All @@ -455,7 +436,7 @@ states:
entityRef: .recipients
payload:
title: "MTA analysis completed with incidents in mandatory issues."
description: '"MTA analysis for " + .application.repository.url + " completed with " + (.application.mandatoriesIncidents|tostring) +" incidents in mandatories issues. Check the analysis report."'
description: '"MTA analysis for " + .application.repository.url + " completed with " + (.application.mandatoriesIncidents|tostring) +" incidents in mandatories issues. Check the analysis report." + (if .migrationWaveJiraTicket != null then "Application was exported to issue manager." else "" end)'
topic: "MTA Analysis Workflow"
link: '$SECRET.mta.url + "/hub/applications/" + (.application.id|tostring) + "/analysis/report"'
severity: "high"
Expand Down

0 comments on commit a2d0c4d

Please sign in to comment.