Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/revyl/workflow_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ func runWorkflowConfigSet(cmd *cobra.Command, args []string) error {
}

ui.StartSpinner("Updating run config...")
err = client.UpdateWorkflowRunConfig(cmd.Context(), workflowID, cfg)
err = client.UpdateWorkflowRunConfig(cmd.Context(), workflowID, cfg, true)
ui.StopSpinner()

if err != nil {
Expand Down
19 changes: 17 additions & 2 deletions internal/api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3577,6 +3577,7 @@ type Workflow struct {
BuildConfig map[string]interface{} `json:"build_config,omitempty"`
OverrideBuildConfig bool `json:"override_build_config,omitempty"`
RunConfig *WorkflowRunConfig `json:"run_config,omitempty"`
OverrideRunConfig bool `json:"override_run_config,omitempty"`
}

// CLIWorkflowLastExecution holds the last execution metadata returned by the
Expand Down Expand Up @@ -5447,12 +5448,26 @@ type WorkflowRunConfig struct {
// - ctx: Context for cancellation
// - workflowID: The workflow UUID
// - config: The run configuration to apply
// - override: Whether to override inherited run config from project defaults
//
// Returns:
// - error: Any error that occurred
func (c *Client) UpdateWorkflowRunConfig(ctx context.Context, workflowID string, config *WorkflowRunConfig) error {
func (c *Client) UpdateWorkflowRunConfig(ctx context.Context, workflowID string, config *WorkflowRunConfig, override bool) error {
runConfig := map[string]interface{}{}
if config != nil {
if config.Parallelism > 0 {
runConfig["parallelism"] = config.Parallelism
}
if config.MaxRetries >= 0 {
runConfig["max_retries"] = config.MaxRetries
}
}
body := map[string]interface{}{
"run_config": runConfig,
"override_run_config": override,
}
path := fmt.Sprintf("/api/v1/workflows/update_run_config/%s", workflowID)
resp, err := c.doRequest(ctx, "PUT", path, config)
resp, err := c.doRequest(ctx, "PUT", path, body)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/tui/workflow_mgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ func saveWorkflowOverridesCmd(client *api.Client, workflowID string, wf *api.Wor
return WorkflowSettingsSavedMsg{Err: err}
}
if wf.RunConfig != nil {
if err := client.UpdateWorkflowRunConfig(ctx, workflowID, wf.RunConfig); err != nil {
if err := client.UpdateWorkflowRunConfig(ctx, workflowID, wf.RunConfig, wf.OverrideRunConfig); err != nil {
return WorkflowSettingsSavedMsg{Err: err}
}
}
Expand Down