ConductorWorkflow requires a live executor at construction time — prevents offline use

Aperta
#432 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python

Direzione di ricerca

Individua ConductorWorkflow.init(), quindi esamina register(), start_workflow() ed execute(), insieme alla gestione esistente di WorkflowExecutor. Riproduci la costruzione senza un server, quindi verifica che le chiamate che dipendono dall’executor falliscano chiaramente senza di esso, mentre l’uso con un executor continui a funzionare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Summary

Tested against: Conductor OSS 3.32.0-rc.9

ConductorWorkflow.__init__() takes executor: WorkflowExecutor as a mandatory
first positional argument. This forces a live server connection at the point of
constructing a workflow definition, making offline use impossible.

Impact

  • Unit testing: tests that validate workflow structure (task order, task types,
    inputParameters) cannot be written without a running Conductor server.
  • Library code: functions that return workflow definitions must thread an
    executor parameter through all their call chains, coupling definition logic
    to connection management.
  • Code generation / serialization: workflow definitions cannot be built and
    exported to JSON without a server connection.

Reproduction

# Fails without a server running:
wf = ConductorWorkflow(name="my_wf", version=1)
# TypeError: ConductorWorkflow.__init__() missing 1 required positional argument: 'executor'

# Required:
config = Configuration(server_api_url="http://localhost:8080/api")
executor = WorkflowExecutor(config)
wf = ConductorWorkflow(executor=executor, name="my_wf", version=1)

Suggested fix

Make executor optional; raise RuntimeError only when an executor-dependent
method (.register(), .start_workflow(), .execute()) is called on a workflow
with no executor set:

def __init__(self, name: str, version: Optional[int] = None,
             executor: Optional[WorkflowExecutor] = None, ...):
    self._executor = executor
    ...

def register(self, overwrite: bool):
    if self._executor is None:
        raise RuntimeError("ConductorWorkflow.register() requires an executor. "
                           "Pass executor= at construction time.")
    ...

Verified against

Conductor server 3.32.0-rc.9, Python SDK (editable install from
conductor-oss/python-sdk main branch).

Lingua principale
Python
Stelle
104
Fork
43
Merge medio
1g 13h
PR unite (30g)
4

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di conductor-oss/python-sdk

Tutte le issue di conductor-oss/python-sdk

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.