Add 'none' workflow option as the default (no-op on goal set)

- Workflow() no longer defaults to 'conductor' when empty
- runWorkflow() returns immediately for '' or 'none'
- 'none' listed first in the workflows file output
- QML dropdowns default to 'none' instead of 'conductor'
- C++ fallback uses 'none' when server unreachable
This commit is contained in:
Levi Neely 2026-08-19 18:09:09 +02:00
parent 9f1aec1384
commit a7b8c4c2ce
4 changed files with 12 additions and 9 deletions

View File

@ -63,7 +63,11 @@ func startAsync(ctx context.Context, fn func()) bool {
// runWorkflow executes a workflow script in the background. // runWorkflow executes a workflow script in the background.
// If variant is non-empty and not "default", the matching conf sidecar is // If variant is non-empty and not "default", the matching conf sidecar is
// sourced as environment variables before the script runs. // sourced as environment variables before the script runs.
// If workflow is empty or "none", nothing happens.
func runWorkflow(s *session.Session, workflow, variant string) { func runWorkflow(s *session.Session, workflow, variant string) {
if workflow == "" || workflow == "none" {
return
}
startAsync(s.Ctx, func() { startAsync(s.Ctx, func() {
workflowDir := util.CfgDir() + "/workflows/" workflowDir := util.CfgDir() + "/workflows/"
scriptPath := workflowDir + workflow scriptPath := workflowDir + workflow
@ -205,6 +209,8 @@ func buildTreeSpec(cfg *Config) virtfs.FsNodeDecl {
} }
} }
var sb strings.Builder var sb strings.Builder
// "none" is always the first entry — it means no workflow runs.
sb.WriteString("none\tdefault\n")
names := make([]string, 0, len(workflows)) names := make([]string, 0, len(workflows))
for wf := range workflows { for wf := range workflows {
names = append(names, wf) names = append(names, wf)

View File

@ -257,14 +257,11 @@ func (s *Session) GoalSignal() <-chan struct{} {
return ch return ch
} }
// Workflow returns the workflow profile name (default: "conductor"). // Workflow returns the workflow profile name (default: "none").
func (s *Session) Workflow() string { func (s *Session) Workflow() string {
s.mu.RLock() s.mu.RLock()
w := s.workflow w := s.workflow
s.mu.RUnlock() s.mu.RUnlock()
if w == "" {
return "conductor"
}
return w return w
} }

View File

@ -135,7 +135,7 @@ Dialog {
enabled: ollie.workflowsLoaded enabled: ollie.workflowsLoaded
model: ollie.availableWorkflows model: ollie.availableWorkflows
currentIndex: { currentIndex: {
var idx = ollie.availableWorkflows.indexOf("conductor") var idx = ollie.availableWorkflows.indexOf("none")
return idx >= 0 ? idx : 0 return idx >= 0 ? idx : 0
} }
onCurrentTextChanged: { onCurrentTextChanged: {
@ -242,7 +242,7 @@ Dialog {
cwdField.text = cfg.cwd || "" cwdField.text = cfg.cwd || ""
remoteField.text = cfg.remote || "" remoteField.text = cfg.remote || ""
var wfIdx = ollie.availableWorkflows.indexOf(cfg.workflow || "conductor") var wfIdx = ollie.availableWorkflows.indexOf(cfg.workflow || "none")
workflowCombo.currentIndex = wfIdx >= 0 ? wfIdx : 0 workflowCombo.currentIndex = wfIdx >= 0 ? wfIdx : 0
// Populate variant after workflow is set. // Populate variant after workflow is set.
@ -261,7 +261,7 @@ Dialog {
cwdField.text = "" cwdField.text = ""
remoteField.text = "" remoteField.text = ""
yoloCheckBox.checked = false yoloCheckBox.checked = false
var idx = ollie.availableWorkflows.indexOf("conductor") var idx = ollie.availableWorkflows.indexOf("none")
workflowCombo.currentIndex = idx >= 0 ? idx : 0 workflowCombo.currentIndex = idx >= 0 ? idx : 0
variantCombo.currentIndex = 0 variantCombo.currentIndex = 0
} }

View File

@ -602,8 +602,8 @@ void Ollie9pClient::loadWorkflows()
} }
} }
} else { } else {
m_availableWorkflows = QStringList() << QStringLiteral("conductor"); m_availableWorkflows = QStringList() << QStringLiteral("none");
m_workflowVariants[QStringLiteral("conductor")] = QStringList() << QStringLiteral("default"); m_workflowVariants[QStringLiteral("none")] = QStringList() << QStringLiteral("default");
} }
m_workflowsLoaded = true; m_workflowsLoaded = true;
emit availableWorkflowsChanged(); emit availableWorkflowsChanged();