Closed kke closed 6 days ago
A bit crudelly crammed-in way to make the apply action's (can be replicated fro other actions if needed) phase list modifiable.
Before:
applyAction := &action.Apply{ Force: false } err := applyAction.Run()
After:
applyAction := action.NewApply(action.ApplyOpts: { Force: false }) validateFacts := &phase.ValidateFacts{} applyAction.Phases.InsertAfter(validateFacts.Title(), &myCustomPhase{}) err := applyAction.Run()
This allows adding custom phases or modifying/removing existing ones to the apply action without duplicating the action code.
While creating this it became obvious that there's plenty of room for improvement in the way the phase manager / actions are set up.
A bit crudelly crammed-in way to make the apply action's (can be replicated fro other actions if needed) phase list modifiable.
Before:
After:
This allows adding custom phases or modifying/removing existing ones to the apply action without duplicating the action code.
While creating this it became obvious that there's plenty of room for improvement in the way the phase manager / actions are set up.