Skip to content

feat(api): Add Server-Sent Events#111

Open
tab wants to merge 4 commits into
masterfrom
feature/sse
Open

feat(api): Add Server-Sent Events#111
tab wants to merge 4 commits into
masterfrom
feature/sse

Conversation

@tab
Copy link
Copy Markdown
Owner

@tab tab commented Apr 12, 2026

  • Add SSE streaming configuration and validation
  • Use default values when absent

@tab tab requested a review from Copilot April 12, 2026 16:58
@tab tab self-assigned this Apr 12, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.streaming config (connections + buffer) and validates/applies defaults when the server is enabled.
  • Adds Config accessors 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.

Comment thread internal/config/constants.go Outdated
Comment thread internal/config/.tmp_streaming_load_test.go Outdated
- Add streaming configuration and validation
- Use default values when absent
@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 12, 2026

Codecov Report

❌ Patch coverage is 69.35484% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.74%. Comparing base (d5adc16) to head (87d9b44).

Files with missing lines Patch % Lines
internal/app/registry/store.go 0.00% 19 Missing ⚠️

❌ 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

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
internal/app/api/connection.go 100.00% <100.00%> (ø)
internal/app/bus/bus.go 97.01% <ø> (ø)
internal/app/bus/formatter.go 94.91% <100.00%> (+0.17%) ⬆️
internal/app/relay/bridge.go 100.00% <100.00%> (ø)
internal/config/config.go 100.00% <100.00%> (ø)
internal/config/validate.go 100.00% <100.00%> (ø)
internal/app/registry/store.go 75.51% <0.00%> (-3.84%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread internal/config/validate_test.go
Comment thread e2e/default_tier_test.go
@tab tab changed the title feat(config): Add streaming configuration for SSE feat(config): Add Server-Sent Events Apr 12, 2026
@tab tab changed the title feat(config): Add Server-Sent Events feat(app): Add Server-Sent Events Apr 12, 2026
@tab tab changed the title feat(app): Add Server-Sent Events feat(api): Add Server-Sent Events Apr 12, 2026
@tab tab requested a review from Copilot April 12, 2026 17:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Comment thread internal/app/bus/bus.go Outdated
Comment thread internal/app/bus/bus.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Comment thread internal/app/errors/errors.go
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Comment on lines +560 to +565
if len(samples) > 0 {
s.bus.Publish(bus.Message{
Type: bus.EventServiceMetrics,
Data: bus.ServiceMetricsBatch{Samples: samples},
})
}
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants