Skip to content

Commit 3532243

Browse files
fix: address PR review findings and OSS readiness
Release workflows: checkout the correct ref on workflow_dispatch instead of defaulting to branch HEAD, preventing mismatched binaries for tags. SDK (run_flow): check runtime state before resuming — only call resume when the runtime is actually paused, avoiding failures on already-running runtimes. Omit spec key from request body when None instead of sending "spec": null. Add skip_serializing_if to FlowRunSpec fields so unset options aren't serialized as null. Auth: remove spurious Content-Type: application/json from token exchange (empty body). Use .expect() instead of .unwrap() on SystemTime. CLI: add proper clap env bindings with hide_env_values on the SA key. Expose --since, --until, --offset, --limit on flow list-runs. Require --http when --bind is passed on the mcp subcommand. OSS readiness: add MIT LICENSE (Ascend Labs, Inc), remove private PyPI index from pyproject.toml, add .env to .gitignore, add repository/ homepage URLs to all Cargo.toml and pyproject.toml, add readme to pyproject.toml, note Windows unsupported in README. API surface: add #[non_exhaustive] to RuntimeFilters and FlowRunFilters for semver safety. Add SAFETY comment on unsafe block in reset_sigint. Update skill.md with missing spec fields. Apply same fixes (conditional resume, spec omission, Content-Type) to tests/rest.py reference client. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f4b6d2d commit 3532243

File tree

21 files changed

+207
-94
lines changed

21 files changed

+207
-94
lines changed

.github/workflows/release-python.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
os: macos-latest
3535
steps:
3636
- uses: actions/checkout@v4
37+
with:
38+
ref: ${{ github.event.inputs.tag || github.ref }}
3739
- uses: actions/setup-python@v5
3840
with:
3941
python-version: "3.13"
@@ -62,6 +64,8 @@ jobs:
6264
runs-on: ubuntu-latest
6365
steps:
6466
- uses: actions/checkout@v4
67+
with:
68+
ref: ${{ github.event.inputs.tag || github.ref }}
6569
- uses: actions/setup-python@v5
6670
with:
6771
python-version: "3.13"

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
os: macos-latest
3535
steps:
3636
- uses: actions/checkout@v4
37+
with:
38+
ref: ${{ github.event.inputs.tag || github.ref }}
3739
- uses: actions/setup-python@v5
3840
with:
3941
python-version: "3.13"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ dist/
1717
.vscode/
1818
*.swp
1919

20+
# Secrets
21+
.env
22+
.env.*
23+
2024
# OS
2125
.DS_Store
2226

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ascend-tools [-o text|json] [-V]
102102
103103
flow list --runtime <UUID>
104104
flow run <FLOW_NAME> --runtime <UUID> [--spec '{}'] [--resume]
105-
flow list-runs -r/--runtime <UUID> [--status, -f/--flow-name]
105+
flow list-runs -r/--runtime <UUID> [--status, -f/--flow-name, --since, --until, --offset, --limit]
106106
flow get-run <RUN_NAME> -r/--runtime <UUID>
107107
108108
skill install --target <PATH>

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Ascend Labs, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ SDK, CLI, and MCP server for the Ascend REST API.
66
77
## Install
88

9+
Pre-built binaries are available for Linux and macOS. Windows users should use Linux/macOS.
10+
911
```bash
1012
uv tool install ascend-tools
1113
```

pyproject.toml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ requires-python = ">=3.11"
66
license = "MIT"
77
authors = [{ name = "Cody", email = "cody.peterson@ascend.io" }]
88
dependencies = []
9+
readme = "README.md"
10+
11+
[project.urls]
12+
Repository = "https://github.com/ascend-io/ascend-tools"
13+
Homepage = "https://github.com/ascend-io/ascend-tools"
914

1015
[project.scripts]
1116
ascend-tools = "ascend_tools:main"
@@ -24,13 +29,6 @@ python-packages = ["ascend_tools"]
2429
python-source = "src"
2530
manifest-path = "src/ascend_tools/ascend-tools-py/Cargo.toml"
2631

27-
[[tool.uv.index]]
28-
url = "https://pypi.org/simple/"
29-
30-
[[tool.uv.index]]
31-
url = "https://us-python.pkg.dev/ascend-io-ops-artifacts/private-pypi/simple"
32-
default = true
33-
3432
[build-system]
3533
requires = ["maturin>=1.0,<2.0"]
3634
build-backend = "maturin"

src/ascend_tools/ascend-tools-cli/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ rust-version = "1.85"
66
authors = ["Cody <cody.peterson@ascend.io>"]
77
license = "MIT"
88
description = "CLI for the Ascend REST API"
9+
repository = "https://github.com/ascend-io/ascend-tools"
10+
homepage = "https://github.com/ascend-io/ascend-tools"
911

1012
[lib]
1113
name = "ascend_tools_cli"

src/ascend_tools/ascend-tools-cli/src/cli.rs

Lines changed: 83 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@ struct Cli {
1212
#[arg(short, long, global = true, value_enum, default_value_t = OutputMode::Text)]
1313
output: OutputMode,
1414

15-
/// Service account ID [env: ASCEND_SERVICE_ACCOUNT_ID]
16-
#[arg(long, global = true)]
15+
/// Service account ID
16+
#[arg(long, global = true, env = "ASCEND_SERVICE_ACCOUNT_ID")]
1717
service_account_id: Option<String>,
1818

19-
/// Service account key [env: ASCEND_SERVICE_ACCOUNT_KEY]
20-
#[arg(long, global = true)]
19+
/// Service account key
20+
#[arg(
21+
long,
22+
global = true,
23+
env = "ASCEND_SERVICE_ACCOUNT_KEY",
24+
hide_env_values = true
25+
)]
2126
service_account_key: Option<String>,
2227

23-
/// Instance API URL [env: ASCEND_INSTANCE_API_URL]
24-
#[arg(long, global = true)]
28+
/// Instance API URL
29+
#[arg(long, global = true, env = "ASCEND_INSTANCE_API_URL")]
2530
instance_api_url: Option<String>,
2631

2732
#[command(subcommand)]
@@ -52,7 +57,7 @@ enum Commands {
5257
#[arg(long)]
5358
http: bool,
5459
/// Bind address for HTTP transport
55-
#[arg(long, default_value = "127.0.0.1:8000")]
60+
#[arg(long, default_value = "127.0.0.1:8000", requires = "http")]
5661
bind: String,
5762
},
5863
/// Manage skills
@@ -127,6 +132,18 @@ enum FlowCommands {
127132
status: Option<String>,
128133
#[arg(short, long)]
129134
flow_name: Option<String>,
135+
/// Filter by start time (ISO 8601)
136+
#[arg(long)]
137+
since: Option<String>,
138+
/// Filter by end time (ISO 8601)
139+
#[arg(long)]
140+
until: Option<String>,
141+
/// Pagination offset
142+
#[arg(long)]
143+
offset: Option<u64>,
144+
/// Pagination limit
145+
#[arg(long)]
146+
limit: Option<u64>,
130147
},
131148
/// Get a flow run
132149
#[command(arg_required_else_help = true)]
@@ -216,12 +233,12 @@ fn handle_runtime(
216233
project_uuid,
217234
environment_uuid,
218235
} => {
219-
let runtimes = client.list_runtimes(RuntimeFilters {
220-
id,
221-
kind,
222-
project_uuid,
223-
environment_uuid,
224-
})?;
236+
let mut filters = RuntimeFilters::default();
237+
filters.id = id;
238+
filters.kind = kind;
239+
filters.project_uuid = project_uuid;
240+
filters.environment_uuid = environment_uuid;
241+
let runtimes = client.list_runtimes(filters)?;
225242
match output {
226243
OutputMode::Json => print_json(&runtimes)?,
227244
OutputMode::Text => {
@@ -321,15 +338,19 @@ fn handle_flow(
321338
runtime,
322339
status,
323340
flow_name,
341+
since,
342+
until,
343+
offset,
344+
limit,
324345
} => {
325-
let runs = client.list_flow_runs(
326-
&runtime,
327-
FlowRunFilters {
328-
status,
329-
flow: flow_name,
330-
..Default::default()
331-
},
332-
)?;
346+
let mut filters = FlowRunFilters::default();
347+
filters.status = status;
348+
filters.flow = flow_name;
349+
filters.since = since;
350+
filters.until = until;
351+
filters.offset = offset;
352+
filters.limit = limit;
353+
let runs = client.list_flow_runs(&runtime, filters)?;
333354
match output {
334355
OutputMode::Json => print_json(&runs)?,
335356
OutputMode::Text => {
@@ -522,6 +543,47 @@ mod tests {
522543
));
523544
}
524545

546+
#[test]
547+
fn test_cli_parses_flow_list_runs_all_filters() {
548+
let cli = Cli::parse_from([
549+
"ascend-tools",
550+
"flow",
551+
"list-runs",
552+
"--runtime",
553+
"uuid-123",
554+
"--status",
555+
"running",
556+
"--flow-name",
557+
"sales",
558+
"--since",
559+
"2025-01-01T00:00:00Z",
560+
"--until",
561+
"2025-12-31T23:59:59Z",
562+
"--offset",
563+
"10",
564+
"--limit",
565+
"50",
566+
]);
567+
match cli.command {
568+
Some(Commands::Flow {
569+
command:
570+
Some(FlowCommands::ListRuns {
571+
since,
572+
until,
573+
offset,
574+
limit,
575+
..
576+
}),
577+
}) => {
578+
assert_eq!(since.as_deref(), Some("2025-01-01T00:00:00Z"));
579+
assert_eq!(until.as_deref(), Some("2025-12-31T23:59:59Z"));
580+
assert_eq!(offset, Some(10));
581+
assert_eq!(limit, Some(50));
582+
}
583+
_ => panic!("expected ListRuns command"),
584+
}
585+
}
586+
525587
#[test]
526588
fn test_cli_parses_flow_get_run() {
527589
let cli = Cli::parse_from([

src/ascend_tools/ascend-tools-cli/src/skill.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ascend-tools runtime pause <UUID>
3333
```bash
3434
ascend-tools flow list --runtime <UUID>
3535
ascend-tools flow run <FLOW_NAME> --runtime <UUID> [--spec '<JSON>'] [--resume]
36-
ascend-tools flow list-runs --runtime <UUID> [--status <STATUS>] [--flow-name <NAME>]
36+
ascend-tools flow list-runs --runtime <UUID> [--status <STATUS>] [--flow-name <NAME>] [--since <ISO8601>] [--until <ISO8601>] [--offset <N>] [--limit <N>]
3737
ascend-tools flow get-run <RUN_NAME> --runtime <UUID>
3838
```
3939

@@ -47,7 +47,7 @@ ascend-tools flow run my-flow --runtime <UUID> --spec '{"components": ["componen
4747
ascend-tools flow run my-flow --runtime <UUID> --spec '{"run_tests": false}'
4848
```
4949

50-
Available spec fields: `full_refresh`, `components`, `component_categories`, `parameters`, `run_tests`, `halt_flow_on_error`, `disable_optimizers`, `runner_overrides`.
50+
Available spec fields: `full_refresh`, `components`, `component_categories`, `parameters`, `run_tests`, `store_test_results`, `halt_flow_on_error`, `disable_optimizers`, `update_materialization_type`, `deep_data_pruning`, `backfill_missing_statistics`, `disable_incremental_metadata_collection`, `runner_overrides`.
5151

5252
## Output
5353

0 commit comments

Comments
 (0)