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

[Draft] Manual edits in generated code to compiling against v0.4.0 gen output #1959

Draft
wants to merge 1 commit into
base: vincenttran/initial_codegen_tsp_issues
Choose a base branch
from

Conversation

vincenttran-msft
Copy link
Member

As title states. Mostly for illustrative purposes.

Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

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

Wrong directory for your crate, and you shouldn't modify generated code. @jhendrixMSFT looks like we need to run rustfmt on the emitted code. I thought you already were, though? It's been well formatted to date.

@@ -14,6 +14,7 @@ members = [
"eng/test/mock_transport",
"sdk/storage",
"sdk/storage/azure_storage_blob",
"sdk/storage/storage_blob",
Copy link
Member

Choose a reason for hiding this comment

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

This is not the right naming convention. You're azure_storage_blob.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi Heath, that is correct. This is currently what is coming right out of the current routes and definitions in https://github.com/Azure/azure-rest-api-specs/blob/feature/blob-tsp/specification/storage/Microsoft.BlobStorage/tspconfig.yaml (aside from some stop-gap edits for NYI features).
As we are on that topic though, is this what you are envisioning regarding the structure?
Current example for where generated BlobBlobClient lives:
sdk/storage/storage_blob/src/generated/clients/blob_blob_client.rs

Desired destination:
sdk/storage/azure_storage_blob/src/generated/clients/blob_blob_client.rs

storage_blob would then be a module containing the generated client and models, and is defined and used in the azure_storage_blob crate? If so, I can pass this information along to Catalina and Joel that we are moving towards that directory structure- as presently this is what the results of the current latest typespec and emitter (v0.4.0) combination outputs: #1958

As for the hand-edits to generated code, that was for illustrating what the desired changes to generated code should look like, and is being tracked here: https://github.com/Azure/typespec-rust/issues/183

@jhendrixMSFT
Copy link
Member

We run cargo fmt as a post codegen step (i.e. the emitter does not do this) and should require the same for SDKs, verifying this in CI as well.

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.

3 participants