Skip to content

Commit

Permalink
chore: update action-kit-api / remove parameter orders
Browse files Browse the repository at this point in the history
  • Loading branch information
ReuDa committed Nov 20, 2024
1 parent d4f0f7b commit 9f3c87b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 23 deletions.
18 changes: 6 additions & 12 deletions extloadtest/action_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,23 @@ func (l *logAction) Describe() action_kit_api.ActionDescription {
{
Name: "duration",
Label: "Duration",
Type: action_kit_api.Duration,
Type: action_kit_api.ActionParameterTypeDuration,
DefaultValue: extutil.Ptr("10s"),
Required: extutil.Ptr(true),
Order: extutil.Ptr(0),
},
{
Name: "message",
Label: "Message",
Description: extutil.Ptr("What should we log to the console? Use %s to insert the target name."),
Type: action_kit_api.String,
Type: action_kit_api.ActionParameterTypeString,
DefaultValue: extutil.Ptr("Hello from %s"),
Required: extutil.Ptr(true),
Order: extutil.Ptr(1),
},
{
Name: "errorEndpoint",
Label: "Error in endpoint",
Description: extutil.Ptr("Should we throw an error in the selected endpoint?"),
Type: action_kit_api.String,
Order: extutil.Ptr(2),
Type: action_kit_api.ActionParameterTypeString,
Advanced: extutil.Ptr(true),
DefaultValue: extutil.Ptr("none"),
Options: extutil.Ptr([]action_kit_api.ParameterOption{
Expand Down Expand Up @@ -127,8 +124,7 @@ func (l *logAction) Describe() action_kit_api.ActionDescription {
Name: "latencyEndpoint",
Label: "Latency in endpoint",
Description: extutil.Ptr("Should we add latency in the selected endpoint?"),
Type: action_kit_api.String,
Order: extutil.Ptr(3),
Type: action_kit_api.ActionParameterTypeString,
Advanced: extutil.Ptr(true),
DefaultValue: extutil.Ptr("none"),
Options: extutil.Ptr([]action_kit_api.ParameterOption{
Expand Down Expand Up @@ -157,19 +153,17 @@ func (l *logAction) Describe() action_kit_api.ActionDescription {
{
Name: "latencyDuration",
Label: "Latency",
Type: action_kit_api.Duration,
Type: action_kit_api.ActionParameterTypeDuration,
DefaultValue: extutil.Ptr("5s"),
Required: extutil.Ptr(false),
Order: extutil.Ptr(4),
Advanced: extutil.Ptr(true),
},
{
Name: "targetFilter",
Label: "Target Filter for error / latency",
Description: extutil.Ptr("For which target should we throw an error / add latency? '*' throws for all targets."),
DefaultValue: extutil.Ptr("*"),
Type: action_kit_api.String,
Order: extutil.Ptr(5),
Type: action_kit_api.ActionParameterTypeString,
Advanced: extutil.Ptr(true),
},
},
Expand Down
6 changes: 2 additions & 4 deletions extloadtest/action_recreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,17 @@ func (r *recreateAction) Describe() action_kit_api.ActionDescription {
Name: "prepareFailureRate",
Label: "Prepare Failure Rate",
Description: extutil.Ptr("The rate of prepare calls to fail"),
Type: action_kit_api.Percentage,
Type: action_kit_api.ActionParameterTypePercentage,
DefaultValue: extutil.Ptr("0"),
Required: extutil.Ptr(true),
Order: extutil.Ptr(1),
},
{
Name: "startFailureRate",
Label: "Start Failure Rate",
Description: extutil.Ptr("The rate of Start calls to fail"),
Type: action_kit_api.Percentage,
Type: action_kit_api.ActionParameterTypePercentage,
DefaultValue: extutil.Ptr("0"),
Required: extutil.Ptr(true),
Order: extutil.Ptr(2),
},
},
}
Expand Down
7 changes: 3 additions & 4 deletions extloadtest/action_widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func (l *widgetAction) Describe() action_kit_api.ActionDescription {
Type: action_kit_api.Duration,

Check failure on line 71 in extloadtest/action_widgets.go

View workflow job for this annotation

GitHub Actions / extension-ci / Audit

action_kit_api.Duration is deprecated: Use action_kit_api.ActionParameterTypeDuration instead. (SA1019)
DefaultValue: extutil.Ptr("10s"),
Required: extutil.Ptr(true),
Order: extutil.Ptr(0),
},
},
Status: extutil.Ptr(action_kit_api.MutatingEndpointReferenceWithCallInterval{
Expand Down Expand Up @@ -143,11 +142,11 @@ func (l *widgetAction) Describe() action_kit_api.ActionDescription {
}
}

func (l *widgetAction) Prepare(_ context.Context, state *WidgetActionState, request action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error) {
func (l *widgetAction) Prepare(_ context.Context, _ *WidgetActionState, _ action_kit_api.PrepareActionRequestBody) (*action_kit_api.PrepareResult, error) {
return nil, nil
}

func (l *widgetAction) Start(_ context.Context, state *WidgetActionState) (*action_kit_api.StartResult, error) {
func (l *widgetAction) Start(_ context.Context, _ *WidgetActionState) (*action_kit_api.StartResult, error) {
return &action_kit_api.StartResult{
Messages: &[]action_kit_api.Message{
{
Expand All @@ -166,7 +165,7 @@ func (l *widgetAction) Start(_ context.Context, state *WidgetActionState) (*acti
}, nil
}

func (l *widgetAction) Status(_ context.Context, state *WidgetActionState) (*action_kit_api.StatusResult, error) {
func (l *widgetAction) Status(_ context.Context, _ *WidgetActionState) (*action_kit_api.StatusResult, error) {
randomState1 := []string{"danger", "warn", "info", "success"}[rand.IntN(4)]
randomState2 := []string{"danger", "warn", "info", "success"}[rand.IntN(4)]
randomState3 := []string{"danger", "warn", "info", "success"}[rand.IntN(4)]
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/kelseyhightower/envconfig v1.4.0
github.com/procyon-projects/chrono v1.1.2
github.com/rs/zerolog v1.33.0
github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4
github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.6
github.com/steadybit/action-kit/go/action_kit_sdk v1.1.14
github.com/steadybit/advice-kit/go/advice_kit_api v1.0.0
github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ github.com/smartystreets/assertions v1.13.1/go.mod h1:cXr/IwVfSo/RbCSPhoAPv73p3h
github.com/smartystreets/goconvey v1.8.0 h1:Oi49ha/2MURE0WexF052Z0m+BNSGirfjg5RL+JXWq3w=
github.com/smartystreets/goconvey v1.8.0/go.mod h1:EdX8jtrTIj26jmjCOVNMVSIYAtgexqXKHOXW2Dx9JLg=
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0=
github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4 h1:imlfn0m5FEwZ3/ad75TgI5DoGQD4ztnSoLfPR4afqUY=
github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4/go.mod h1:ycF2RLgRsB8I/jD52aE+dKZKVru1GIEtmkcRcIR3vXk=
github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.6 h1:Qci7Numf66mjCIRo7KDwHUimIxUZzq+GBfyv/1f/QCU=
github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.6/go.mod h1:ycF2RLgRsB8I/jD52aE+dKZKVru1GIEtmkcRcIR3vXk=
github.com/steadybit/action-kit/go/action_kit_sdk v1.1.14 h1:x94RX+vh9Iyc0tS6BhiSpvknj+xE36AV0Nc3D5Yuub0=
github.com/steadybit/action-kit/go/action_kit_sdk v1.1.14/go.mod h1:Tp/klK5b7k+BCvb3JTSDZSNcnpFBaHauhndzOarnMW4=
github.com/steadybit/advice-kit/go/advice_kit_api v1.0.0 h1:ApgKzjqXkFEtTxW2HETLYgEOQY+ZZOdYFmscfRc1LcA=
Expand Down

0 comments on commit 9f3c87b

Please sign in to comment.