winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.75k stars 187 forks source link

feat(sdk): show `cloud.Api` endpoint functions #6595

Closed skyrpex closed 4 weeks ago

skyrpex commented 1 month ago

This change makes cloud.Api endpoint functions visible in the Console's map view.

github-actions[bot] commented 1 month ago

Thanks for opening this pull request! :tada: Please consult the contributing guidelines for details on how to contribute to this project. If you need any assistance, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @chriscbr
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @hasanaburayyan
Wing Playground @eladcon
monadabot commented 1 month ago

Console preview environment is available at https://wing-console-pr-6595.fly.dev :rocket:

Last Updated (UTC) 2024-05-30 09:32
monadabot commented 1 month ago

Benchmarks

Comparison to Baseline 🟥⬜⬜⬜⬜⬜🟥⬜⬜⬜⬜⬜⬜ | Benchmark | Before | After | Change | | :-- | --: | --: | --: | | version | 55ms±0.56 | 58ms±0.75 | +3ms (+4.84%)🟥 | | functions_10.test.w -t sim | 496ms±33.03 | 491ms±9.16 | -4ms (-0.85%)⬜ | | functions_10.test.w -t tf-aws | 2009ms±17.79 | 2023ms±31.24 | +14ms (+0.67%)⬜ | | hello_world.test.w -t sim | 397ms±5.42 | 399ms±4.57 | +3ms (+0.67%)⬜ | | hello_world.test.w -t tf-aws | 1431ms±9.04 | 1442ms±5.22 | +11ms (+0.77%)⬜ | | functions_1.test.w -t sim | 391ms±3.25 | 398ms±4.02 | +7ms (+1.79%)⬜ | | functions_1.test.w -t tf-aws | 805ms±6 | 842ms±11.17 | +38ms (+4.66%)🟥 | | jsii_big.test.w -t sim | 2754ms±12.91 | 2822ms±20.25 | +69ms (+2.49%)⬜ | | jsii_big.test.w -t tf-aws | 2955ms±9.61 | 3032ms±14.74 | +77ms (+2.62%)⬜ | | empty.test.w -t sim | 357ms±3.9 | 364ms±4.83 | +8ms (+2.17%)⬜ | | empty.test.w -t tf-aws | 589ms±4.39 | 605ms±14.78 | +16ms (+2.77%)⬜ | | jsii_small.test.w -t sim | 368ms±4.07 | 379ms±7.29 | +10ms (+2.84%)⬜ | | jsii_small.test.w -t tf-aws | 601ms±4.01 | 613ms±4.82 | +13ms (+2.09%)⬜ | ⬜ Within 1.5 standard deviations 🟩 Faster, Above 1.5 standard deviations 🟥 Slower, Above 1.5 standard deviations _Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI._
Results |name|mean|min|max|moe|sd| |----|----|----|----|----|----| |version|58ms|57ms|60ms|1ms|1ms| |functions_10.test.w -t sim|491ms|460ms|507ms|9ms|13ms| |functions_10.test.w -t tf-aws|2023ms|1975ms|2118ms|31ms|44ms| |hello_world.test.w -t sim|399ms|394ms|415ms|5ms|6ms| |hello_world.test.w -t tf-aws|1442ms|1427ms|1450ms|5ms|7ms| |functions_1.test.w -t sim|398ms|390ms|409ms|4ms|6ms| |functions_1.test.w -t tf-aws|842ms|821ms|875ms|11ms|16ms| |jsii_big.test.w -t sim|2822ms|2785ms|2871ms|20ms|28ms| |jsii_big.test.w -t tf-aws|3032ms|3000ms|3077ms|15ms|21ms| |empty.test.w -t sim|364ms|355ms|377ms|5ms|7ms| |empty.test.w -t tf-aws|605ms|584ms|660ms|15ms|21ms| |jsii_small.test.w -t sim|379ms|364ms|390ms|7ms|10ms| |jsii_small.test.w -t tf-aws|613ms|600ms|623ms|5ms|7ms|
Last Updated (UTC) 2024-05-30 09:27
skyrpex commented 1 month ago

@eladb not sure if this is the solution you were looking for, I remember this comment here https://github.com/winglang/wing/issues/5212#issuecomment-1854646682.

The problem is that invoking the endpoint functions directly is strange since it's expecting a specific API payload format.

IMO it would be interesting if we detected that they are cloud.Api functions and provided some kind of schema for the event payload, but not sure how much work is required for that to happen.

mergify[bot] commented 4 weeks ago

Thanks for contributing, @skyrpex! This PR will now be added to the merge queue, or immediately merged if console-force-show-function-endpoints is up-to-date with main and the queue is empty.

monadabot commented 4 weeks ago

Congrats! :rocket: This was released in Wing 0.74.29.