-
Notifications
You must be signed in to change notification settings - Fork 6
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
Use new subject / schema loader methods / routes when populating the topic and schema views #1052
Draft
jlrobins
wants to merge
19
commits into
main
Choose a base branch
from
952-wire-up-schema-view-controller-new-schema-routes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Use new subject / schema loader methods / routes when populating the topic and schema views #1052
jlrobins
wants to merge
19
commits into
main
from
952-wire-up-schema-view-controller-new-schema-routes
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ew-controller-new-schema-routes
…ew-controller-new-schema-routes
…ew-controller-new-schema-routes
…ent view controllers.
…ew-controller-new-schema-routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 17 changed files in this pull request and generated 1 comment.
Files not reviewed (12)
- src/models/schema.test.ts: Evaluated as low risk
- src/loaders/resourceLoader.test.ts: Evaluated as low risk
- src/quickpicks/schemas.ts: Evaluated as low risk
- src/commands/schemas.ts: Evaluated as low risk
- src/commands/schemaUpload.ts: Evaluated as low risk
- src/viewProviders/schemas.test.ts: Evaluated as low risk
- src/loaders/loaderUtils.test.ts: Evaluated as low risk
- tests/unit/testUtils.ts: Evaluated as low risk
- src/loaders/resourceLoader.ts: Evaluated as low risk
- src/loaders/loaderUtils.ts: Evaluated as low risk
- tests/unit/testResources/schema.ts: Evaluated as low risk
- src/viewProviders/topics.ts: Evaluated as low risk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of Changes
ResourceLoader.getSubjects()
and.getSchemaSubjectGroup()
instead ofResourceLoader.getSchemas()
.Subject
representing a subject loaded from a particular schema registry. AdjustResourceLoader.getSubjects()
to return array of those instead of bare strings, because of need to know the source registry's particulars when invoking actions like 'evolve schema', 'view latest schema,' etc from the views.Schemas View
ResourceLoader..getSchemaSubjectGroup()
returning aSchema[]
.Topics View
KafkaTopic
. They are built with knowledge of the subjects within the schema registry, and will be expandable if one or more subject correlates by name.ContainerTreeItem<Schema>
as before, populated through getting all of the subjects, then filtering by the topic, then fetching the schema group for the remaining subjects. Because this process requires preemptively fetching all of the schemas for these single-topic-matching-subjects (usually only one or two subjects), we can paint the subjects also with knowledge of the schema type and count of versions.Commands
ContainerTreeItem<Schema>
(from topics view) or aSubject
, so new type union for the argument type for those commands is needed,Subjectish
, representing something from which (subject string, schema registry id, connection id, environment id) can be extracted. New utility functionsdetermineSubject
anddetermineLatestSchema
insrc/commands.schemaUtils.ts
are used to navigate from theSchemaish
argument to the underlying desired object.Any additional details or context that should be provided?
SchemaSubject
model and stop usingContainerTreeItem<Schema>
#1021, although I still useContainerTreeItem<Schema>
within the topics view hierarchy. New class issrc/models/schemas.ts
'sSubject
, and can be obtained from aSchema
instance via methodsubjectObject()
.Pull request checklist
Please check if your PR fulfills the following (if applicable):
Tests
Other
.vsix
file?From Copilot's perspective:
This pull request introduces significant changes to the schema handling functionality, including refactoring functions to use a new
SubjectishArgument
type, adding utility functions to determine schema subjects, and updating tests to reflect these changes.Key changes include:
Refactoring and Utility Functions:
src/commands/schemaUpload.ts
: RefactoreduploadSchemaForSubjectFromfile
anduploadSchemaFromFile
functions to useSubjectishArgument
and introduceddetermineSubject
for subject extraction. [1] [2] [3] [4] [5]src/commands/schemaUtils.ts
: Added new utility functionsdetermineSubject
anddetermineLatestSchema
to handle different types of subject arguments.Testing:
src/commands/schemaUtils.test.ts
: Added tests for the new utility functionsdetermineSubject
anddetermineLatestSchema
.src/loaders/loaderUtils.test.ts
: Updated tests to validate the correct order of fetched schema versions and subject strings. [1] [2]Schema Handling:
src/loaders/loaderUtils.ts
: Modified thefetchSubjects
function to returnSubject
objects instead of strings and updatedfetchSchemaSubjectGroup
to return schemas sorted by version. [1] [2] [3]src/loaders/resourceLoader.ts
: UpdatedgetTopicsForCluster
andgetSubjects
to handleSubject
objects. [1] [2] [3] [4]Command Updates:
src/commands/schemas.ts
: Updated commands to use the newdetermineLatestSchema
utility function for handling schema subjects. [1] [2] [3]These changes collectively improve the flexibility and robustness of schema handling by introducing a more versatile argument type and ensuring consistency across related functions and tests.