Skip to content

Show unconsumed partitions in consumer groups#2466

Merged
jvorcak merged 2 commits into
masterfrom
UX-407-show-unconsumed-partitions-in-consumer-groups
May 26, 2026
Merged

Show unconsumed partitions in consumer groups#2466
jvorcak merged 2 commits into
masterfrom
UX-407-show-unconsumed-partitions-in-consumer-groups

Conversation

@jvorcak
Copy link
Copy Markdown
Collaborator

@jvorcak jvorcak commented May 25, 2026

Summary

Previously, consumer group details only showed partitions that had a committed offset.
This PR extends the backend and frontend so all partitions are visible — including those
that have never been consumed or whose offset was deleted.

Backend

  • PartitionOffsets.GroupOffset changed from int64 to *int64nil signals no committed offset
  • Partitions without a committed offset are now included in the response (previously skipped with continue)

Frontend

  • GroupPartitionOffset.groupOffset typed as number | null
  • Unconsumed partitions show for Group Offset and Lag columns
  • Edit / Delete buttons on unconsumed partition rows are disabled with tooltip "No committed offset"
  • Topic-level Edit / Delete buttons disabled when all partitions are unconsumed
  • onEditOffsets / onDeleteOffsets at topic level only receive consumed partitions, preventing crashes in downstream modal handlers
  • Lag filter (onlyShowPartitionsWithLag) updated to explicitly include unconsumed partitions rather than relying on null !== 0
  • cannotEditGroupReason / cannotDeleteGroupOffsetsReason accept an optional consumedPartitions array and own the "No committed offsets" check, removing inline ternaries at call sites

Tests

  • Unit test (group-details.test.tsx) covers: edit button enabled/disabled state, rendering for unconsumed partitions
  • E2E test (consumer-group-unconsumed-partitions.spec.ts) covers the full flow: produce messages, consume partially, delete an offset, verify all 3 partitions appear with correct values and button states

@jvorcak jvorcak marked this pull request as draft May 25, 2026 18:20
@jvorcak jvorcak force-pushed the UX-407-show-unconsumed-partitions-in-consumer-groups branch 2 times, most recently from edebc33 to 5a3070c Compare May 25, 2026 18:58
@jvorcak jvorcak force-pushed the UX-407-show-unconsumed-partitions-in-consumer-groups branch from 5a3070c to 9a705e0 Compare May 25, 2026 19:14
@jvorcak jvorcak marked this pull request as ready for review May 25, 2026 19:19
@jvorcak jvorcak requested review from a team and c-julin May 25, 2026 19:19
@r-vasquez r-vasquez requested a review from Copilot May 25, 2026 19:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the consumer group offsets API and the consumer group details UI to surface partitions that have no committed offsets (“unconsumed” partitions), and adds automated coverage to validate the new behavior.

Changes:

  • Backend: return groupOffset: null for partitions without committed offsets and include those partitions in partitionOffsets.
  • Frontend: render “—” for Group Offset / Lag when groupOffset is null, and disable per-partition edit/delete actions with a “No committed offset” tooltip.
  • Tests: add unit + E2E tests to validate rendering and disabled actions for unconsumed partitions.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
frontend/tests/test-variant-console/consumers/consumer-group-unconsumed-partitions.spec.ts Adds Playwright E2E coverage for unconsumed partitions display + disabled actions.
frontend/src/utils/tsx-utils.tsx Extends IconButton to support data-testid for test targeting (enabled and disabled states).
frontend/src/state/rest-interfaces.ts Updates groupOffset type to number | null to represent missing commits.
frontend/src/components/pages/consumers/modals.tsx Avoids copying null offsets from other groups; adapts offset lookup for nullable offsets.
frontend/src/components/pages/consumers/group-details.tsx Marks unconsumed partitions, renders “—”, and disables row actions with tooltips; adjusts filtering behavior.
frontend/src/components/pages/consumers/group-details.test.tsx Adds unit tests ensuring disabled/enabled edit controls and “—” rendering for unconsumed partitions.
backend/pkg/console/consumer_group_offsets.go Makes groupOffset nullable and emits partition rows even when no committed offset exists.
backend/pkg/console/consumer_group_offsets_test.go Updates expectations for groupOffset pointer semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 380 to 381
disabledReason={cannotEditGroupReason(groupProps.group, featurePatchGroup)}
onClick={(e) => {
Comment thread frontend/src/components/pages/consumers/group-details.tsx Outdated

const partitions = groupProps.onlyShowPartitionsWithLag ? g.partitions.filter((e) => e.lag !== 0) : g.partitions;
const partitions = groupProps.onlyShowPartitionsWithLag
? g.partitions.filter((e) => e.lag !== 0 || e.isUnconsumed)
Comment on lines +557 to +561
.filter((p) => p.groupOffset !== null)
.flatMap((p) => ({
topicName: x.topic,
partitionId: p.partitionId,
offset: p.groupOffset as number,
Copy link
Copy Markdown
Contributor

@r-vasquez r-vasquez left a comment

Choose a reason for hiding this comment

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

LGTM, just one non-blocking minor nit. Also, if possible, let's add more context on why to the commit body or PR description please.

Comment thread backend/pkg/console/consumer_group_offsets_test.go Outdated
@jvorcak jvorcak merged commit c21853d into master May 26, 2026
19 checks passed
@jvorcak jvorcak deleted the UX-407-show-unconsumed-partitions-in-consumer-groups branch May 26, 2026 10:39
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.

3 participants