feat(python): expose get_me, get_client and get_clients #4065
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 461 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.367
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #4065"
general
weight: 0.35
yummyPancake2607
The Rust SDK's SystemClient trait can report the currently connected client and enumerate all connected clients, but the Python SDK exposed none of it, leaving operators unable to see connection state that every other SDK already surfaces.
Adds ClientInfo/ClientInfoDetails/ConsumerGroupInfo bindings following the user.rs pattern, wires get_me/get_client/get_clients onto IggyClient, and re-exports ClientInfo/ConsumerGroupInfo from the SDK prelude since only ClientInfoDetails was public before.
Which issue does this PR address?
Closes #4015
Rationale
Every other Apache Iggy SDK exposes
get_me/get_client/get_clientsfromSystemClient, so a Python operator has no way to see which client they're connected as or what else is connected to the server — parity gap tracked under #3893, this issue's specific ask.What changed?
foreign/python/src/client_info.rsgained real bindings forClientInfo,ClientInfoDetails, andConsumerGroupInfo—inner-wrapped structs withFrom<Rust*>conversions and#[gen_stub_pymethods]getters, mirroringuser.rsrather than the bare-struct copy that was there before.address/transportreturn&strinstead of cloning, andconsumer_groupsdocuments that each read allocates a fresh list.IggyClientinclient.rsgainedget_me,get_client,get_clients, placed right afterping(get_me needs authentication only; get_client/get_clients needread_serversormanage_serversand raiseUnauthorizedwithout it — both stated explicitly in the docstrings since the wire error is generic).core/sdk/src/prelude.rsnow re-exportsClientInfoandConsumerGroupInfoalongside the already-exportedClientInfoDetails— needed forget_clients()'s return type to be nameable from the Python crate without pulling iniggy_commondirectly (which would have re-introduced a version pinbump-version.shdoesn't touch).tests/test_client_info.pycovers:get_meagainst the fixture's TCP transport and logged-in user id,get_mereporting a joined consumer group (with a helper that forces stream/topic/group ids to be pairwise distinct, since a fresh stream would otherwise hand its first topic and group the same id and let a swapped field mapping pass silently — verified by manually swappingstream_id/topic_idand confirming the test fails),get_clientscontaining the caller's own entry,get_clientmatchingget_meand returningNonefor an unknown id, and theread_serverspermission gate (granted and denied cases).Local Execution
prek:cargo fmt --all --check,cargo clippy --all-targets -- -D warnings(Python crate, plus-p iggyfor the prelude change),ruff check/ruff format --check/pyrefly check ., andcargo run --bin stub_gento confirmapache_iggy.pyihas no drift. Fullpytest tests/(excluding the Docker-onlytest_tls.py) passed against a realiggy-serverinstance: 510 passed.AI Usage
1. Claude Code (Claude Opus).
2. Full implementation: the binding module, the three client methods, the prelude re-export, and the test file were AI-generated, following the existing
user.rs/get_user/get_userspatterns in this crate.3. Verified by running the code, not just reading it: built and ran a real
iggy-server, exercised every new method and the permission gate against it, and for the stream/topic/group id-collision risk specifically, mutated the field mapping (swappedstream_id/topic_id) and confirmed the test suite catches it before reverting.4. Yes.