• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 18463697957
51%

Build:
DEFAULT BRANCH: main
Ran 13 Oct 2025 11:09AM UTC
Jobs 1
Files 284
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Oct 2025 11:04AM UTC coverage: 46.58% (+0.4%) from 46.187%
18463697957

push

github

web-flow
feat: Add pluggable storage backend for session management (#1989)

* feat: Add pluggable storage backend for session management

Refactors the session management system to use a pluggable storage
interface, enabling future support for distributed storage backends
like Redis/Valkey while maintaining backward compatibility.

What Changed

- Introduced a Storage interface that abstracts session persistence
- Refactored Manager to use the Storage interface instead of directly
  using sync.Map
- Created LocalStorage implementation that maintains the existing
  in-memory behavior
- Added JSON serialization support for sessions to enable future
  network storage
- Extended Session interface with Type() and metadata methods that
  were already implemented in concrete types

Why

The previous implementation was tightly coupled to in-memory storage,
making it impossible to share sessions across multiple ToolHive instances.
This refactoring enables:
- Horizontal scaling with shared session state
- Session persistence across restarts
- Future Redis/Valkey backend support without breaking changes

Testing

Added comprehensive unit tests covering:
- LocalStorage implementation
- Session serialization/deserialization
- Manager with pluggable storage
- All existing session types (ProxySession, SSESession, StreamableSession)

All tests pass and the implementation maintains full backward compatibility.

Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>

* Address PR feedback: fix race condition and encapsulation issues

- Fix race condition in LocalStorage.Close() by collecting keys before deletion
- Update Close() comment to reflect actual behavior (clears sessions, not a no-op)
- Add setter methods (setTimestamps, setMetadataMap) to ProxySession for proper encapsulation
- Update serialization to use setter methods instead of direct field access
- Fix StreamableSession constructor to use NewTypedProxySession for proper initialization
- Add type assertion check in... (continued)

197 of 220 new or added lines in 7 files covered. (89.55%)

29 existing lines in 4 files now uncovered.

17414 of 37385 relevant lines covered (46.58%)

16.07 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
82.17
-1.07% pkg/transport/proxy/httpsse/http_proxy.go
4
64.55
-1.01% pkg/transport/proxy/streamable/streamable_proxy.go
4
93.94
pkg/transport/session/serialization.go
4
94.44
pkg/transport/session/storage_local.go
7
67.72
20.71% pkg/transport/session/manager.go

Uncovered Existing Lines

Lines Coverage ∆ File
2
92.86
-1.43% pkg/secrets/keyring/composite.go
2
64.55
-1.01% pkg/transport/proxy/streamable/streamable_proxy.go
4
82.17
-1.07% pkg/transport/proxy/httpsse/http_proxy.go
21
48.94
-15.96% pkg/secrets/keyring/keyctl_linux.go
Jobs
ID Job ID Ran Files Coverage
1 18463697957.1 13 Oct 2025 11:09AM UTC 284
46.58
GitHub Action Run
Source Files on build 18463697957
  • Tree
  • List 284
  • Changed 8
  • Source Changed 5
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #18463697957
  • 48db1ad0 on github
  • Prev Build on main (#18462692837)
  • Next Build on main (#18464004164)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc