Skip to content

Commit

Permalink
fix: reverting authenticationID things temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0elliot committed Jan 23, 2025
1 parent 0f6b13f commit 021a3f5
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -6501,8 +6501,7 @@ func diffWorkflows(oldWorkflow Workflow, parentWorkflow Workflow, update bool) {
parentWorkflowEnvironment = "Shuffle"
}

// for actionIndex, action := range parentWorkflow.Actions {
for _, action := range parentWorkflow.Actions {
for actionIndex, action := range parentWorkflow.Actions {
if len(action.Environment) > 0 {
discoveredEnvironment = action.Environment
}
Expand All @@ -6511,24 +6510,24 @@ func diffWorkflows(oldWorkflow Workflow, parentWorkflow Workflow, update bool) {
// authenticationIDs. Let's just remove it for now.

// In case of replication,
// parentWorkflow.Actions[actionIndex].AuthenticationId = ""

// idFound := false
// for _, oldWorkflowAction := range oldWorkflow.Actions {
// if oldWorkflowAction.ID == action.ID {
// idFound = true
// parentWorkflow.Actions[actionIndex].AuthenticationId = oldWorkflowAction.AuthenticationId
// }
// }

// if !idFound {
// for _, oldWorkflowAction := range oldWorkflow.Actions {
// if oldWorkflowAction.AppID == action.AppID {
// parentWorkflow.Actions[actionIndex].AuthenticationId = oldWorkflowAction.AuthenticationId
// break
// }
// }
// }
parentWorkflow.Actions[actionIndex].AuthenticationId = ""

idFound := false
for _, oldWorkflowAction := range oldWorkflow.Actions {
if oldWorkflowAction.ID == action.ID {
idFound = true
parentWorkflow.Actions[actionIndex].AuthenticationId = oldWorkflowAction.AuthenticationId
}
}

if !idFound {
for _, oldWorkflowAction := range oldWorkflow.Actions {
if oldWorkflowAction.AppID == action.AppID {
parentWorkflow.Actions[actionIndex].AuthenticationId = oldWorkflowAction.AuthenticationId
break
}
}
}
}

for _, action := range oldWorkflow.Actions {
Expand Down Expand Up @@ -7220,7 +7219,7 @@ func diffWorkflows(oldWorkflow Workflow, parentWorkflow Workflow, update bool) {
}

// looks like a hack stitched together
// only to make sure to never miss actions.
// only to make sure to never miss action.
if !found {
newActions = append(newActions, childAction)
}
Expand Down Expand Up @@ -10202,7 +10201,7 @@ func GenerateWorkflowFromParent(ctx context.Context, workflow Workflow, parentOr

for actionIndex, _ := range newWf.Actions {
workflow.Actions[actionIndex].ParentControlled = true
// workflow.Actions[actionIndex].AuthenticationId = ""
workflow.Actions[actionIndex].AuthenticationId = ""
workflow.Actions[actionIndex].Environment = defaultEnvironment
}

Expand Down

0 comments on commit 021a3f5

Please sign in to comment.