feat(cli): support vsr and enable the CLI suite under server-ng#3679
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3679 +/- ##
=============================================
- Coverage 73.98% 54.95% -19.03%
Complexity 937 937
=============================================
Files 1301 1299 -2
Lines 147354 130340 -17014
Branches 122911 105973 -16938
=============================================
- Hits 109013 71623 -37390
- Misses 34868 55344 +20476
+ Partials 3473 3373 -100
🚀 New features to boost your workflow:
|
5c45136 to
04784dc
Compare
The CLI integration suite was gated off under the vsr feature, so the `iggy` CLI was never exercised against server-ng. Enabling it surfaced real gaps that this change fixes. Un-gate the suite and add a `vsr` feature to iggy-cli; the server-ng Docker image now builds with `--features vsr`. Creating a topic (or partitions) with a zero partition count aborted shard-0 on server-ng: the allocator's `.expect()` on the highest consensus-group id panicked when no partitions were assigned, taking the whole process down with SIGABRT. This was client-triggerable. Skip the observe call when the assignment set is empty. The stats response hardcoded free/total disk space to 0. Resolve both from the server's data path via fs2. Harden the harness port reserver against a cross-process race. `RESERVED_PORTS` dedups only within a process, but nextest runs each test in its own process; concurrent 3-node startups raced for the same ephemeral port at the release->bind window and failed with CannotBindToSocket. Claim each port with an exclusive advisory file lock held for the process lifetime, making the claim visible across processes; the OS drops it on exit so a crash never leaks a port. Recover an expired CLI login session instead of wedging. On server-ng an expired login-session PAT returns InvalidToken (no expiry oracle) and, on TCP/QUIC, an opaque empty reply, so the stored session was never cleared and `iggy login` refused with "already logged in" until a manual logout. `iggy login` now prefers explicitly supplied credentials (other commands keep reusing the cached token) and validates the session against the server's PAT list, recreating it when dead; the credential delete-set is left untouched so a transient failure never drops a valid session. A few CLI cases are mode-split where server-ng diverges from legacy by design: flush returns FeatureUnavailable, the session-timeout message differs, and purge is eventually consistent so server state is polled.
04784dc to
1af1b2b
Compare
mmodzelewski
approved these changes
Jul 16, 2026
spetz
approved these changes
Jul 16, 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.
The CLI integration suite was gated off under the vsr feature, so
the
iggyCLI was never exercised against server-ng. Enabling itsurfaced real gaps that this change fixes.
Un-gate the suite and add a
vsrfeature to iggy-cli; theserver-ng Docker image now builds with
--features vsr.Creating a topic (or partitions) with a zero partition count
aborted shard-0 on server-ng: the allocator's
.expect()on thehighest consensus-group id panicked when no partitions were
assigned, taking the whole process down with SIGABRT. This was
client-triggerable. Skip the observe call when the assignment set
is empty.
The stats response hardcoded free/total disk space to 0. Resolve
both from the server's data path via fs2.
Harden the harness port reserver against a cross-process race.
RESERVED_PORTSdedups only within a process, but nextest runseach test in its own process; concurrent 3-node startups raced for
the same ephemeral port at the release->bind window and failed with
CannotBindToSocket. Claim each port with an exclusive advisory file
lock held for the process lifetime, making the claim visible across
processes; the OS drops it on exit so a crash never leaks a port.
Recover an expired CLI login session instead of wedging. On
server-ng an expired login-session PAT returns InvalidToken (no
expiry oracle) and, on TCP/QUIC, an opaque empty reply, so the
stored session was never cleared and
iggy loginrefused with"already logged in" until a manual logout.
iggy loginnow prefersexplicitly supplied credentials (other commands keep reusing the
cached token) and validates the session against the server's PAT
list, recreating it when dead; the credential delete-set is left
untouched so a transient failure never drops a valid session.
A few CLI cases are mode-split where server-ng diverges from legacy
by design: flush returns FeatureUnavailable, the session-timeout
message differs, and purge is eventually consistent so server state
is polled.