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

[http-client-csharp]: .NET CodeGen should address the errors and warnings from TCGC #5578

Open
3 tasks done
Tracked by #2070
lirenhe opened this issue Jan 13, 2025 · 4 comments
Open
3 tasks done
Tracked by #2070
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Comments

@lirenhe
Copy link
Member

lirenhe commented Jan 13, 2025

Clear and concise description of the problem

We need to empower our customers both internal and external to easily trouble shooting and fix spec issues that would block the CodeGen.

Today, TCGC could already do the check on the patterns and results from TypeSpec compiler and reports warning and errors for the unsupported case and invalid usage.

However, by checking with all language owners, our CodeGen didn't address those errors and warnings from TCGC in CodeGen implementation and in most cases would continue the codegen which would result in unexpected generated code & error. When that happens, the outcome would be difficult to trouble shooting.

This could be part of #5508 to improve self-service trouble shooting.

Expected behavior:

  • .NET CodeGen could display those warnings and errors from TCGC in the output instead of ignoring them.
  • .NET CodeGen should properly address the errors and warnings to provide a better user experience.

workstream this request is associated with

This is related to the TypeSpec E2E scenario to provide a better experience to trouble shooting codegen problems.
It would also improve the experience in SDK automation.

stakeholders

@lmazuel / @lirenhe

priority and timeline.

I suggest we should provide a better way to address TCGC warning/errors as part of the TypeSpec GA.

Checklist

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@ArthurMa1978
Copy link
Member

This is part of Azure/typespec-azure#2070

@JoshLove-msft
Copy link
Contributor

@lirenhe, if these are errors, then shouldn't the generation fail as a result of TCGC throwing errors? Can you provide an example of how this is happening?

@lirenhe
Copy link
Member Author

lirenhe commented Jan 17, 2025

@lirenhe, if these are errors, then shouldn't the generation fail as a result of TCGC throwing errors? Can you provide an example of how this is happening?

Yes, this is the expected behavior but today we continue the generation and ignore TCGC errors.
We face one case when Shanghai team discuss the un-branded support.
@tadelesh / @ArcturusZhang , could you provide the detail of that case? thanks

@JoshLove-msft
Copy link
Contributor

Shouldn't TCGC exit with an error code if they are logging error diagnostics? If something is an error, what is the reason for continuing? All emitters would need to handle this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp
Projects
None yet
Development

No branches or pull requests

3 participants