orchestra-cli 0.1.1__tar.gz → 0.1.2__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 (24) hide show
  1. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/PKG-INFO +5 -2
  2. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/README.md +4 -1
  3. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/src/import_pipeline.py +21 -0
  4. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/tests/test_import_pipeline.py +12 -0
  5. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli.egg-info/PKG-INFO +5 -2
  6. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/pyproject.toml +1 -1
  7. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/src/__init__.py +0 -0
  8. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/src/cli.py +0 -0
  9. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/src/run_pipeline.py +0 -0
  10. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/src/validate_pipeline.py +0 -0
  11. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/tests/__init__.py +0 -0
  12. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/tests/conftest.py +0 -0
  13. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/tests/test_cli.py +0 -0
  14. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/tests/test_run_pipeline.py +0 -0
  15. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/tests/test_validate_pipeline.py +0 -0
  16. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/utils/constants.py +0 -0
  17. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/utils/git.py +0 -0
  18. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli/utils/styling.py +0 -0
  19. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli.egg-info/SOURCES.txt +0 -0
  20. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli.egg-info/dependency_links.txt +0 -0
  21. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli.egg-info/entry_points.txt +0 -0
  22. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli.egg-info/requires.txt +0 -0
  23. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/orchestra_cli.egg-info/top_level.txt +0 -0
  24. {orchestra_cli-0.1.1 → orchestra_cli-0.1.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orchestra-cli
3
- Version: 0.1.1
3
+ Version: 0.1.2
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
@@ -87,7 +87,8 @@ export ORCHESTRA_API_KEY=... # required
87
87
 
88
88
  orchestra import \
89
89
  --alias my-pipeline \
90
- --path ./pipelines/pipeline.yaml
90
+ --path ./pipelines/pipeline.yaml \
91
+ --working-branch my-feature-branch # optional; defaults to current local branch
91
92
  # or
92
93
  orchestra-cli import -a my-pipeline -p ./pipelines/pipeline.yaml
93
94
  ```
@@ -96,6 +97,7 @@ Options
96
97
 
97
98
  - `-a, --alias` (required): The alias you want to register the pipeline under.
98
99
  - `-p, --path` (required): Path to the YAML file. Must be inside a git repository.
100
+ - `-w, --working-branch` (optional): Branch to associate as the working branch for this pipeline import. If omitted, the current local git branch is used.
99
101
 
100
102
  Notes
101
103
 
@@ -103,6 +105,7 @@ Notes
103
105
  - Git details are detected automatically:
104
106
  - Supported providers: GitHub, GitLab, Azure DevOps.
105
107
  - The default branch is detected from `origin`.
108
+ - The working branch defaults to your current local branch when not specified.
106
109
  - The YAML path is computed relative to the repository root.
107
110
  - On success, the command prints the created pipeline ID (or a success message).
108
111
  - Exit codes: `0` on success, `1` on failure.
@@ -76,7 +76,8 @@ export ORCHESTRA_API_KEY=... # required
76
76
 
77
77
  orchestra import \
78
78
  --alias my-pipeline \
79
- --path ./pipelines/pipeline.yaml
79
+ --path ./pipelines/pipeline.yaml \
80
+ --working-branch my-feature-branch # optional; defaults to current local branch
80
81
  # or
81
82
  orchestra-cli import -a my-pipeline -p ./pipelines/pipeline.yaml
82
83
  ```
@@ -85,6 +86,7 @@ Options
85
86
 
86
87
  - `-a, --alias` (required): The alias you want to register the pipeline under.
87
88
  - `-p, --path` (required): Path to the YAML file. Must be inside a git repository.
89
+ - `-w, --working-branch` (optional): Branch to associate as the working branch for this pipeline import. If omitted, the current local git branch is used.
88
90
 
89
91
  Notes
90
92
 
@@ -92,6 +94,7 @@ Notes
92
94
  - Git details are detected automatically:
93
95
  - Supported providers: GitHub, GitLab, Azure DevOps.
94
96
  - The default branch is detected from `origin`.
97
+ - The working branch defaults to your current local branch when not specified.
95
98
  - The YAML path is computed relative to the repository root.
96
99
  - On success, the command prints the created pipeline ID (or a success message).
97
100
  - Exit codes: `0` on success, `1` on failure.
@@ -52,6 +52,13 @@ def _detect_default_branch(repo_root: Path) -> str | None:
52
52
  return None
53
53
 
54
54
 
55
+ def _detect_current_branch(repo_root: Path) -> str | None:
56
+ ok, out = run_git_command(["rev-parse", "--abbrev-ref", "HEAD"], repo_root)
57
+ if ok and out:
58
+ return out
59
+ return None
60
+
61
+
55
62
  def _detect_storage_provider(repository_url: str | None) -> str:
56
63
  if not repository_url:
57
64
  typer.echo(red("Could not detect storage provider - no repository URL"))
@@ -104,6 +111,12 @@ def import_pipeline(
104
111
  resolve_path=True,
105
112
  help="Path to pipeline YAML inside a git repository",
106
113
  ),
114
+ working_branch: str | None = typer.Option(
115
+ None,
116
+ "--working-branch",
117
+ "-w",
118
+ help="Git branch to use for the imported pipeline (defaults to current local branch)",
119
+ ),
107
120
  ):
108
121
  """
109
122
  Create a pipeline in Orchestra by referencing a YAML file in your git repository.
@@ -146,6 +159,13 @@ def import_pipeline(
146
159
  typer.echo(red("Could not detect default branch from git"))
147
160
  raise typer.Exit(code=1)
148
161
 
162
+ # Determine working branch (explicit option or current branch)
163
+ if working_branch is None:
164
+ working_branch = _detect_current_branch(repo_root)
165
+ if not working_branch:
166
+ typer.echo(red("Could not detect current branch from git"))
167
+ raise typer.Exit(code=1)
168
+
149
169
  # Compute YAML path relative to repo root
150
170
  try:
151
171
  yaml_path = str(path.resolve().relative_to(repo_root.resolve()))
@@ -161,6 +181,7 @@ def import_pipeline(
161
181
  "storage_provider": _detect_storage_provider(_get_remote_url(repo_root)),
162
182
  "repository": repository_slug,
163
183
  "default_branch": default_branch,
184
+ "working_branch": working_branch,
164
185
  "yaml_path": yaml_path,
165
186
  "alias": alias,
166
187
  }
@@ -71,6 +71,7 @@ def test_import_success(
71
71
  "storage_provider": storage_provider,
72
72
  "repository": repository,
73
73
  "default_branch": "main",
74
+ "working_branch": "main",
74
75
  "yaml_path": "pipe.yaml",
75
76
  "alias": "demo",
76
77
  },
@@ -81,6 +82,7 @@ def test_import_success(
81
82
  ("rev-parse", "--show-toplevel"): (0, str(repo_root), ""),
82
83
  ("remote", "get-url", "origin"): (0, git_origin, ""),
83
84
  ("symbolic-ref", "refs/remotes/origin/HEAD"): (0, "refs/remotes/origin/main", ""),
85
+ ("rev-parse", "--abbrev-ref", "HEAD"): (0, "main", ""),
84
86
  ("status", "--porcelain"): (0, "", ""),
85
87
  # Do not provide upstream to skip that branch check path
86
88
  ("rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"): (1, "", ""),
@@ -148,6 +150,7 @@ def test_import_api_error(monkeypatch, tmp_path: Path, httpx_mock: HTTPXMock):
148
150
  ("rev-parse", "--show-toplevel"): (0, str(repo_root), ""),
149
151
  ("remote", "get-url", "origin"): (0, "git@github.com:org/repo.git", ""),
150
152
  ("symbolic-ref", "refs/remotes/origin/HEAD"): (0, "refs/remotes/origin/main", ""),
153
+ ("rev-parse", "--abbrev-ref", "HEAD"): (0, "main", ""),
151
154
  ("status", "--porcelain"): (0, "", ""),
152
155
  ("rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"): (1, "", ""),
153
156
  }
@@ -228,6 +231,14 @@ def test_warnings_printed(monkeypatch, tmp_path: Path, httpx_mock: HTTPXMock):
228
231
  url="https://app.getorchestra.io/api/engine/public/pipelines/import",
229
232
  json={"id": mock_pipeline_id},
230
233
  status_code=201,
234
+ match_json={
235
+ "storage_provider": "GITHUB",
236
+ "repository": "org/repo",
237
+ "default_branch": "main",
238
+ "working_branch": "some-branch",
239
+ "yaml_path": "p.yaml",
240
+ "alias": "demo",
241
+ },
231
242
  )
232
243
 
233
244
  import subprocess
@@ -236,6 +247,7 @@ def test_warnings_printed(monkeypatch, tmp_path: Path, httpx_mock: HTTPXMock):
236
247
  ("rev-parse", "--show-toplevel"): (0, str(repo_root), ""),
237
248
  ("remote", "get-url", "origin"): (0, "git@github.com:org/repo.git", ""),
238
249
  ("symbolic-ref", "refs/remotes/origin/HEAD"): (0, "refs/remotes/origin/main", ""),
250
+ ("rev-parse", "--abbrev-ref", "HEAD"): (0, "some-branch", ""),
239
251
  ("status", "--porcelain"): (0, " M p.yaml\n", ""),
240
252
  ("rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"): (0, "origin/main", ""),
241
253
  ("rev-parse", "HEAD"): (0, "aaaa", ""),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orchestra-cli
3
- Version: 0.1.1
3
+ Version: 0.1.2
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
@@ -87,7 +87,8 @@ export ORCHESTRA_API_KEY=... # required
87
87
 
88
88
  orchestra import \
89
89
  --alias my-pipeline \
90
- --path ./pipelines/pipeline.yaml
90
+ --path ./pipelines/pipeline.yaml \
91
+ --working-branch my-feature-branch # optional; defaults to current local branch
91
92
  # or
92
93
  orchestra-cli import -a my-pipeline -p ./pipelines/pipeline.yaml
93
94
  ```
@@ -96,6 +97,7 @@ Options
96
97
 
97
98
  - `-a, --alias` (required): The alias you want to register the pipeline under.
98
99
  - `-p, --path` (required): Path to the YAML file. Must be inside a git repository.
100
+ - `-w, --working-branch` (optional): Branch to associate as the working branch for this pipeline import. If omitted, the current local git branch is used.
99
101
 
100
102
  Notes
101
103
 
@@ -103,6 +105,7 @@ Notes
103
105
  - Git details are detected automatically:
104
106
  - Supported providers: GitHub, GitLab, Azure DevOps.
105
107
  - The default branch is detected from `origin`.
108
+ - The working branch defaults to your current local branch when not specified.
106
109
  - The YAML path is computed relative to the repository root.
107
110
  - On success, the command prints the created pipeline ID (or a success message).
108
111
  - Exit codes: `0` on success, `1` on failure.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "orchestra-cli"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "Orchestra CLI. Perform operations with Orchestra locally."
5
5
  readme = "README.md"
6
6
  authors = [
File without changes