-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Go wasm #744
feat: Go wasm #744
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## static-musl-build #744 +/- ##
=====================================================
- Coverage 84.62% 80.07% -4.56%
=====================================================
Files 7 8 +1
Lines 3922 4145 +223
=====================================================
Hits 3319 3319
- Misses 603 826 +223 ☔ View full report in Codecov by Sentry. |
I'm going to open this up for review as its already large enough. Will tackle the remaining issues in other PRs before release |
I'm so incredibly excited for this!!!! This will finally remove a fairly annoying road bump with our current usage of flipt <3 |
@erka @GeorgeMac sorry for the massive PR!! If you get a chance I would love some 👀 on evaluation.go as that is where the meat of the changes are and a bunch of concurrency stuff going on |
…86_64 Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks solid. I have only few comments about it.
|
||
// startStreaming starts the background streaming. | ||
// Note: currently any errors cause this method to exit. We still need to implement retries for trying to reconnect. | ||
func (e *EvaluationClient) startStreaming(ctx context.Context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably there should be some reconnect logic. It will work fine to the first connection/timeout error and then client will not get any updates from Flipt (for example, the restart will kill all streaming for the clients). I don't know if I can emulate this with current open-source version. I just make a wild guess here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah you are right again! i was thinking of doing the retry/reconnect logic in another PR before release as this one is already quite large. I have it as a todo on the PR description though.
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
Signed-off-by: Mark Phelps <[email protected]>
* chore: split up package-ffi workflows by OS (#724) * chore: split up package-ffi workflows by OS Signed-off-by: Mark Phelps <[email protected]> * chore: add back notify android test job Signed-off-by: Mark Phelps <[email protected]> * chore: revert back to dynamic lib for now Signed-off-by: Mark Phelps <[email protected]> --------- Signed-off-by: Mark Phelps <[email protected]> * chore: try to build actual static lib for musl Signed-off-by: Mark Phelps <[email protected]> * chore: try to fix musl build Signed-off-by: Mark Phelps <[email protected]> * chore: turn of reqwest default features Signed-off-by: Mark Phelps <[email protected]> * chore: try to fix cross install issue Signed-off-by: Mark Phelps <[email protected]> * chore: revert cross install back to GitHub Signed-off-by: Mark Phelps <[email protected]> * chore: add qemu Signed-off-by: Mark Phelps <[email protected]> * chore: only install qemu for hosts where we need cross-comp Signed-off-by: Mark Phelps <[email protected]> * chore: get rid of glibc builds Signed-off-by: Mark Phelps <[email protected]> * chore: try to update tests to use static lib instead of dynamic lib Signed-off-by: Mark Phelps <[email protected]> * chore: fix merge conflict Signed-off-by: Mark Phelps <[email protected]> * chore: static build flag Signed-off-by: Mark Phelps <[email protected]> * chore: more apk add Signed-off-by: Mark Phelps <[email protected]> * chore: get go tests working Signed-off-by: Mark Phelps <[email protected]> * chore: capture test results Signed-off-by: Mark Phelps <[email protected]> * chore: switch back to .so Signed-off-by: Mark Phelps <[email protected]> * chore: fix package workflow Signed-off-by: Mark Phelps <[email protected]> * chore: fix java file Signed-off-by: Mark Phelps <[email protected]> * chore: add musl shared libs Signed-off-by: Mark Phelps <[email protected]> * chore: set norelr Signed-off-by: Mark Phelps <[email protected]> * chore: refactor to try and get working with debian x86 Signed-off-by: Mark Phelps <[email protected]> * build(deps): bump flipt-io/setup-action from 0.2.0 to 0.3.1 (#727) Bumps [flipt-io/setup-action](https://github.com/flipt-io/setup-action) from 0.2.0 to 0.3.1. - [Release notes](https://github.com/flipt-io/setup-action/releases) - [Changelog](https://github.com/flipt-io/setup-action/blob/main/CHANGELOG.md) - [Commits](flipt-io/setup-action@v0.2.0...v0.3.1) --- updated-dependencies: - dependency-name: flipt-io/setup-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Mark Phelps <[email protected]> * build(deps-dev): bump @types/react in /flipt-client-react (#729) Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 19.0.8 to 19.0.10. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) --- updated-dependencies: - dependency-name: "@types/react" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Mark Phelps <[email protected]> * build(deps-dev): bump @typescript-eslint/eslint-plugin (#730) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.24.0 to 8.24.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.24.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Mark Phelps <[email protected]> * build(deps-dev): bump @typescript-eslint/parser in /flipt-client-react (#728) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.23.0 to 8.24.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.24.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Mark Phelps <[email protected]> * build(deps-dev): bump globals in /flipt-client-react (#731) Bumps [globals](https://github.com/sindresorhus/globals) from 15.14.0 to 15.15.0. - [Release notes](https://github.com/sindresorhus/globals/releases) - [Commits](sindresorhus/globals@v15.14.0...v15.15.0) --- updated-dependencies: - dependency-name: globals dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Mark Phelps <[email protected]> * build(deps-dev): bump rollup in /flipt-client-react (#732) Bumps [rollup](https://github.com/rollup/rollup) from 4.34.2 to 4.34.8. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](rollup/rollup@v4.34.2...v4.34.8) --- updated-dependencies: - dependency-name: rollup dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Mark Phelps <[email protected]> * build(deps-dev): bump prettier from 3.4.2 to 3.5.1 in /flipt-client-node (#734) Bumps [prettier](https://github.com/prettier/prettier) from 3.4.2 to 3.5.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](prettier/prettier@3.4.2...3.5.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Mark Phelps <[email protected]> * build(deps-dev): bump rollup in /flipt-client-browser (#733) Bumps [rollup](https://github.com/rollup/rollup) from 4.34.7 to 4.34.8. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](rollup/rollup@v4.34.7...v4.34.8) --- updated-dependencies: - dependency-name: rollup dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Mark Phelps <[email protected]> * build(deps-dev): bump @types/node in /flipt-client-node (#735) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.13.1 to 22.13.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Mark Phelps <[email protected]> * build(deps): bump com.android.tools.build:gradle (#736) Bumps com.android.tools.build:gradle from 8.8.0 to 8.8.1. --- updated-dependencies: - dependency-name: com.android.tools.build:gradle dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Mark Phelps <[email protected]> * chore: cleanup Signed-off-by: Mark Phelps <[email protected]> * chore: holy s it worked Signed-off-by: Mark Phelps <[email protected]> * chore: rm verbose Signed-off-by: Mark Phelps <[email protected]> * chore: add gitignore for compiled libs Signed-off-by: Mark Phelps <[email protected]> * chore: build on debian:bullseye and link with musl-gcc Signed-off-by: Mark Phelps <[email protected]> * chore: test on more distros; add dagger build cache; support rlib and dylib Signed-off-by: Mark Phelps <[email protected]> * chore: rm duplicate flipt_engine.h Signed-off-by: Mark Phelps <[email protected]> * chore: try to fix csharp and dart tests Signed-off-by: Mark Phelps <[email protected]> * chore: fix csharp paths Signed-off-by: Mark Phelps <[email protected]> * chore: fix ruby lib path Signed-off-by: Mark Phelps <[email protected]> * chore: try to add output to gh summary run Signed-off-by: Mark Phelps <[email protected]> * chore: try to fix csharp paths Signed-off-by: Mark Phelps <[email protected]> * chore: try to fix ruby alpine build; make output a little nicer Signed-off-by: Mark Phelps <[email protected]> * chore: fix csharp build Signed-off-by: Mark Phelps <[email protected]> * chore: rm debug for csharp; test on dotnet alpine image Signed-off-by: Mark Phelps <[email protected]> * chore: fix dart build Signed-off-by: Mark Phelps <[email protected]> * chore: try to debug go segfault Signed-off-by: Mark Phelps <[email protected]> * chore: modify build script to work with android and swift and ffi Signed-off-by: Mark Phelps <[email protected]> * chore: fix engine lint errors Signed-off-by: Mark Phelps <[email protected]> * chore: rename exposed rust functions to _ffi Signed-off-by: Mark Phelps <[email protected]> * chore: try to fix lint errors Signed-off-by: Mark Phelps <[email protected]> * chore: fix destroy_string call in swift Signed-off-by: Mark Phelps <[email protected]> * chore: update android wrapper Signed-off-by: Mark Phelps <[email protected]> * chore: try to fix packaging names to be consistent Signed-off-by: Mark Phelps <[email protected]> * chore: rename (again) to _ffi Signed-off-by: Mark Phelps <[email protected]> * chore: try to fix ordering of test output Signed-off-by: Mark Phelps <[email protected]> * feat: Go wasm (#744) * chore: rm strip step Signed-off-by: Mark Phelps <[email protected]> * chore: split up linux and android workflows Signed-off-by: Mark Phelps <[email protected]> * chore: android try to ffix ndk build Signed-off-by: Mark Phelps <[email protected]> * chore: try to add cargo cache Signed-off-by: Mark Phelps <[email protected]> --------- Signed-off-by: Mark Phelps <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This PR redoes the Go SDK to use pure WASM to get around the issues with Go and musl v glibc issues as mentioned in #719 and other issues/PRs
High Level Changes
flipt-engine-wasm
toflipt-engine-wasm-js
as it is JS specific since it uses wasm-bindgen to generate JS bindingsflipt-engine-wasm
which compiles to 'pure' wasm using thewasm32-wasip1
targetGo SDK API changes
WithUpdateInterval
signature to use atime.Duration
instead ofint
as its more idiomaticWithRef
optionNew
func to take in acontext.Context
as wazero requires one, although we could undo this change and just use context.Background.. however using a context here will allow the user to set a timeout on the initial state fetch if they wishClose
to also take in acontext.Context
for shutdownTODO
FetchMode
, specifically supportStreaming
😬ErrorStrategy
which means we'll need to capture the last error from fetch and hold it in the Go code