Refactor into multi-package mono-repo - #7
Merged
Conversation
sillychipmunk
force-pushed
the
refactor/multi-package-mono-repo
branch
from
April 6, 2026 08:07
76c8f06 to
6c953bd
Compare
jarlah
reviewed
Apr 6, 2026
sillychipmunk
force-pushed
the
refactor/multi-package-mono-repo
branch
from
April 6, 2026 08:28
6c953bd to
e404eda
Compare
Owner
|
Add test in tower-hs for using the middlewares for something else like database health queries |
sillychipmunk
force-pushed
the
refactor/multi-package-mono-repo
branch
3 times, most recently
from
April 6, 2026 09:48
9b35220 to
5a74a8b
Compare
jarlah
reviewed
Apr 6, 2026
Owner
|
Also need to check if all packages are ready for Hackage. And, if they are independently useful. Im considering an examples folder for tower-hs, servant and http. How it will actually look like using the three libraries |
sillychipmunk
force-pushed
the
refactor/multi-package-mono-repo
branch
2 times, most recently
from
April 6, 2026 10:54
4129f42 to
b60eb0c
Compare
…nt-tower-hs Extract a generic tower-hs core library from the monolithic http-tower-hs package, and add a servant-tower-hs adapter with servant-native middleware. tower-hs (generic core): - Service/Middleware abstractions, ServiceError (HttpError -> TransportError) - Middleware: Retry, Timeout, CircuitBreaker, Filter, Hedge, TestDouble - Logging: generic timed logging with user-provided formatter - Tracing: configurable OTel spans with request/response/error attribute hooks - Validate: generic response validation - Transform: withMapRequest/withMapRequestPure for request transformation - Tower.Error.Testing: shared Eq instance (eliminates 9 orphan instances) http-tower-hs (HTTP wrapper, depends on tower-hs): - Client, SetHeader, RequestId, FollowRedirect, Validate, Logging, Tracing - All built on generic tower-hs building blocks (Validate, Transform, Tracing, Logging) - Network.HTTP.Tower re-exports everything for backwards compatibility servant-tower-hs (servant adapter + middleware): - Adapter bridging tower-hs middleware to servant's ClientMiddleware type - Servant-native middleware: SetHeader, RequestId, Validate, Tracing, Logging - Also built on generic tower-hs building blocks - Integration tests with real warp server + in-memory OTel exporter Infrastructure: - Multi-package stack.yaml and cabal.project - CI updated for all three packages (build, test, hlint) - 122 tests passing (49 + 44 + 29)
sillychipmunk
force-pushed
the
refactor/multi-package-mono-repo
branch
from
April 6, 2026 11:05
b60eb0c to
cf12717
Compare
jarlah
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tower-hscore library with protocol-agnosticService/Middlewareabstractions and middleware (retry, timeout, circuit breaker, filter, hedge, test doubles)Tower.Middleware.Tracing— configurable OTel spans with request/response/error attribute hooksTower.Middleware.Logging— timed logging with user-provided formatterTower.Middleware.Validate— generic response validationTower.Middleware.Transform— generic request transformation (withMapRequest,withMapRequestPure)http-tower-hsinto a thin HTTP wrapper depending ontower-hs— SetHeader, RequestId, Validate, Tracing, Logging all use generic building blocksservant-tower-hswith:ClientMiddlewaretypeRequest/Responsetypes, also built on generic building blocks)examples/:example-http-client— HTTP client with combined generic + HTTP middlewareexample-servant-client— Servant client with combined generic + servant middlewareexample-generic-redis— Redis client demonstrating non-HTTP use caseextra-doc-files, version bounds ontower-hsdep,Paths_*for OTellibraryVersionHttpErrortoTransportErrorfor protocol-agnostic namingTower.Error.Testingmodule withEq ServiceErrorinstance (eliminates 9 orphan instances)Network.HTTP.Towerre-exports everything for backwards compatibilityTest plan
stack test tower-hs— 55 tests passing (including 6 Redis Docker integration tests)stack test http-tower-hs— 44 tests passingstack test servant-tower-hs— 29 tests passing (including OTel tracing + combined middleware stack)stack test— all 128 tests passingstack sdist— all 3 packages produce clean tarballs with zero warningsstack run example-http-client— works