Skip to content

set up ResourceContainer for Flink database and Kafka cluster child resources#3292

Merged
Dave Shoup (shouples) merged 15 commits intomainfrom
djs/resource-container-refactor
Mar 10, 2026
Merged

set up ResourceContainer for Flink database and Kafka cluster child resources#3292
Dave Shoup (shouples) merged 15 commits intomainfrom
djs/resource-container-refactor

Conversation

@shouples
Copy link
Contributor

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

Summary of Changes

This PR takes most of the state management that FlinkDatabaseResourceContainer handled to extend into a ResourceContainer abstract base class, allowing a Kafka cluster flavored version that will be used in a downstream branch for "Consumer Group" and "Topics" containers.

Closes #3230

Associated PRs

Optional: Any additional details or context that should be provided?

While this seems like backpedaling from removing the ContainerTreeItem, the new abstract class helps with icon and context value transitions instead of effectively being a TreeItem with a searchable children array.

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?

@airlock-confluentinc airlock-confluentinc bot force-pushed the djs/consumer-group-models branch from d5c9efc to 9b4450d Compare February 24, 2026 16:15
@airlock-confluentinc airlock-confluentinc bot force-pushed the djs/resource-container-refactor branch from 4384847 to 2d0df9f Compare February 24, 2026 22:01
@shouples Dave Shoup (shouples) linked an issue Feb 26, 2026 that may be closed by this pull request
@airlock-confluentinc airlock-confluentinc bot force-pushed the djs/resource-container-refactor branch from 2d0df9f to 2daefec Compare February 26, 2026 16:49
Base automatically changed from djs/consumer-group-models to main February 26, 2026 18:29
Copilot AI review requested due to automatic review settings February 27, 2026 14:42
@airlock-confluentinc airlock-confluentinc bot force-pushed the djs/resource-container-refactor branch from 2daefec to 6b8d9b8 Compare February 27, 2026 14:42
@shouples Dave Shoup (shouples) review requested due to automatic review settings February 27, 2026 14:42
@airlock-confluentinc airlock-confluentinc bot force-pushed the djs/resource-container-refactor branch from 6b8d9b8 to ec16f3d Compare February 27, 2026 14:48
Copilot AI review requested due to automatic review settings February 27, 2026 15:25
@shouples Dave Shoup (shouples) review requested due to automatic review settings February 27, 2026 15:25
Copilot AI review requested due to automatic review settings February 27, 2026 22:37
@shouples Dave Shoup (shouples) review requested due to automatic review settings February 27, 2026 22:37
@sonarqube-confluent
Copy link

@shouples Dave Shoup (shouples) marked this pull request as ready for review February 27, 2026 23:25
@shouples Dave Shoup (shouples) requested a review from a team as a code owner February 27, 2026 23:25
Copilot AI review requested due to automatic review settings February 27, 2026 23:25
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

Refactors Flink Database container tree-item state management into a reusable ResourceContainer abstract base class, and introduces a Kafka-cluster-oriented container type to support upcoming Topics/Consumer Groups view work.

Changes:

  • Added ResourceContainer base class to unify loading/error/children state transitions across container TreeItems.
  • Migrated Flink Database containers to src/models/containers/ and updated the Flink Database view provider + tests to use setLoading() / setLoaded() / setError().
  • Introduced KafkaClusterResourceContainer (and label enum) plus unit tests, and updated unit-test helpers to support simpler resource creation.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unit/testResources/base.ts Makes name optional in test resource helpers and improves fallback searchable text.
src/viewProviders/flinkDatabase.ts Uses new container state transition methods instead of mutating fields directly.
src/viewProviders/flinkDatabase.test.ts Updates tests to use setLoaded() rather than assigning children directly.
src/models/flinkDatabaseResourceContainer.ts Removes the previous Flink-specific container implementation (moved/refactored under containers/).
src/models/flinkDatabaseResourceContainer.test.ts Removes old Flink container tests (replaced by new container tests).
src/models/containers/resourceContainer.ts Adds the new shared container base class encapsulating loading/error/children behavior.
src/models/containers/resourceContainer.test.ts Adds comprehensive unit tests for ResourceContainer state transitions and helper methods.
src/models/containers/kafkaClusterResourceContainer.ts Adds Kafka-cluster flavored container subclass and label enum for Topics view containers.
src/models/containers/kafkaClusterResourceContainer.test.ts Adds unit tests validating constructor/id/loggerName behavior for Kafka cluster containers.
src/models/containers/flinkDatabaseResourceContainer.ts Reintroduces Flink DB container as a thin subclass of ResourceContainer.
src/models/containers/flinkDatabaseResourceContainer.test.ts Adds focused constructor tests for the Flink DB container subclass.
src/commands/utils/udfRegistration.test.ts Updates imports to new Flink container location and tightens a Kafka cluster type import.
src/commands/flinkDatabaseView.ts Updates imports to the new Flink container module path.
src/commands/flinkDatabaseView.test.ts Updates imports to the new Flink container module path.
src/commands/flinkArtifacts.test.ts Updates imports to the new Flink container module path.

Copy link
Contributor

@jlrobins James Robinson (jlrobins) left a comment

Choose a reason for hiding this comment

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

Looks like a good step towards being able to simplify complex views like FlinkDatabaseViewProvider into managing a list of per-element-type containers that then know the per-element-type smarts.

@shouples Dave Shoup (shouples) merged commit 2b07b09 into main Mar 10, 2026
18 checks passed
@shouples Dave Shoup (shouples) deleted the djs/resource-container-refactor branch March 10, 2026 20:34
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 consumer group container tree item model

3 participants