Skip to content

set up consumer group related models#3263

Merged
Dave Shoup (shouples) merged 18 commits intomainfrom
djs/consumer-group-models
Feb 26, 2026
Merged

set up consumer group related models#3263
Dave Shoup (shouples) merged 18 commits intomainfrom
djs/consumer-group-models

Conversation

@shouples
Copy link
Contributor

@shouples Dave Shoup (shouples) commented Feb 7, 2026

Summary of Changes

No functional changes here, just adding the basic ConsumerGroup, Consumer models with *TreeItem siblings for each before the view provider starts using them with the previously-merged data-fetching operations.

⚠️ Glaring gap in this modeling is the lack of topic/partition data associated with consumers -- this will be handled in a separate branch for #3301 that will add an assignments property and integrate that part of the fetching logic.

Closes #3299

Associated PRs

Pull request checklist

Please check if your PR fulfills the following (if applicable):

Tests

  • Added new
  • Updated existing
  • Deleted existing

Release notes

  • Does anything in this PR need to be mentioned in the user-facing CHANGELOG?

@shouples Dave Shoup (shouples) linked an issue Feb 19, 2026 that may be closed by this pull request
@airlock-confluentinc airlock-confluentinc bot force-pushed the djs/consumer-groups-icon branch 2 times, most recently from d1a73d7 to 40bde89 Compare February 19, 2026 21:35
Base automatically changed from djs/consumer-groups-icon to main February 19, 2026 22:02
@airlock-confluentinc airlock-confluentinc bot force-pushed the djs/consumer-group-models branch from 5980862 to f53190d Compare February 19, 2026 22:05
}

/** Error icon to use for Flink Database resource containers items if fetching resources fails. */
export const ERROR_ICON = new ThemeIcon("warning", new ThemeColor("problemsErrorIcon.foreground"));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to src/icons.ts

@airlock-confluentinc airlock-confluentinc bot force-pushed the djs/consumer-group-models branch 4 times, most recently from e88952f to d5c9efc Compare February 24, 2026 15:40
Comment on lines +83 to +86
get canResetOffsets(): boolean {
const resettableStates = [ConsumerGroupState.Empty, ConsumerGroupState.Dead];
return resettableStates.includes(this.state);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not used by anything yet, just prep for upcoming commands

@shouples Dave Shoup (shouples) linked an issue Feb 26, 2026 that may be closed by this pull request
Copilot AI review requested due to automatic review settings February 26, 2026 16:46
@shouples Dave Shoup (shouples) review requested due to automatic review settings February 26, 2026 16:46
@shouples Dave Shoup (shouples) marked this pull request as ready for review February 26, 2026 16:46
@shouples Dave Shoup (shouples) requested a review from a team as a code owner February 26, 2026 16:46
Copilot AI review requested due to automatic review settings February 26, 2026 16:46
Copy link

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 sets up the foundational model classes for Consumer Groups and Consumer members to support the upcoming Consumer Groups view. It introduces ConsumerGroup and Consumer model classes along with their corresponding *TreeItem representations, following the established patterns in the codebase. The PR also refactors the ERROR_ICON constant from flinkDatabaseResourceContainer.ts to icons.ts for better reusability across the codebase.

Changes:

  • Added ConsumerGroup and Consumer models with comprehensive properties including state management, membership tracking, and CCloud URL generation
  • Added ConsumerGroupTreeItem and ConsumerTreeItem classes with state-based icon coloring and detailed tooltips
  • Refactored ERROR_ICON to centralized icons.ts location
  • Added test fixtures and comprehensive unit tests covering all model behaviors

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/models/consumerGroup.ts New model classes for ConsumerGroup and Consumer with TreeItem representations, state management, and URL generation
src/models/consumerGroup.test.ts Comprehensive unit tests for all model behaviors including state transitions, URL generation, and tree item rendering
tests/unit/testResources/consumerGroup.ts Test fixtures providing factory functions and pre-configured test instances for all connection types
src/icons.ts Added ERROR_ICON constant for reuse across models
src/models/flinkDatabaseResourceContainer.ts Updated to import ERROR_ICON from centralized location
src/models/flinkDatabaseResourceContainer.test.ts Updated imports to reference ERROR_ICON from centralized location
src/extension.ts Added comments explaining why consumer groups can't be included in static context value arrays

@sonarqube-confluent
Copy link

Copy link
Contributor

@Cerchie Lucia Cerchie (Cerchie) left a comment

Choose a reason for hiding this comment

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

This LGTM, I did run Claude against it and it had one nit, that these are missing JSDocs:

    `ConsumerGroup.id` getter
    `ConsumerGroup.hasMembers` getter (has inline comment but no JSDoc)
    `ConsumerGroup.searchableText()`
    `ConsumerGroup.ccloudUrl` getter
    `Consumer.id` getter
    `Consumer.searchableText()`
    `Consumer.ccloudUrl` getter

but given how clear the names of these are I'm not going to block on that

@shouples Dave Shoup (shouples) merged commit b3cafa8 into main Feb 26, 2026
14 checks passed
@shouples Dave Shoup (shouples) deleted the djs/consumer-group-models branch February 26, 2026 18:29
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 basic ConsumerGroup and Consumer models

3 participants