Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

950 implement function returing just the list of subjects #960

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jlrobins
Copy link
Contributor

@jlrobins jlrobins commented Jan 24, 2025

Summary of Changes

  • First stem in weaning off of the not-WarpStream-supported SchemaRegistry route GET /schemas listing all schemas and metadata.:
    • New ResourceLoader family method, getSubjects(registryOrEnvironmentId, forceDeepFetch) which drives the GET /subjects "list subjects" route to only get the subject names from a schema registry, a route implemented by WarpStream. Implemented in base ResourceLoader w/o any caching. Future branch will implement caching layer in CCloudResourceLoader.
    • Migrate the redundant spellings of LocalResourceLoader.getTopicsForCluster() and DirectResourceLoader.getTopicsForCluster() into single concrete implementation within ResourceLoader, which previously only had the abstract prototype.
    • Simplify CCloudResourceLoader.getTopicsForCluster() to downcall into ResourceLoader.getTopicsForCluster() for the actual deep fetching + topic+subject correlating functionality. The CCloudResourceLoader implementation is freed to focus more specifically on the cache lookup and return or deep fetch + cache set concerns.
    • Migrate correlateTopicsWithSchemaSubjects() and its now single caller ResourceLoader.getTopicsForCluster() to operate in terms of the schema subject strings as from getSubjects() instead of against whole Schema objects.

Any additional details or context that should be provided?

  • The list of subjects within a registry is currently only being used when correlating with kafka cluster topic names withing ResourceLoader.getTopicsForCluster() . The CCloudResourceLoader implementation of that method then ends up caching the resulting list of KafkaTopic models, so we're about as efficient as before.
  • Expands the use of EnvironmentId type. Proved useful in making getSubjects() be able to internally handle if passed either an environment ID or a whole SchemaRegistry to operate against.
  • Promoted createTestTopicData() function from single test suite to reusable utility module, per its desire to be reusable when needed. Now used when testing correlateTopicsWithSchemaSubjects() and ResourceLoader.getTopicsForCluster() (new test coming up Monday morning).
  • Closes Implement function returing just the list of subjects #950

Pull request checklist

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

Tests
  • Added new
  • 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?
    gulp clicktest

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.

Implement function returing just the list of subjects
1 participant