Skip to content

feat: add protocol feature flags for conditional compilation#2845

Open
seokjin0414 wants to merge 5 commits intoapache:masterfrom
seokjin0414:88-add-protocol-feature-flags
Open

feat: add protocol feature flags for conditional compilation#2845
seokjin0414 wants to merge 5 commits intoapache:masterfrom
seokjin0414:88-add-protocol-feature-flags

Conversation

@seokjin0414
Copy link
Contributor

Closes #88

Summary

  • Add tcp, quic, http, websocket feature flags to server, SDK, iggy_common, and configs crates
  • Guard protocol modules, SenderKind/ClientWrapper enum variants, and match arms with #[cfg(feature)]
  • Make protocol-specific dependencies optional (axum, quinn, reqwest, tokio-tungstenite, etc.)
  • Extract shared TLS verifier to tls/ module for tcp/websocket independence
  • Add compile_error! guards for zero-protocol builds

Design

  • TransportProtocol enum, IggyError variants, ServerConfig fields: NOT gated — wire protocol and config stability
  • SenderKind (iggy_common): Variants gated per protocol (tcp, quic, websocket). HTTP uses axum, not SenderKind
  • ClientWrapper (SDK): Variants gated per protocol. Dispatch match arms in 13 binary_*.rs files gated accordingly
  • Default features: All protocols enabled — existing behavior unchanged
  • compio dep: Kept as-is (workspace dep with all features). Code-level gating only; compio feature split deferred to follow-up

Verified

  • All 18 feature combinations compile (single-protocol, multi-protocol, zero-protocol error)
  • cargo clippy --all-features -D warnings clean
  • cargo fmt clean
  • Single-protocol builds produce 0 warnings

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 70.10309% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.51%. Comparing base (2eefbc3) to head (97dc578).

Files with missing lines Patch % Lines
core/sdk/src/client_provider.rs 25.00% 18 Missing ⚠️
core/sdk/src/tls/no_server_verification.rs 79.48% 8 Missing ⚠️
core/sdk/src/clients/client.rs 0.00% 1 Missing ⚠️
core/sdk/src/clients/client_builder.rs 0.00% 1 Missing ⚠️
core/server/src/shard/handlers.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2845      +/-   ##
============================================
- Coverage     67.53%   67.51%   -0.02%     
  Complexity      739      739              
============================================
  Files          1048     1048              
  Lines         84103    84145      +42     
  Branches      60704    60757      +53     
============================================
+ Hits          56795    56808      +13     
- Misses        24950    24966      +16     
- Partials       2358     2371      +13     
Flag Coverage Δ
csharp 67.06% <ø> (-0.19%) ⬇️
go 6.33% <ø> (ø)
java 54.83% <ø> (ø)
node 92.26% <ø> (-0.07%) ⬇️
python 0.00% <ø> (ø)
rust 69.70% <70.10%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
core/common/src/sender/mod.rs 90.47% <ø> (ø)
...ration/websocket_config/websocket_client_config.rs 61.44% <100.00%> (ø)
core/configs/src/server_config/websocket.rs 14.70% <ø> (ø)
core/sdk/src/client_wrappers/binary_client.rs 100.00% <ø> (ø)
...e/sdk/src/client_wrappers/binary_cluster_client.rs 100.00% <ø> (ø)
...rc/client_wrappers/binary_consumer_group_client.rs 85.71% <ø> (ø)
...c/client_wrappers/binary_consumer_offset_client.rs 100.00% <ø> (ø)
...e/sdk/src/client_wrappers/binary_message_client.rs 100.00% <ø> (ø)
...sdk/src/client_wrappers/binary_partition_client.rs 100.00% <ø> (ø)
...nt_wrappers/binary_personal_access_token_client.rs 100.00% <ø> (ø)
... and 22 more

... and 17 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add tcp, quic, websocket feature flags to iggy_common crate.
Guard SenderKind variants, constructors, and dispatch macro
with #[cfg(feature)] attributes. Make tungstenite optional,
gated behind websocket feature.

Signed-off-by: shin <sars21@hanmail.net>
Signed-off-by: shin <sars21@hanmail.net>
Add tcp, quic, http, websocket feature flags to server crate.
Guard protocol modules, shard fields, task spawning, and
handler imports with #[cfg(feature)] attributes. Make axum,
tower-http, jsonwebtoken optional behind http feature.

Signed-off-by: shin <sars21@hanmail.net>
Add tcp, quic, http, websocket feature flags to SDK crate.
Guard client modules, ClientWrapper variants, builder structs,
and match arms with #[cfg(feature)] attributes. Extract shared
TLS verifier to new tls module for TCP/WebSocket independence.
Make transport-specific dependencies optional.

Signed-off-by: shin <sars21@hanmail.net>
@seokjin0414 seokjin0414 force-pushed the 88-add-protocol-feature-flags branch from f7f8e35 to 940a089 Compare March 2, 2026 17:47
Signed-off-by: shin <sars21@hanmail.net>
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.

Add feature flag for conditional compilation of protocols (TCP, QUIC, HTTP)

2 participants