feat(api): Add Server-Sent Events#111
Conversation
There was a problem hiding this comment.
Pull request overview
Adds configurable streaming (SSE/WebSocket) settings to the built-in API server config, including validation and defaulting behavior when values are omitted.
Changes:
- Introduces
server.streamingconfig (connections + buffer) and validates/applies defaults when the server is enabled. - Adds
Configaccessors for streaming values that fall back to defaults when unset. - Extends tests and example override YAML to cover streaming configuration.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/config/validate.go | Calls new validateStreaming() during server validation; applies defaults and validates pointer-backed fields. |
| internal/config/validate_test.go | Adds validation scenarios and a focused test asserting defaults are applied. |
| internal/config/constants.go | Adds streaming-related default constants (connections/buffer/keepalive). |
| internal/config/config.go | Adds streaming accessors and new Server.Streaming config struct. |
| internal/config/config_test.go | Adds unit tests for the new streaming accessors. |
| internal/config/.tmp_streaming_load_test.go | Adds a temporary loader test (currently hidden by filename). |
| internal/app/errors/errors.go | Adds new error values for invalid streaming config. |
| fuku.override.yaml | Documents streaming override values in the sample override config. |
- Add streaming configuration and validation - Use default values when absent
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (69.35%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #111 +/- ##
==========================================
- Coverage 87.92% 87.74% -0.18%
==========================================
Files 57 58 +1
Lines 5092 5149 +57
==========================================
+ Hits 4477 4518 +41
- Misses 502 517 +15
- Partials 113 114 +1
🚀 New features to boost your workflow:
|
| if len(samples) > 0 { | ||
| s.bus.Publish(bus.Message{ | ||
| Type: bus.EventServiceMetrics, | ||
| Data: bus.ServiceMetricsBatch{Samples: samples}, | ||
| }) | ||
| } |
There was a problem hiding this comment.
The PR description focuses on streaming config/defaults, but this change also introduces a new bus event publication path for per-service metrics (and related filtering/tests elsewhere). Please update the PR description to cover these behavioral changes or split them into a separate PR to keep review scope clear.
Uh oh!
There was an error while loading. Please reload this page.