Repository navigation
ability to disable http and/or event consumer for user log service - #3285
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 155 |
🟢 Coverage 40.59% diff coverage · -0.01% coverage variation
Metric Results Coverage variation ✅ -0.01% coverage variation (-1.00%) Diff coverage ✅ 40.59% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (14b9622) 93482 26805 28.67% Head commit (9f6df0c) 93579 (+97) 26827 (+22) 28.67% (-0.01%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#3285) 372 151 40.59% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
butonic
left a comment
There was a problem hiding this comment.
the pkg/service package now implements both:
- service.go contains event processing that stores events in nats + publishes sse events
- http.go implements the http handler that reads from nats.
In the activitylog PR I extracted an activitylog service that wraps the nats kv store with the business logic to add and remove events. It is injected into the http service and the events service (but I like your name 'consumer' better).
I know this is more work, but I think we should seperate the implementation aspects. AFAICT the http service then does not need the event stream at all, so we only need to initiate it for the consumer (hm, it also publishes sse events, so maybe events is a better name in this case).
I refactored the code to follow the format from activitylog PR |
|
@maki5 can you rebase? |
69dbad6 to
b964da7
Compare
b964da7 to
a8ae053
Compare
* rename additional calls to AllComponentsDisabledError to
AllApiHandlersDisabledError after refactoring in
66ec376, found in
services/eventhistory and services/graph
…nal/eventstest * instead of defining our own testBus struct in services/userlog, use the one that was recently put into internal/eventstest with e8cf677 for exactly such purposes, just to reduce code duplication
ee3b7b2 to
7f0e453
Compare
Keep main's shared.AllComponentsDisabledError name and use it in userlog and eventhistory as well. Assisted-by: Claude Opus 5.5
for user log service it's possible now to disable/enable from config