From fcd9b7afd5767f4f3105570c5595ebfdce6f2297 Mon Sep 17 00:00:00 2001 From: Marko Bevc Date: Sun, 31 May 2026 00:32:19 +0100 Subject: [PATCH 1/2] fix: keep hardcoded visibility for backwards compatibility Recent Kosli servers accept flow create/update without `visibility`, but older instances might still reject the payload without it. Keep sending `visibility: "private"` for backwards compatibility, with a comment marking it for removal once the minimum supported server version no longer requires the field. --- cmd/kosli/createFlow.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cmd/kosli/createFlow.go b/cmd/kosli/createFlow.go index 300e59e4c..9b8890147 100644 --- a/cmd/kosli/createFlow.go +++ b/cmd/kosli/createFlow.go @@ -45,9 +45,14 @@ type createFlowOptions struct { } type FlowPayload struct { - Name string `json:"name"` - Description string `json:"description"` - Template []string `json:"template,omitempty"` + Name string `json:"name"` + Description string `json:"description"` + // TODO: Visibility is deprecated and ignored by recent Kosli servers, but older + // instances still reject the payload without it. Keep sending + // "private" until the minimum supported server version no longer requires + // this field, then remove the field and the assignment in run(). + Visibility string `json:"visibility"` + Template []string `json:"template,omitempty"` } func newCreateFlowCmd(out io.Writer) *cobra.Command { @@ -95,6 +100,8 @@ func (o *createFlowOptions) run(args []string) error { var url string var err error o.payload.Name = args[0] + // TODO: Remove when not required anymore + o.payload.Visibility = "private" if o.TemplateFile != "" || o.UseEmptyTemplate { url, err = neturl.JoinPath(global.Host, "api/v2/flows", global.Org, "template_file") From d8ff8b48dcefd05d51bcca9fcabd855eb1066924 Mon Sep 17 00:00:00 2001 From: Marko Bevc Date: Sun, 31 May 2026 00:39:05 +0100 Subject: [PATCH 2/2] chore: remove unnecessary comment --- cmd/kosli/createFlow.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/kosli/createFlow.go b/cmd/kosli/createFlow.go index 9b8890147..174647b0d 100644 --- a/cmd/kosli/createFlow.go +++ b/cmd/kosli/createFlow.go @@ -100,7 +100,6 @@ func (o *createFlowOptions) run(args []string) error { var url string var err error o.payload.Name = args[0] - // TODO: Remove when not required anymore o.payload.Visibility = "private" if o.TemplateFile != "" || o.UseEmptyTemplate {