Migrating Schema Registry from AutoRest to Typespec#49275
Open
conniey wants to merge 29 commits into
Open
Conversation
c422716 to
cfaca22
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates azure-data-schemaregistry from AutoRest-generated implementation code to TypeSpec-generated code and updates Schema Registry test infrastructure to use Azure AD authentication instead of local auth.
Changes:
- Replaces AutoRest swagger/config and generated implementation classes with TypeSpec generation metadata,
tsp-location.yaml, andSchemaRegistryClientImpl. - Updates public/internal Schema Registry clients, builder, service version enum, and helper header parsing to use the new generated implementation.
- Updates tests, recordings assets, and Event Hubs test resources for token-credential-based authentication.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
sdk/schemaregistry/test-resources.json |
Disables local auth and removes SAS authorization output. |
sdk/schemaregistry/azure-data-schemaregistry/tsp-location.yaml |
Adds TypeSpec source location. |
sdk/schemaregistry/azure-data-schemaregistry/swagger/README.md |
Removes AutoRest generation config. |
sdk/schemaregistry/azure-data-schemaregistry/src/test/java/com/azure/data/schemaregistry/SchemaRegistryAsyncClientTests.java |
Updates async tests for new service version/logging. |
sdk/schemaregistry/azure-data-schemaregistry/src/test/java/com/azure/data/schemaregistry/SchemaRegistryAsyncClientPlaybackTests.java |
Renames service version enum usage. |
sdk/schemaregistry/azure-data-schemaregistry/src/test/java/com/azure/data/schemaregistry/generated/SchemaRegistryClientTestBase.java |
Adds generated test base. |
sdk/schemaregistry/azure-data-schemaregistry/src/samples/java/com/azure/data/schemaregistry/SchemaRegistryClientJavaDocCodeSnippets.java |
Updates logging sample. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/resources/META-INF/azure-data-schemaregistry_metadata.json |
Adds TypeSpec metadata. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/module-info.java |
Marks module as TypeSpec-generated. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/SchemaRegistryVersion.java |
Removes old service version enum. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/SchemaRegistryServiceVersion.java |
Adds new service version enum. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/SchemaRegistryClientBuilder.java |
Reworks builder for TypeSpec impl. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/SchemaRegistryClient.java |
Updates sync client to new impl. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/SchemaRegistryAsyncClient.java |
Updates async client to new impl. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/package-info.java |
Formatting/doc cleanup. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/SchemasImpl.java |
Removes AutoRest schemas implementation. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/SchemaRegistryHelper.java |
Consolidates header parsing. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/SchemaRegistryClientImpl.java |
Adds TypeSpec generated REST implementation. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/SchemaGroupsOperationsImpl.java |
Removes AutoRest schema groups implementation. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/package-info.java |
Minor formatting cleanup. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/models/SchemasRegisterHeaders.java |
Removes old header model. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/models/SchemasQueryIdByContentHeaders.java |
Removes old header model. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/models/SchemasGetSchemaVersionHeaders.java |
Removes old header model. |
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/implementation/AzureSchemaRegistryImpl.java |
Removes old AutoRest root implementation. |
sdk/schemaregistry/azure-data-schemaregistry/assets.json |
Updates Schema Registry recording assets tag. |
sdk/schemaregistry/azure-data-schemaregistry-apacheavro/src/test/java/com/azure/data/schemaregistry/apacheavro/SchemaRegistryApacheAvroSerializerIntegrationTest.java |
Switches Event Hubs integration test to token credential auth. |
sdk/schemaregistry/azure-data-schemaregistry-apacheavro/assets.json |
Updates apacheavro recording assets tag. |
Comments suppressed due to low confidence (1)
sdk/schemaregistry/azure-data-schemaregistry/src/main/java/com/azure/data/schemaregistry/SchemaRegistryClient.java:59
- This accessor now calls itself recursively, so any caller of
getFullyQualifiedNamespace()will hit aStackOverflowError. It should delegate to the generated service client, matching the async client implementation.
* .buildClient();
| /** | ||
| * Service version of SchemaRegistryClient. | ||
| */ | ||
| public enum SchemaRegistryServiceVersion implements ServiceVersion { |
| .withContext(context -> service.listSchemaGroups(this.getFullyQualifiedNamespace(), | ||
| this.getServiceVersion().getVersion(), accept, requestOptions, context)) | ||
| .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), | ||
| getValues(res.getValue(), "Value"), getNextLink(res.getValue(), "NextLink"), null)); |
| .withContext(context -> service.listSchemaVersions(this.getFullyQualifiedNamespace(), | ||
| this.getServiceVersion().getVersion(), groupName, schemaName, accept, requestOptions, context)) | ||
| .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), | ||
| getValues(res.getValue(), "Value"), getNextLink(res.getValue(), "NextLink"), null)); |
Comment on lines
184
to
185
| URL url = (new URI(fullyQualifiedNamespace)).toURL(); | ||
| this.fullyQualifiedNamespace = url.getHost(); |
| try { | ||
| final URL url = new URI(fullyQualifiedNamespace).toURL(); | ||
| fullyQualifedNamespaceToUse = url.getHost(); | ||
| } catch (MalformedURLException | URISyntaxException e) { |
This file contains hidden or 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
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.
Description
test-resources.jsonto not use local auth to adhere to policy.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines