Skip to content

fix(cli): use correct consumer kind wording in consumer-offset set - #4620

Open
SunilKumarPradhan wants to merge 5 commits into
apache:masterfrom
SunilKumarPradhan:fix/4459-cli-consumer-offset-set-always-says
Open

SunilKumarPradhan wants to merge 5 commits into
apache:masterfrom
SunilKumarPradhan:fix/4459-cli-consumer-offset-set-always-says

Conversation

@SunilKumarPradhan

@SunilKumarPradhan SunilKumarPradhan commented Oct 22, 2026 •

Copy link
Copy Markdown

Which issue does this PR address?

Closes #4459

Rationale

consumer-offset set named every consumer kind "consumer" in its output, even for -k consumer-group and -k external-group, which is misleading when scripting or reading logs.

What changed?

explain(), the error context, and the success message in set_consumer_offset.rs always said "consumer" regardless of ConsumerKind. Added a consumer_info() helper (shared with get_consumer_offset.rs, which had the same wording) in binary_consumer_offsets/mod.rs that picks the right wording per kind, and used it in all three places.

Local Execution

  • Passed (cargo fmt --check -p iggy-cli, cargo clippy -p iggy-cli --all-targets -- -D warnings, cargo test -p iggy-cli)

AI Usage

I used github copilot.

explain(), the error context and the success message in
set_consumer_offset.rs always said "consumer", even for
-k consumer-group or -k external-group. Add get_consumer_info(),
mirroring get_consumer_offset.rs, and use it in all three places.

Add unit tests for the explain message of each consumer kind and
assert the wording in the external-group CLI integration test.

Closes apache#4459
@github-actions

Copy link
Copy Markdown

Note for maintainers: @SunilKumarPradhan also has #4490 open. New contributors are asked to keep one open PR at a time. See CONTRIBUTING.md.

@github-actions

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer
  • /pin - exempt the PR from the stale bot, /unpin to undo

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Oct 22, 2026
@mmmmxa

mmmmxa commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Hi @SunilKumarPradhan, please rewrite your initial message to follow the PR template (see PULL_REQUEST_TEMPLATE.md).

@hubcio

hubcio commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

/skill team-review-slim

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.64516% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.33%. Comparing base (d47ff5d) to head (e347c1c).

Files with missing lines Patch % Lines
...nds/binary_consumer_offsets/set_consumer_offset.rs 79.16% 5 Missing ⚠️
...re/cli/src/commands/binary_consumer_offsets/mod.rs 83.33% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (d47ff5d) and HEAD (e347c1c). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (d47ff5d) HEAD (e347c1c)
rust 3 2
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #4620       +/-   ##
=============================================
- Coverage     80.83%   71.33%    -9.50%     
  Complexity     3107     3107               
=============================================
  Files          1467     1402       -65     
  Lines        356533   196286   -160247     
  Branches     300421   140510   -159911     
=============================================
- Hits         288194   140027   -148167     
+ Misses        61617    49897    -11720     
+ Partials       6722     6362      -360     
Components Coverage Δ
Rust Core 65.46% <80.64%> (-14.66%) ⬇️
Java SDK 78.15% <ø> (ø)
C# SDK 83.70% <ø> (+0.09%) ⬆️
Python SDK 85.67% <ø> (ø)
PHP SDK 90.67% <ø> (ø)
Node SDK 96.44% <ø> (ø)
Go SDK 69.84% <ø> (+0.71%) ⬆️
C++ SDK 85.51% <ø> (ø)
Files with missing lines Coverage Δ
...nds/binary_consumer_offsets/get_consumer_offset.rs 86.66% <100.00%> (+1.81%) ⬆️
...re/cli/src/commands/binary_consumer_offsets/mod.rs 83.33% <83.33%> (ø)
...nds/binary_consumer_offsets/set_consumer_offset.rs 84.31% <79.16%> (-4.58%) ⬇️

... and 679 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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary: The diff fixes the set consumer-offset messages to name the consumer kind and adds unit and integration coverage for all three kinds. The only finding is a new wording helper that duplicates the existing get-command helper.

Counts: critical 0, warning 0, nit 0, simplification 1


This review was generated by Claude Code 2.1.284 on deepseek-flash[1m]. Review the output before you act on it.

}
}

pub fn get_consumer_info(&self) -> String {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplification: SetConsumerOffsetCmd::get_consumer_info copies the three-arm match in GetConsumerOffsetCmd::get_consumer_info (core/cli/src/commands/binary_consumer_offsets/get_consumer_offset.rs:52) word for word. Move one pub(crate) fn consumer_info(consumer: &Consumer) into binary_consumer_offsets/mod.rs and call it from both commands.

GetConsumerOffsetCmd and SetConsumerOffsetCmd each had their own
get_consumer_info() with an identical three-arm match on ConsumerKind.
Move the match into a consumer_info() helper in
binary_consumer_offsets/mod.rs and have both commands call it.

Addresses review feedback on apache#4620.
@SunilKumarPradhan

Copy link
Copy Markdown
Author

fixed the PR message .

/ready

@SunilKumarPradhan SunilKumarPradhan changed the title fix(cli): use correct consumer kind wording in consumer-offset set refactor(cli): share consumer-kind wording between get/set commands Oct 26, 2026
@hubcio hubcio changed the title refactor(cli): share consumer-kind wording between get/set commands refactor: share consumer-kind wording between get/set commands in iggy-cli Oct 27, 2026
@SunilKumarPradhan SunilKumarPradhan changed the title refactor: share consumer-kind wording between get/set commands in iggy-cli fix(cli): use correct consumer kind wording in consumer-offset set Oct 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: consumer-offset set always says consumer for group kinds

5 participants