winglang / wing

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

fix(sdk): local bucket files can't be accessed in simulator #7143

Closed Chriscbr closed 2 months ago

Chriscbr commented 2 months ago

Closes #4143

https://github.com/winglang/wing/pull/7137 added the main code structure for serving files through an express server when cloud.Bucket is locally simulated. However, existing code like the publicUrl method was still returning URLs to your file system instead of to the HTTP server. This fixes that bug.

Fixing this enables other use cases, for example allowing a web app redirect the URL from the signed URL of a file they uploaded to the actual file (if the bucket is public).

Misc:

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

github-actions[bot] commented 2 months 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 standard library @chriscbr
Wing Console @skyrpex
Wing compiler and language design @chriscbr
VSCode extension and language server @chriscbr
Wing CLI @chriscbr
Documentation @boyney123
Examples @boyney123
Wing Playground @skyrpex
monadabot commented 2 months ago

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

Last Updated (UTC) 2024-09-18 16:22
monadabot commented 2 months ago

Benchmarks

Comparison to Baseline 🟥🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ | Benchmark | Before | After | Change | | :-- | --: | --: | --: | | version | 59ms±0.88 | 66ms±1.87 | +7ms (+11.78%)🟥 | | functions_10.test.w -t sim | 515ms±13.88 | 533ms±15.58 | +18ms (+3.44%)🟥 | | functions_10.test.w -t tf-aws | 2220ms±29.22 | 2272ms±25.89 | +52ms (+2.34%)⬜ | | jsii_small.test.w -t sim | 392ms±7.51 | 392ms±2.44 | -1ms (-0.16%)⬜ | | jsii_small.test.w -t tf-aws | 621ms±9.62 | 631ms±4.08 | +10ms (+1.6%)⬜ | | functions_1.test.w -t sim | 426ms±5.56 | 425ms±5.52 | -2ms (-0.38%)⬜ | | functions_1.test.w -t tf-aws | 884ms±58.78 | 871ms±6.97 | -13ms (-1.46%)⬜ | | empty.test.w -t sim | 381ms±4.25 | 386ms±4.13 | +5ms (+1.4%)⬜ | | empty.test.w -t tf-aws | 615ms±5.72 | 621ms±2.57 | +7ms (+1.1%)⬜ | | hello_world.test.w -t sim | 422ms±6.1 | 425ms±4.35 | +3ms (+0.66%)⬜ | | hello_world.test.w -t tf-aws | 1512ms±9.13 | 1544ms±12.03 | +33ms (+2.16%)⬜ | | jsii_big.test.w -t sim | 3050ms±21 | 3061ms±21.27 | +11ms (+0.38%)⬜ | | jsii_big.test.w -t tf-aws | 3243ms±16.23 | 3198ms±12.86 | -45ms (-1.4%)⬜ | ⬜ 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|66ms|62ms|72ms|2ms|3ms| |functions_10.test.w -t sim|533ms|492ms|562ms|16ms|22ms| |functions_10.test.w -t tf-aws|2272ms|2215ms|2320ms|26ms|36ms| |jsii_small.test.w -t sim|392ms|386ms|398ms|2ms|3ms| |jsii_small.test.w -t tf-aws|631ms|622ms|637ms|4ms|6ms| |functions_1.test.w -t sim|425ms|411ms|435ms|6ms|8ms| |functions_1.test.w -t tf-aws|871ms|860ms|886ms|7ms|10ms| |empty.test.w -t sim|386ms|377ms|395ms|4ms|6ms| |empty.test.w -t tf-aws|621ms|617ms|627ms|3ms|4ms| |hello_world.test.w -t sim|425ms|415ms|433ms|4ms|6ms| |hello_world.test.w -t tf-aws|1544ms|1520ms|1564ms|12ms|17ms| |jsii_big.test.w -t sim|3061ms|3020ms|3090ms|21ms|30ms| |jsii_big.test.w -t tf-aws|3198ms|3172ms|3224ms|13ms|18ms|
Last Updated (UTC) 2024-09-18 16:27
monadabot commented 2 months ago

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