New src/models/interfaces.ts module to hold common interfaces, starting with EnvironmentResource, anything that can have an environmentId derived from it.
Fixes
getLatestSchemasForTopic() (implementation behind "diff latest schema versions") implemented atop ResourceLoader APIs instead of ResourceManager, and accordingly fixed to work against local schema registry / schemas (would runtime complain if tried against an evolved local schema).
Improvements
kafkaClusterQuickPick() reimplemented atop ResourceLoader APIs instead of ResourceManager and / or the raw GraphQL functions, and adjusted to honor existing cached (ccloud) information for clusters and topics, if any.
topicQuickPick() now accepts a forceRefresh boolean, defaulting to false, allowing it to be faster by default. Both this and the kafkaClusterQuickPick() change work together to let "Confluent: Topics: Browse Messages" command's quickpick flow to work much faster and to honor existing cached CCLoud data.
Changes
Models Environment (incl. CCloudEnvironment, LocalEnvironment), KafkaCluster (incl. CCloudKafkaCluster, LocalKafkaCluster), SchemaRegistry (incl. LocalSchemaRegistry, CCloudSchemaRegistry), and finally KafkaTopic and Schema.
Err on undefined as opposed to null in a few places. Alas, typescript.
Reimpliment loadCCloudResources() within src/viewProviders/resources.ts using only CCLoudResourceLoader APIs as opposed to mix of ResourceLoader and ResourceManager, stopping trying to call ensureCoarseResourcesLoaded().
ResourceLoader family:
Implement public abstract getEnvironments() (pretty sure there was a ticket for something like this)
Implement getKafkaClustersForEnvironment(), allowing us to wean some users off of ResourceManager.
Respell getSchemaRegistryForCluster as getSchemaRegistryForEnvironment, accepting any EnvironmentResource.
Respell getSchemasForCluster as getSchemasForEnvironment, accepting any EnvironmentResource.
No longer need getSchemasForTopicEnvironment(), since getKafkaClustersForEnvironment is sufficient.
Mark CCLoudResourceManager.ensureCoarseResourcesLoaded() as private, closes #568
Reorder implementation of the abstract methods from ResourceManager in CCLoudResourceManager and LocalResourceManager ordered per the declaration order in ResourceManager.
Drop unused parameters from various LocalResourceLoader implementation methods. Typescript / javascript perfectly happy with subclass implementations having fewer arguments than abstract base class method declaration.
Tests
In order to keep the test coverage over getLatestSchemasForTopic(), I made the it() generating portion move to a generic function generator that varies over the ResourceLoader class to mock out, the test topic (be it local or ccloud-based), the returned schema registry and schema.
TEST_CCLOUD_KAFKA_TOPIC node defaults to not having a schema, parallel to TEST_LOCAL_KAFKA_TOPIC. Existing assuming tests have been adjusted to not assume as much.
Pull request checklist
Please check if your PR fulfills the following (if applicable):
Tests
[x] Added new
[x] Updated existing
[ ] Deleted existing
Other
[ ] All new disposables (event listeners, views, channels, etc.) collected as for eventual cleanup?
[ ] Does anything in this PR need to be mentioned in the user-facing CHANGELOG or README?
[ ] Have you validated this change locally by packaging and installing the extension .vsix file?
Summary of Changes
Added
src/models/interfaces.ts
module to hold common interfaces, starting withEnvironmentResource
, anything that can have anenvironmentId
derived from it.Fixes
getLatestSchemasForTopic()
(implementation behind "diff latest schema versions") implemented atop ResourceLoader APIs instead of ResourceManager, and accordingly fixed to work against local schema registry / schemas (would runtime complain if tried against an evolved local schema).Improvements
kafkaClusterQuickPick()
reimplemented atopResourceLoader
APIs instead ofResourceManager
and / or the raw GraphQL functions, and adjusted to honor existing cached (ccloud) information for clusters and topics, if any.topicQuickPick()
now accepts aforceRefresh
boolean, defaulting tofalse
, allowing it to be faster by default. Both this and thekafkaClusterQuickPick()
change work together to let "Confluent: Topics: Browse Messages" command's quickpick flow to work much faster and to honor existing cached CCLoud data.Changes
Models
Environment
(incl.CCloudEnvironment
,LocalEnvironment
),KafkaCluster
(incl.CCloudKafkaCluster
,LocalKafkaCluster
),SchemaRegistry
(incl.LocalSchemaRegistry
,CCloudSchemaRegistry
), and finallyKafkaTopic
andSchema
.Start to use
LocalEnvironment
, part of https://github.com/confluentinc/vscode/issues/435Err on
undefined
as opposed tonull
in a few places. Alas, typescript.Reimpliment
loadCCloudResources()
withinsrc/viewProviders/resources.ts
using onlyCCLoudResourceLoader
APIs as opposed to mix ofResourceLoader
andResourceManager
, stopping trying to callensureCoarseResourcesLoaded()
.ResourceLoader
family:public abstract getEnvironments()
(pretty sure there was a ticket for something like this)getKafkaClustersForEnvironment()
, allowing us to wean some users off ofResourceManager
.getSchemaRegistryForCluster
asgetSchemaRegistryForEnvironment
, accepting anyEnvironmentResource
.getSchemasForCluster
asgetSchemasForEnvironment
, accepting anyEnvironmentResource
.getSchemasForTopicEnvironment()
, sincegetKafkaClustersForEnvironment
is sufficient.ResourceManager
inCCLoudResourceManager
andLocalResourceManager
ordered per the declaration order inResourceManager
.LocalResourceLoader
implementation methods. Typescript / javascript perfectly happy with subclass implementations having fewer arguments than abstract base class method declaration.Tests
getLatestSchemasForTopic()
, I made theit()
generating portion move to a generic function generator that varies over the ResourceLoader class to mock out, the test topic (be it local or ccloud-based), the returned schema registry and schema.TEST_CCLOUD_KAFKA_TOPIC
node defaults to not having a schema, parallel toTEST_LOCAL_KAFKA_TOPIC
. Existing assuming tests have been adjusted to not assume as much.Pull request checklist
Please check if your PR fulfills the following (if applicable):
Tests
Other
.vsix
file?