orchestra-cli 0.3.2__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/PKG-INFO +11 -4
  2. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/README.md +9 -3
  3. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/build_pipeline.py +3 -25
  4. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/migrate_pipeline.py +5 -15
  5. orchestra_cli-0.3.4/orchestra_cli/src/run_pipeline.py +857 -0
  6. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/update_pipeline.py +6 -22
  7. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/test_build_pipeline.py +24 -27
  8. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/test_create_pipeline.py +2 -2
  9. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/test_pipeline_selector.py +2 -2
  10. orchestra_cli-0.3.4/orchestra_cli/tests/test_run_pipeline.py +1435 -0
  11. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/test_update_pipeline.py +3 -3
  12. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/utils/git.py +1 -0
  13. orchestra_cli-0.3.4/orchestra_cli/utils/pipeline_lookup.py +53 -0
  14. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/utils/pipeline_selector.py +1 -1
  15. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/utils/pipeline_update.py +4 -3
  16. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli.egg-info/PKG-INFO +11 -4
  17. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli.egg-info/SOURCES.txt +1 -0
  18. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli.egg-info/requires.txt +1 -0
  19. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/pyproject.toml +7 -1
  20. orchestra_cli-0.3.2/orchestra_cli/src/run_pipeline.py +0 -196
  21. orchestra_cli-0.3.2/orchestra_cli/tests/test_run_pipeline.py +0 -412
  22. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/__init__.py +0 -0
  23. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/cli.py +0 -0
  24. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/create_pipeline.py +0 -0
  25. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/delete_pipeline.py +0 -0
  26. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/fetch_pipelines.py +0 -0
  27. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/get_pipeline.py +0 -0
  28. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/import_pipeline.py +0 -0
  29. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/pipeline_upsert.py +0 -0
  30. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/task_logs.py +0 -0
  31. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/src/validate_pipeline.py +0 -0
  32. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/__init__.py +0 -0
  33. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/conftest.py +0 -0
  34. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/test_cli.py +0 -0
  35. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/test_delete_pipeline.py +0 -0
  36. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/test_fetch_pipelines.py +0 -0
  37. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/test_get_pipeline.py +0 -0
  38. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/test_import_pipeline.py +0 -0
  39. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/test_migrate_pipeline.py +0 -0
  40. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/test_task_logs.py +0 -0
  41. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/test_validate_pipeline.py +0 -0
  42. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/utils/__init__.py +0 -0
  43. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/tests/utils/test_git.py +0 -0
  44. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/utils/api.py +0 -0
  45. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/utils/constants.py +0 -0
  46. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/utils/styling.py +0 -0
  47. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli/utils/yaml_loader.py +0 -0
  48. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli.egg-info/dependency_links.txt +0 -0
  49. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli.egg-info/entry_points.txt +0 -0
  50. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/orchestra_cli.egg-info/top_level.txt +0 -0
  51. {orchestra_cli-0.3.2 → orchestra_cli-0.3.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orchestra-cli
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Orchestra CLI. Perform operations with Orchestra locally.
5
5
  Author-email: Orchestra Technologies <support@getorchestra.io>
6
6
  Requires-Python: >=3.10
@@ -9,6 +9,7 @@ Requires-Dist: click
9
9
  Requires-Dist: httpx>=0.28.1
10
10
  Requires-Dist: pydantic>=2.13.4
11
11
  Requires-Dist: pyyaml>=6.0.2
12
+ Requires-Dist: rich>=14.0.0
12
13
  Requires-Dist: typer>=0.16.0
13
14
 
14
15
  # orchestra-cli
@@ -50,7 +51,7 @@ Commands follow a `noun verb` shape. The current nouns are `pipeline` and `task`
50
51
  | `orchestra pipeline update` | Update an existing Orchestra-backed pipeline from a local YAML file. |
51
52
  | `orchestra pipeline migrate` | Migrate an Orchestra-backed pipeline to git-backed storage. |
52
53
  | `orchestra pipeline delete` | Delete an existing pipeline by alias. |
53
- | `orchestra pipeline run` | Start a pipeline run by alias, optionally pinning branch/commit and waiting for completion. |
54
+ | `orchestra pipeline run` | Start a pipeline run by selector, optionally pinning branch/commit and waiting. |
54
55
  | `orchestra pipeline build` | Validate local YAML, create or update a draft pipeline, and start that draft version. |
55
56
  | `orchestra task logs` | Fetch or follow logs for a single task run. |
56
57
 
@@ -312,7 +313,7 @@ Behavior
312
313
 
313
314
  ## pipeline run
314
315
 
315
- Start a pipeline run by alias. Optionally specify a branch and/or commit. By default, the command waits and polls the run status until completion.
316
+ Start a pipeline run by alias, pipeline ID, or path. Optionally specify a branch and/or commit. By default, the command waits and polls the run status until completion.
316
317
 
317
318
  ```bash
318
319
  export ORCHESTRA_API_KEY=...
@@ -329,15 +330,21 @@ orchestra pipeline run -a my-pipeline -b feature/my-change -c 0123abc
329
330
 
330
331
  Options
331
332
 
332
- - `-a, --alias` (required): Pipeline alias to run.
333
+ - `-a, --alias` (optional): Pipeline alias to run.
334
+ - `-i, --pipeline-id` (optional): Pipeline ID to run.
335
+ - `-p, --path` (optional): Path to a local pipeline YAML file. When this points to a pipeline inside a git repository, the CLI resolves the pipeline from `repository` + `yaml_path` before starting the run.
333
336
  - `-b, --branch` (optional): Git branch name to associate with this run.
334
337
  - `-c, --commit` (optional): Commit SHA to associate with this run.
338
+ - `-t, --task` (optional): Task ID, task name, task-group ID, or task-group name to run. With `--path`, selectors resolve from the local YAML; otherwise the CLI loads pipeline data from Orchestra and resolves them there.
335
339
  - `--wait/--no-wait` (default: `--wait`): Poll until the run ends.
336
340
  - `--force/--no-force` (default: `--no-force`): Skip confirmation if local git warnings are detected.
341
+ - Provide exactly one selector mode: `--alias`, `--pipeline-id`, or `--path`. These selector flags are mutually exclusive.
337
342
 
338
343
  Behavior
339
344
 
340
345
  - Prints the run ID when known and a link to the run lineage page.
346
+ - Rejects mixed selector modes.
347
+ - When `--path` is used for a repository-backed pipeline, the CLI must find an existing Orchestra pipeline for that `repository` + `yaml_path` selector before it can start the run.
341
348
  - When waiting, polls status every ~5s until a terminal state:
342
349
  - `SUCCEEDED` (exit `0`), `WARNING` (exit `0`), `SKIPPED` (exit `0`)
343
350
  - `FAILED` or `CANCELLED` (exit `1`)
@@ -37,7 +37,7 @@ Commands follow a `noun verb` shape. The current nouns are `pipeline` and `task`
37
37
  | `orchestra pipeline update` | Update an existing Orchestra-backed pipeline from a local YAML file. |
38
38
  | `orchestra pipeline migrate` | Migrate an Orchestra-backed pipeline to git-backed storage. |
39
39
  | `orchestra pipeline delete` | Delete an existing pipeline by alias. |
40
- | `orchestra pipeline run` | Start a pipeline run by alias, optionally pinning branch/commit and waiting for completion. |
40
+ | `orchestra pipeline run` | Start a pipeline run by selector, optionally pinning branch/commit and waiting. |
41
41
  | `orchestra pipeline build` | Validate local YAML, create or update a draft pipeline, and start that draft version. |
42
42
  | `orchestra task logs` | Fetch or follow logs for a single task run. |
43
43
 
@@ -299,7 +299,7 @@ Behavior
299
299
 
300
300
  ## pipeline run
301
301
 
302
- Start a pipeline run by alias. Optionally specify a branch and/or commit. By default, the command waits and polls the run status until completion.
302
+ Start a pipeline run by alias, pipeline ID, or path. Optionally specify a branch and/or commit. By default, the command waits and polls the run status until completion.
303
303
 
304
304
  ```bash
305
305
  export ORCHESTRA_API_KEY=...
@@ -316,15 +316,21 @@ orchestra pipeline run -a my-pipeline -b feature/my-change -c 0123abc
316
316
 
317
317
  Options
318
318
 
319
- - `-a, --alias` (required): Pipeline alias to run.
319
+ - `-a, --alias` (optional): Pipeline alias to run.
320
+ - `-i, --pipeline-id` (optional): Pipeline ID to run.
321
+ - `-p, --path` (optional): Path to a local pipeline YAML file. When this points to a pipeline inside a git repository, the CLI resolves the pipeline from `repository` + `yaml_path` before starting the run.
320
322
  - `-b, --branch` (optional): Git branch name to associate with this run.
321
323
  - `-c, --commit` (optional): Commit SHA to associate with this run.
324
+ - `-t, --task` (optional): Task ID, task name, task-group ID, or task-group name to run. With `--path`, selectors resolve from the local YAML; otherwise the CLI loads pipeline data from Orchestra and resolves them there.
322
325
  - `--wait/--no-wait` (default: `--wait`): Poll until the run ends.
323
326
  - `--force/--no-force` (default: `--no-force`): Skip confirmation if local git warnings are detected.
327
+ - Provide exactly one selector mode: `--alias`, `--pipeline-id`, or `--path`. These selector flags are mutually exclusive.
324
328
 
325
329
  Behavior
326
330
 
327
331
  - Prints the run ID when known and a link to the run lineage page.
332
+ - Rejects mixed selector modes.
333
+ - When `--path` is used for a repository-backed pipeline, the CLI must find an existing Orchestra pipeline for that `repository` + `yaml_path` selector before it can start the run.
328
334
  - When waiting, polls status every ~5s until a terminal state:
329
335
  - `SUCCEEDED` (exit `0`), `WARNING` (exit `0`), `SKIPPED` (exit `0`)
330
336
  - `FAILED` or `CANCELLED` (exit `1`)
@@ -4,8 +4,9 @@ import httpx
4
4
  import typer
5
5
 
6
6
  from ..utils.api import auth_headers, fail_with_response, request_or_exit, require_api_key
7
- from ..utils.constants import get_create_pipeline_url, get_pipeline_url, get_update_pipeline_url
7
+ from ..utils.constants import get_create_pipeline_url, get_update_pipeline_url
8
8
  from ..utils.git import confirm_git_warnings_or_exit, prepare_git_backed_run_target
9
+ from ..utils.pipeline_lookup import lookup_existing_pipeline
9
10
  from ..utils.pipeline_selector import (
10
11
  PipelineSelector,
11
12
  pipeline_alias_option,
@@ -45,26 +46,6 @@ def _extract_upsert_result(response: httpx.Response, action: str) -> tuple[str,
45
46
  )
46
47
 
47
48
 
48
- def _lookup_existing_pipeline(
49
- selector: PipelineSelector,
50
- api_key: str,
51
- ) -> dict[str, object] | None:
52
- response = request_or_exit(
53
- httpx.get,
54
- get_pipeline_url(),
55
- params=selector.to_payload(),
56
- timeout=30,
57
- headers=auth_headers(api_key),
58
- )
59
-
60
- if response.status_code == 404:
61
- return None
62
- if response.status_code != 200:
63
- raise fail_with_response("Build", response)
64
-
65
- return require_pipeline_body_from_success_response(response, "Build")
66
-
67
-
68
49
  def _build_create_selector(
69
50
  path: Path,
70
51
  lookup_selector: PipelineSelector,
@@ -174,7 +155,7 @@ def build_pipeline(
174
155
 
175
156
  confirm_git_warnings_or_exit(force, path)
176
157
  pipeline_data = load_validated_pipeline_data(path)
177
- existing_pipeline = _lookup_existing_pipeline(lookup_selector, api_key)
158
+ existing_pipeline = lookup_existing_pipeline(lookup_selector, api_key, "Build", allow_404=True)
178
159
 
179
160
  if existing_pipeline is None:
180
161
  run_selector, version_number = _create_draft_pipeline(
@@ -188,7 +169,6 @@ def build_pipeline(
188
169
  selector=run_selector,
189
170
  api_key=api_key,
190
171
  payload=build_run_payload(
191
- run_selector,
192
172
  branch=branch,
193
173
  commit=commit,
194
174
  version_number=version_number,
@@ -210,7 +190,6 @@ def build_pipeline(
210
190
  selector=run_selector,
211
191
  api_key=api_key,
212
192
  payload=build_run_payload(
213
- run_selector,
214
193
  branch=branch,
215
194
  commit=commit,
216
195
  version_number=version_number,
@@ -245,7 +224,6 @@ def build_pipeline(
245
224
  selector=run_selector,
246
225
  api_key=api_key,
247
226
  payload=build_run_payload(
248
- run_selector,
249
227
  branch=git_branch,
250
228
  commit=git_commit,
251
229
  ),
@@ -23,10 +23,10 @@ from ..utils.git import (
23
23
  stage_and_commit_file_if_needed,
24
24
  suggest_migration_branch_name,
25
25
  )
26
+ from ..utils.pipeline_lookup import lookup_existing_pipeline
26
27
  from ..utils.pipeline_selector import PipelineSelector, pipeline_alias_option, pipeline_id_option
27
28
  from ..utils.pipeline_update import storage_provider
28
29
  from ..utils.styling import bold, green, red, yellow
29
- from .pipeline_upsert import require_pipeline_body_from_success_response
30
30
 
31
31
 
32
32
  def migrate_path_option() -> Any:
@@ -51,19 +51,6 @@ def _resolve_migrate_selector(alias: str | None, pipeline_id: str | None) -> Pip
51
51
  raise typer.Exit(code=1)
52
52
 
53
53
 
54
- def _lookup_pipeline(selector: PipelineSelector, api_key: str) -> dict[str, object]:
55
- response = request_or_exit(
56
- httpx.get,
57
- get_api_url("pipeline"),
58
- params=selector.to_payload(),
59
- timeout=30,
60
- headers=auth_headers(api_key),
61
- )
62
- if response.status_code != 200:
63
- raise fail_with_response("Migrate", response)
64
- return require_pipeline_body_from_success_response(response, "Migrate")
65
-
66
-
67
54
  def _extract_int(value: object) -> int | None:
68
55
  if isinstance(value, bool):
69
56
  return None
@@ -383,7 +370,10 @@ def migrate_pipeline(
383
370
  typer.echo(red("Could not detect current branch from git"))
384
371
  raise typer.Exit(code=1)
385
372
 
386
- existing_pipeline = _lookup_pipeline(selector, api_key)
373
+ existing_pipeline = lookup_existing_pipeline(selector, api_key, "Migrate")
374
+ if existing_pipeline is None:
375
+ typer.echo(red("❌ Migrate failed: pipeline lookup returned no pipeline"))
376
+ raise typer.Exit(code=1)
387
377
  provider = (storage_provider(existing_pipeline) or "ORCHESTRA").upper()
388
378
  if provider != "ORCHESTRA":
389
379
  typer.echo(