Skip to content

Commit

Permalink
feat!: do not need to specify extension_group in graph connections (#452
Browse files Browse the repository at this point in the history
)
  • Loading branch information
halajohn authored Dec 23, 2024
1 parent 72ece97 commit 0336c73
Show file tree
Hide file tree
Showing 251 changed files with 76 additions and 1,000 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"request": "launch",
"program": "${workspaceFolder}/out/linux/x64/tests/standalone/ten_runtime_smoke_test",
"args": [
"--gtest_filter=SendTest.NotSpecifyDest"
"--gtest_filter=ExtensionTest.PredefinedGraphMultiExtension1"
],
"cwd": "${workspaceFolder}/out/linux/x64/tests/standalone/",
"env": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@
],
"connections": [
{
"extension_group": "extension_group_1",
"extension": "extension_1",
"cmd": [
{
"name": "hello_world",
"dest": [
{
"extension_group": "extension_group_1",
"extension": "extension_2"
}
]
Expand Down
11 changes: 0 additions & 11 deletions core/src/ten_manager/src/designer/graphs/connections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use crate::designer::DesignerState;
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct DesignerConnection {
pub app: String,
pub extension_group: String,
pub extension: String,

#[serde(skip_serializing_if = "Option::is_none")]
Expand All @@ -43,7 +42,6 @@ impl From<GraphConnection> for DesignerConnection {
fn from(conn: GraphConnection) -> Self {
DesignerConnection {
app: conn.get_app_uri().to_string(),
extension_group: conn.extension_group,
extension: conn.extension,

cmd: conn.cmd.map(get_designer_msg_flow_from_property),
Expand Down Expand Up @@ -89,7 +87,6 @@ fn get_designer_msg_flow_from_property(
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct DesignerDestination {
pub app: String,
pub extension_group: String,
pub extension: String,

#[serde(skip_serializing_if = "Option::is_none")]
Expand All @@ -100,7 +97,6 @@ impl From<GraphDestination> for DesignerDestination {
fn from(destination: GraphDestination) -> Self {
DesignerDestination {
app: destination.get_app_uri().to_string(),
extension_group: destination.extension_group,
extension: destination.extension,
msg_conversion: destination.msg_conversion,
}
Expand Down Expand Up @@ -240,13 +236,11 @@ mod tests {

let expected_connections = vec![DesignerConnection {
app: localhost(),
extension_group: "extension_group_1".to_string(),
extension: "extension_1".to_string(),
cmd: Some(vec![DesignerMessageFlow {
name: "hello_world".to_string(),
dest: vec![DesignerDestination {
app: localhost(),
extension_group: "extension_group_1".to_string(),
extension: "extension_2".to_string(),
msg_conversion: None,
}],
Expand Down Expand Up @@ -322,13 +316,11 @@ mod tests {

let expected_connections = vec![DesignerConnection {
app: localhost(),
extension_group: "extension_group_1".to_string(),
extension: "extension_1".to_string(),
cmd: Some(vec![DesignerMessageFlow {
name: "hello_world".to_string(),
dest: vec![DesignerDestination {
app: localhost(),
extension_group: "extension_group_1".to_string(),
extension: "extension_2".to_string(),
msg_conversion: None,
}],
Expand All @@ -337,7 +329,6 @@ mod tests {
name: "data".to_string(),
dest: vec![DesignerDestination {
app: localhost(),
extension_group: "extension_group_1".to_string(),
extension: "extension_2".to_string(),
msg_conversion: None,
}],
Expand All @@ -346,7 +337,6 @@ mod tests {
name: "pcm".to_string(),
dest: vec![DesignerDestination {
app: localhost(),
extension_group: "extension_group_1".to_string(),
extension: "extension_2".to_string(),
msg_conversion: None,
}],
Expand All @@ -355,7 +345,6 @@ mod tests {
name: "image".to_string(),
dest: vec![DesignerDestination {
app: localhost(),
extension_group: "extension_group_1".to_string(),
extension: "extension_2".to_string(),
msg_conversion: None,
}],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@
],
"connections": [
{
"extension_group": "extension_group_1",
"extension": "extension_1",
"cmd": [
{
"name": "hello_world",
"dest": [
{
"extension_group": "extension_group_1",
"extension": "extension_2"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
],
"connections": [
{
"extension_group": "extension_group_1",
"extension": "extension_1",
"cmd": [
{
"name": "hello_world",
"dest": [
{
"extension_group": "extension_group_1",
"extension": "extension_2"
}
]
Expand All @@ -38,7 +36,6 @@
"name": "data",
"dest": [
{
"extension_group": "extension_group_1",
"extension": "extension_2"
}
]
Expand All @@ -49,7 +46,6 @@
"name": "pcm",
"dest": [
{
"extension_group": "extension_group_1",
"extension": "extension_2"
}
]
Expand All @@ -60,7 +56,6 @@
"name": "image",
"dest": [
{
"extension_group": "extension_group_1",
"extension": "extension_2"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@
"connections": [
{
"app": "localhost",
"extension_group": "extension_group_1",
"extension": "extension_1",
"cmd": [
{
"name": "hello_world",
"dest": [
{
"app": "localhost",
"extension_group": "extension_group_1",
"extension": "extension_2"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
],
"connections": [
{
"extension_group": "extension_group_1",
"extension": "extension_1",
"cmd": [
{
"name": "hello_world",
"dest": [
{
"extension_group": "extension_group_1",
"extension": "extension_2"
}
]
Expand All @@ -38,7 +36,6 @@
"name": "data",
"dest": [
{
"extension_group": "extension_group_1",
"extension": "extension_2"
}
]
Expand All @@ -49,7 +46,6 @@
"name": "pcm",
"dest": [
{
"extension_group": "extension_group_1",
"extension": "extension_2"
}
]
Expand All @@ -60,7 +56,6 @@
"name": "image",
"dest": [
{
"extension_group": "extension_group_1",
"extension": "extension_2"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@
"connections": [
{
"app": "localhost",
"extension_group": "extension_group_1",
"extension": "extension_1",
"cmd": [
{
"name": "hello_world",
"dest": [
{
"app": "localhost",
"extension_group": "extension_group_1",
"extension": "extension_2"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ impl From<DesignerConnection> for GraphConnection {
fn from(designer_connection: DesignerConnection) -> Self {
GraphConnection {
app: Some(designer_connection.app),
extension_group: designer_connection.extension_group,
extension: designer_connection.extension,

cmd: designer_connection
Expand Down Expand Up @@ -58,7 +57,6 @@ impl From<DesignerDestination> for GraphDestination {
fn from(designer_destination: DesignerDestination) -> Self {
GraphDestination {
app: Some(designer_destination.app),
extension_group: designer_destination.extension_group,
extension: designer_destination.extension,
msg_conversion: designer_destination.msg_conversion,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
],
"connections": [
{
"extension_group": "some_group",
"extension": "ext_a",
"app": "http://localhost:8000",
"extension": "ext_a",
"cmd": [
{
"name": "cmd_1",
"dest": [
{
"extension_group": "some_group",
"extension": "ext_b"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
],
"connections": [
{
"extension_group": "some_group",
"extension": "ext_a",
"cmd": [
{
"name": "cmd_1",
"dest": [
{
"extension_group": "some_group",
"extension": "ext_b"
}
]
Expand Down Expand Up @@ -55,14 +53,12 @@
],
"connections": [
{
"extension_group": "some_group",
"extension": "ext_a",
"cmd": [
{
"name": "cmd_1",
"dest": [
{
"extension_group": "some_group",
"extension": "ext_c"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
],
"connections": [
{
"extension_group": "some_group",
"extension": "ext_a",
"cmd": [
{
"name": "cmd_1",
"dest": [
{
"extension_group": "some_group",
"extension": "ext_b"
}
]
Expand All @@ -38,4 +36,4 @@
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
],
"connections": [
{
"extension_group": "some_group",
"extension": "ext_a",
"cmd": [
{
"name": "cmd_1",
"dest": [
{
"extension_group": "some_group",
"extension": "ext_b"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
],
"connections": [
{
"extension_group": "some_group",
"extension": "ext_a",
"cmd": [
{
"name": "cmd_1",
"dest": [
{
"extension_group": "some_group",
"extension": "ext_b"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
"connections": [
{
"extension": "some_extension",
"extension_group": "some_group",
"cmd": [
{
"name": "hello",
"dest": [
{
"extension_group": "some_group",
"extension": "another_ext"
}
]
Expand All @@ -31,13 +29,11 @@
},
{
"extension": "some_extension",
"extension_group": "some_group",
"cmd": [
{
"name": "hello_2",
"dest": [
{
"extension_group": "some_group",
"extension": "another_ext"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
],
"connections": [
{
"extension_group": "some_group",
"extension": "ext_a",
"cmd": [
{
"name": "cmd_1",
"dest": [
{
"extension_group": "some_group",
"extension": "ext_b"
}
]
Expand Down
Loading

0 comments on commit 0336c73

Please sign in to comment.