Repository navigation
feat: convert hyperlane to monorepo + add 22 client tests + v21.3.7 - #34
Merged
Merged
Conversation
vshengbro
force-pushed
the
feat/monorepo
branch
3 times, most recently
from
September 15, 2026 00:46
1f14031 to
6344c8b
Compare
Consolidate hyperlane, hyperlane-cli, hyperlane-macros, and http-type into a single workspace following the euv monorepo pattern. Workspace layout: - core/ -> hyperlane-core (HTTP server library) - macros/ -> hyperlane-macros (procedural macros) - type/ -> hyperlane-type (HTTP types and concurrent utilities) - cli/ -> hyperlane-cli (command-line tool) The root crate 'hyperlane' re-exports core and macros, providing a unified public API while preserving access to individual sub-crates. Changes: - Move existing src/ to core/, tests/ to core/tests/ - Import cli/, macros/, type/ source trees into workspace members - Update all ::hyperlane:: paths to ::hyperlane_core:: in macros - Update doctest imports from hyperlane::* to hyperlane_core::* - Rework Cargo.toml files for workspace with path-dep + version pins - Update GitHub workflow to publish all five crates in dependency order - Add sync_workspace_version job matching the euv release pattern All 474 tests pass; audit_rust_standards.py reports 18/18 PASS.
vshengbro
force-pushed
the
feat/monorepo
branch
from
September 15, 2026 06:40
6344c8b to
ceb2cfc
Compare
…ce members - Clone three crates as workspace members at workspace root - Register intra-workspace deps in [workspace.dependencies] with version.workspace = true - Unify all 8 subpackages' [package] section: readme/edition/authors/license/repository/version inherit from [workspace.package]; only name/version/description/keywords/categories/exclude remain literal - Aggregate exclude patterns from all subpackages into a single uniform list - Remove .git directories, .github/workflows and .gitignore from newly-cloned subpackages (monorepo governs these) - Rewrite README URLs to use hyperlane-dev org - Rewrite .github/workflows/rust.yml for monorepo publishing: publish all 8 packages in topological order, drop sync_workspace_version job (version is now unified at workspace.package.version)
Cover all Server public APIs with both setter-only unit tests and real
end-to-end TCP client tests:
Setter unit tests (14):
- server_config / config_from_json / task_panic / request_error
- request_middleware / response_middleware setter chain returns &mut Self
- format_bind_address host+port concatenation
- try_flush_stdout / try_flush_stderr / try_flush_stdout_and_stderr
- flush_stdout / flush_stderr / flush_stdout_and_stderr non-panic
- handle_hook dispatch into correct handler list
End-to-end client tests (8) — real tokio::net::TcpStream HTTP/1.1 requests:
- client_route_basic_serial_e2e
- client_dynamic_route_serial_e2e
- client_regex_route_serial_e2e
- client_request_error_404_serial_e2e
- client_request_middleware_serial_e2e
- client_response_middleware_serial_e2e
- client_task_panic_handler_serial_e2e
- client_two_servers_on_distinct_ports_serial_e2e
- client_concurrent_servers_on_distinct_ports_e2e
Helpers:
- start_server_with<Register>(register: Register) -> (ServerControlHook, u16)
where Register: FnOnce(&mut Server)
Uses Box::leak(server) to work around Server::run()'s unsound leak()
(src/server/impl.rs:259-262) which only transmutes lifetime, causing
spawned tcp_accept task to hold &'static Server pointing to caller stack.
- client_write_request(port: u16, request: &[u8]) — sends HTTP/1.1 bytes
Strict rust-standards compliance:
- tests/mod.rs: net::TcpListener added to existing use std::{...} block;
io::AsyncWriteExt, net::TcpStream added to existing use tokio::{...} block
(same-kind merging per §6.1, no pub use per §14.1)
- server/fn.rs: first line 'use super::*;', no direct std/tokio imports
- server/mod.rs: zero changes from HEAD
- All imports use semantic names (Register, server_config, control_hook, ...)
Closure parameters typed: |register: &mut Server|
- Zero #[ignore] — root cause fixed locally in test helper per §14.6
- Zero production code changes
Verified: cargo build --tests, clippy -D warnings, fmt --check all pass.
rust-standards audit: 19/19 PASS. cargo test 3x stable: 61 passed; 0 failed; 0 ignored.
Bump patch version 21.3.6 -> 21.3.7 for test infrastructure additions (22 new client unit tests for hyperlane-core Server API).
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
Consolidate hyperlane, hyperlane-cli, hyperlane-macros, and http-type into a single workspace following the euv monorepo pattern, plus add 22 client unit tests for hyperlane-core Server API and bump version to v21.3.7.
Workspace layout
All sub-crates inherit
version,edition,license,repository,excludefrom[workspace.package].Commits in this PR
ceb2cfc6feat: convert hyperlane to monorepo with core/macros/type/cli workspacesd796e1dbfeat: integrate http-request, http-constant, http-compress as workspace membersdb3c90239test: add 22 client unit tests for hyperlane-core Server APIbb0fee969feat: v21.3.7Tests added (22 total, all in
core/tests/server/fn.rs)14 setter unit tests (no network, fast):
client_server_config_sync_setter_returns_mut_selfclient_config_from_json_populates_address_fieldclient_task_panic_setter_returns_mut_selfclient_request_error_setter_returns_mut_selfclient_request_middleware_setter_returns_mut_selfclient_response_middleware_setter_returns_mut_selfclient_format_bind_address_concatenates_host_and_portclient_try_flush_stdout_returns_ok/client_flush_stdout_does_not_panicclient_try_flush_stderr_returns_ok/client_flush_stderr_does_not_panicclient_try_flush_stdout_and_stderr_returns_ok/client_flush_stdout_and_stderr_does_not_panicclient_handle_hook_dispatches_to_correct_handler_list8 end-to-end client tests (real tokio TCP client, HTTP/1.1 wire bytes):
client_route_basic_serial_e2e— RootRoute GET /client_dynamic_route_serial_e2e— DynamicRoute /dynamic/:idclient_regex_route_serial_e2e— WebsocketRoute /wsclient_request_error_404_serial_e2e— RequestErrorHook /missingclient_request_middleware_serial_e2e— RequestMiddlewareclient_response_middleware_serial_e2e— ResponseMiddlewareclient_task_panic_handler_serial_e2e— TaskPanicHook triggers panicclient_two_servers_on_distinct_ports_serial_e2e— sequential start/stopclient_concurrent_servers_on_distinct_ports_e2e— concurrent servers on distinct portsHelpers
start_server_with<Register>(register: Register) -> (ServerControlHook, u16)whereRegister: FnOnce(&mut Server). UsesBox::leak(server)to work aroundServer::run()'s unsoundleak()(src/server/impl.rs:259-262) which only transmutes lifetime without actually leaking memory, causing the spawnedtcp_accepttask to hold a&'static Serverpointing to caller stack memory.client_write_request(port: u16, request: &[u8])— sends raw HTTP/1.1 bytes viatokio::net::TcpStream.Strict rust-standards compliance
core/tests/mod.rs:net::TcpListenermerged into existinguse std::{...}block;io::AsyncWriteExt, net::TcpStreammerged into existinguse tokio::{...}block (same-kind merging per §6.1, nopub useper §14.1).core/tests/server/fn.rs: first lineuse super::*;, no directstd/tokioimports.core/tests/server/mod.rs: zero changes from HEAD.Register,server_config,control_hook, ...).|register: &mut Server|.#[ignore]— root cause fixed locally in test helper per §14.6 anti-pattern.Version bump
Cargo.toml[workspace.package].version:21.3.6→21.3.7.Verification
cargo build -p hyperlane-core --tests --offline: ✅ exit 0cargo clippy -p hyperlane-core --all-targets --offline -- -D warnings: ✅ exit 0cargo fmt -p hyperlane-core --check: ✅ exit 0 (idempotent)cargo test -p hyperlane-core --offline --test mod(3× stable): ✅ 61 passed; 0 failed; 0 ignoredZero production changes (for the test commit)
core/src/server/impl.rs(production, including the unsoundleak()): NOT modified#[ignore]markers, zero single-letter namesMigration notes
This is a workspace migration only — no API surface changes for any sub-crate. Downstream users of
hyperlane,hyperlane-cli,hyperlane-macros,http-typeshould continue to depend on them as crates.io packages; the workspace path deps are internal-only.The previously-published
http-type = "20.1.9"andlombok-macros = "2.0.36"are inherited from[workspace.dependencies]; this PR does not bump them further.