-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: missing UI connections in console (#6509)
Fixes #6458 Some UI connections were missing in the Wing Console because when generating information about different resource nodes, inflight closures created in Winglang were treated as resources while inflight closures created using the TypeScript framework were not. To fix this discrepancy, this PR changes how connections are generated so that all intermediate inflight closures are no longer modeled as nodes. Instead, inflight closures (both those created in Winglang and in TypeScript) are explored until resource-like nodes are reached. Taking this app as an example: ```js let b = new cloud.Bucket(); let listData = inflight () => { b.list(); }; new cloud.Function(inflight () => { listData(); b.put("hello.txt", "world"); }); ``` Previously the SDK generated this connection data: ```js { "source": "root/Default/$Closure1_0", "sourceOp": "handle", "target": "root/Default/Bucket", "targetOp": "list", "name": "list" }, { "source": "root/Default/$Closure2_0", "sourceOp": "handle", "target": "root/Default/Bucket", "targetOp": "put", "name": "put" }, { "source": "root/Default/$Closure2_0", "sourceOp": "handle", "target": "root/Default/$Closure1_0", "targetOp": "handle", "name": "handle" }, { "source": "root/Default/Function", "sourceOp": "invoke", "target": "root/Default/$Closure2_0", "targetOp": "handle", "name": "handle" }, { "source": "root/Default/Function", "sourceOp": "invokeAsync", "target": "root/Default/$Closure2_0", "targetOp": "handle", "name": "handle" } ``` Now it generates this connection data (note that all "closure" nodes are gone - we just emit relationships between real resources): ```js { "source": "root/Default/Function", "sourceOp": "invoke", "target": "root/Default/Bucket", "targetOp": "put", "name": "put" }, { "source": "root/Default/Function", "sourceOp": "invoke", "target": "root/Default/Bucket", "targetOp": "list", "name": "list" }, { "source": "root/Default/Function", "sourceOp": "invokeAsync", "target": "root/Default/Bucket", "targetOp": "put", "name": "put" }, { "source": "root/Default/Function", "sourceOp": "invokeAsync", "target": "root/Default/Bucket", "targetOp": "list", "name": "list" } ``` ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [x] Tests added (always) - [ ] Docs updated (only required for features) - [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
- Loading branch information
Showing
17 changed files
with
191 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.