Skip to content

feat(pipeline-run): add programmatic submit_and_wait#41

Open
arseniy-pplx wants to merge 1 commit into
TangleML:masterfrom
arseniy-pplx:transfer/programmatic-submit-and-wait
Open

feat(pipeline-run): add programmatic submit_and_wait#41
arseniy-pplx wants to merge 1 commit into
TangleML:masterfrom
arseniy-pplx:transfer/programmatic-submit-and-wait

Conversation

@arseniy-pplx

Copy link
Copy Markdown

Summary

  • add submit_and_wait_prepared_body and the shorter submit_and_wait alias for programmatic callers
  • validate wait parameters before creating a run and leave the caller's prepared body unchanged; logger= applies only when the helper builds the manager — a supplied manager= keeps its own logger
  • support max_wait=None for an unbounded wait
  • pass submit_recovery_attempts through to failed-submit recovery so a registered run can be adopted instead of submitted twice
  • fix a pre-existing KeyError in PipelineRunManager.submit_prepared_body on locator-style bodies (componentRef with name/digest and no inline spec); such bodies now submit verbatim with a spec-less run context
  • tighten wait_for_completion: non-finite max_wait/poll_interval (NaN/inf) now raise PipelineRunError where inf previously acted as a never-firing deadline; max_wait=None remains the unbounded spelling
  • wait-validation errors now name the parameter alongside the CLI flag (e.g. max_wait (--max-wait) must be non-negative) since the CLI and programmatic API share the validation path

Context

Scripts currently have to reproduce the CLI's submit, recovery and wait orchestration. A single SDK entry point makes that flow reusable without weakening the existing submission-id recovery guarantees.

Testing

  • uv run pytest tests/test_submit_and_wait_prepared_body.py tests/test_pipeline_runs_cli.py
  • uvx ruff check on the touched source files
  • uv lock --check
  • git diff --check

submit_and_wait_prepared_body submits a prepared run body and waits for terminal state in one call. Wait parameters are validated before creating a run, max_wait=None remains unbounded, and submit_recovery_attempts passes through to failed-submit recovery so a run registered before a transport failure can be adopted instead of duplicated. The caller body is never mutated. Also fixes a pre-existing KeyError in submit_prepared_body on locator-style bodies without an inline componentRef.spec, and tightens wait_for_completion to reject non-finite max_wait/poll_interval instead of treating inf as a never-firing deadline.
@arseniy-pplx
arseniy-pplx marked this pull request as ready for review July 20, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant