Skip to content

Preliminary support for tracing workflow activity #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci_linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
- name: Test diagram
run: cargo test --workspace -F=diagram

- name: Test trace
run: cargo test --workspace -F=trace

- name: Build single_threaded_async
run: cargo build --features single_threaded_async
- name: Test single_threaded_async
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async-task = { version = "4.7.1", optional = true }
bevy_tasks = { version = "0.12", features = ["multi-threaded"] }

itertools = "0.13"
smallvec = "1.13"
smallvec = { version = "1.13", features = ["serde"] }
tokio = { version = "1.39", features = ["sync"] }
futures = "0.3"
backtrace = "0.3"
Expand Down Expand Up @@ -68,6 +68,7 @@ diagram = [
"dep:serde_json",
"dep:strum",
]
trace = ["diagram"]

[dev-dependencies]
async-std = { version = "1.12" }
Expand Down
214 changes: 199 additions & 15 deletions diagram.schema.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions examples/diagram/calculator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ fn main() -> Result<(), Box<dyn Error>> {

let mut registry = DiagramElementRegistry::new();
registry.register_node_builder(
NodeBuilderOptions::new("add").with_name("Add"),
NodeBuilderOptions::new("add").with_default_display_text("Add"),
|builder, config: f64| builder.create_map_block(move |req: f64| req + config),
);
registry.register_node_builder(
NodeBuilderOptions::new("sub").with_name("Subtract"),
NodeBuilderOptions::new("sub").with_default_display_text("Subtract"),
|builder, config: f64| builder.create_map_block(move |req: f64| req - config),
);
registry.register_node_builder(
NodeBuilderOptions::new("mul").with_name("Multiply"),
NodeBuilderOptions::new("mul").with_default_display_text("Multiply"),
|builder, config: f64| builder.create_map_block(move |req: f64| req * config),
);
registry.register_node_builder(
NodeBuilderOptions::new("div").with_name("Divide"),
NodeBuilderOptions::new("div").with_default_display_text("Divide"),
|builder, config: f64| builder.create_map_block(move |req: f64| req / config),
);

Expand Down
17 changes: 11 additions & 6 deletions registry.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@
"additionalProperties": {
"$ref": "#/$defs/SectionRegistration"
}
},
"trace_supported": {
"type": "boolean"
}
},
"required": [
"nodes",
"sections",
"trace_supported",
"messages",
"schemas"
],
Expand Down Expand Up @@ -114,7 +118,8 @@
"config_schema": {
"$ref": "#/$defs/Schema"
},
"name": {
"default_display_text": {
"description": "If the user does not specify a default display text, the node ID will\n be used here.",
"type": "string"
},
"request": {
Expand All @@ -125,7 +130,7 @@
}
},
"required": [
"name",
"default_display_text",
"request",
"response",
"config_schema"
Expand Down Expand Up @@ -204,15 +209,15 @@
"config_schema": {
"$ref": "#/$defs/Schema"
},
"default_display_text": {
"type": "string"
},
"metadata": {
"$ref": "#/$defs/SectionMetadata"
},
"name": {
"type": "string"
}
},
"required": [
"name",
"default_display_text",
"metadata",
"config_schema"
]
Expand Down
Loading