-
Notifications
You must be signed in to change notification settings - Fork 16
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
Adding support for Init Functions #65
Conversation
WalkthroughThis pull request introduces the concept of "init functions" to Tarmac, allowing for service initialization routines. It also includes a new build target for test data, and adds a test case for failing init functions. A Go example using Tarmac WASM functions is provided as well. Changes
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 1
Files ignored due to filter (5)
- testdata/fail/docker-compose.yml
- testdata/fail/go.mod
- testdata/fail/go.sum
- testdata/tarmac-fail.json
- testdata/tarmac.json
Files selected for processing (6)
- Makefile (1 hunks)
- docs/wasm-functions/multi-function-services.md (1 hunks)
- pkg/app/app.go (3 hunks)
- pkg/app/app_test.go (1 hunks)
- testdata/fail/Makefile (1 hunks)
- testdata/fail/main.go (1 hunks)
Files skipped from review due to trivial changes (5)
- Makefile
- docs/wasm-functions/multi-function-services.md
- pkg/app/app_test.go
- testdata/fail/Makefile
- testdata/fail/main.go
Additional comments (Suppressed): 1
pkg/app/app.go (1)
- 454-462: The new code introduces the concept of "init functions" which are executed when the service starts. Ensure that these init functions are designed to be idempotent and can handle being called multiple times without causing issues, as they might be called again if the service restarts.
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
==========================================
+ Coverage 82.40% 82.57% +0.17%
==========================================
Files 12 12
Lines 1125 1136 +11
==========================================
+ Hits 927 938 +11
Misses 152 152
Partials 46 46
☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
Run
method inServer
struct to support initializing routes, executing init functions, and scheduling tasks. This change improves the server's functionality and versatility.build-testdata
to the Makefile, facilitating the building of additional test data.