Skip to content

Commit

Permalink
marshalling other config as well for backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenyk committed Nov 15, 2024
1 parent 1696ece commit ffeaa4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions workflowBundler/workflowBundler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ type (
bundlerContext string

WorkflowSettings[TSettings any] struct {
Bindings map[string]runtimesRegistry.BindingSettings `json:"bindings"`
Additional TSettings
Bindings map[string]runtimesRegistry.BindingSettings `json:"bindings"`
Other TSettings `json:"other"`
}

BundledContent[TSettings any] struct {
Expand Down Expand Up @@ -188,7 +188,7 @@ func (settings *WorkflowSettings[TSettings]) UnmarshalJSON(data []byte) error {
set := new(TSettings)
err = json.Unmarshal(data, set)

settings.Additional = *set
settings.Other = *set

return err

Expand Down
4 changes: 2 additions & 2 deletions workflowBundler/workflowBundler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func Test_WorkflowBundler(t *testing.T) {
assert.True(pluginSetupWasCalled, "plugin setup was not called")
assert.Equal(bundlerResult.Errors[0], "ID is required")
assert.NotEmpty(bundlerResult.Content.Source)
assert.Equal("tokenGen", bundlerResult.Content.Settings.Additional.ID)
assert.Equal("onTokenGeneration", bundlerResult.Content.Settings.Additional.Trigger)
assert.Equal("tokenGen", bundlerResult.Content.Settings.Other.ID)
assert.Equal("onTokenGeneration", bundlerResult.Content.Settings.Other.Trigger)
assert.NotEmpty(bundlerResult.Content.BundleHash)
}

0 comments on commit ffeaa4f

Please sign in to comment.