@@ -6501,8 +6501,7 @@ func diffWorkflows(oldWorkflow Workflow, parentWorkflow Workflow, update bool) {
65016501 parentWorkflowEnvironment = "Shuffle"
65026502 }
65036503
6504- // for actionIndex, action := range parentWorkflow.Actions {
6505- for _, action := range parentWorkflow.Actions {
6504+ for actionIndex, action := range parentWorkflow.Actions {
65066505 if len(action.Environment) > 0 {
65076506 discoveredEnvironment = action.Environment
65086507 }
@@ -6511,24 +6510,24 @@ func diffWorkflows(oldWorkflow Workflow, parentWorkflow Workflow, update bool) {
65116510 // authenticationIDs. Let's just remove it for now.
65126511
65136512 // In case of replication,
6514- // parentWorkflow.Actions[actionIndex].AuthenticationId = ""
6515-
6516- // idFound := false
6517- // for _, oldWorkflowAction := range oldWorkflow.Actions {
6518- // if oldWorkflowAction.ID == action.ID {
6519- // idFound = true
6520- // parentWorkflow.Actions[actionIndex].AuthenticationId = oldWorkflowAction.AuthenticationId
6521- // }
6522- // }
6523-
6524- // if !idFound {
6525- // for _, oldWorkflowAction := range oldWorkflow.Actions {
6526- // if oldWorkflowAction.AppID == action.AppID {
6527- // parentWorkflow.Actions[actionIndex].AuthenticationId = oldWorkflowAction.AuthenticationId
6528- // break
6529- // }
6530- // }
6531- // }
6513+ parentWorkflow.Actions[actionIndex].AuthenticationId = ""
6514+
6515+ idFound := false
6516+ for _, oldWorkflowAction := range oldWorkflow.Actions {
6517+ if oldWorkflowAction.ID == action.ID {
6518+ idFound = true
6519+ parentWorkflow.Actions[actionIndex].AuthenticationId = oldWorkflowAction.AuthenticationId
6520+ }
6521+ }
6522+
6523+ if !idFound {
6524+ for _, oldWorkflowAction := range oldWorkflow.Actions {
6525+ if oldWorkflowAction.AppID == action.AppID {
6526+ parentWorkflow.Actions[actionIndex].AuthenticationId = oldWorkflowAction.AuthenticationId
6527+ break
6528+ }
6529+ }
6530+ }
65326531 }
65336532
65346533 for _, action := range oldWorkflow.Actions {
@@ -7220,7 +7219,7 @@ func diffWorkflows(oldWorkflow Workflow, parentWorkflow Workflow, update bool) {
72207219 }
72217220
72227221 // looks like a hack stitched together
7223- // only to make sure to never miss actions .
7222+ // only to make sure to never miss action .
72247223 if !found {
72257224 newActions = append(newActions, childAction)
72267225 }
@@ -10202,7 +10201,7 @@ func GenerateWorkflowFromParent(ctx context.Context, workflow Workflow, parentOr
1020210201
1020310202 for actionIndex, _ := range newWf.Actions {
1020410203 workflow.Actions[actionIndex].ParentControlled = true
10205- // workflow.Actions[actionIndex].AuthenticationId = ""
10204+ workflow.Actions[actionIndex].AuthenticationId = ""
1020610205 workflow.Actions[actionIndex].Environment = defaultEnvironment
1020710206 }
1020810207
0 commit comments