Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.57k stars 4.83k forks source link

azure-sdk-for-net Export-API.ps1 servicelinker step fails due to some model renaming error #45824

Closed us6193 closed 1 month ago

us6193 commented 3 months ago

Before filling a bug

Describe the bug

Hello,

We recently created a new GA version: https://learn.microsoft.com/en-us/rest/api/billing/?view=rest-billing-2024-04-01.
Now we are following this TSG to generate .net SDK: https://eng.ms/docs/products/azure-developer-experience/develop/sdk-generate-mgmt-dotnet.

On step Azure/autorest#2: Generate the API file with the following command, review it and update any SDK API if it does not follow the [.NET Azure SDK Design Guidelines](https://azure.github.io/azure-sdk/dotnet_introduction.html) with [mgmt configurations](https://github.com/Azure/autorest.csharp/blob/feature/v3/docs/mgmt/readme.md#management-plane-configurations) in autorest.md. Then regenerate the API file.
<RepoRoot>\sdk\servicelinker\Azure.ResourceManager.ServiceLinker>..\..\..\eng\scripts\Export-API.ps1 servicelinker

We are seeing below errors:

Build FAILED.

C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\CheckAccessResponse.cs(14,26): error AZC0030: Model name 'CheckAccessResponse' ends with 'Response'. Su
ggest to rename it to 'CheckAccessResult' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.csproj::TargetFr
amework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\CheckAccessRequest.cs(14,26): error AZC0030: Model name 'CheckAccessRequest' ends with 'Request'. Sugge
st to rename it to 'CheckAccessContent' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.csproj::TargetFram
ework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\AcceptTransferRequest.cs(14,26): error AZC0030: Model name 'AcceptTransferRequest' ends with 'Request'.
 Suggest to rename it to 'AcceptTransferContent' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.csproj::T
argetFramework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\AddressValidationResponse.cs(14,26): error AZC0030: Model name 'AddressValidationResponse' ends with 'R
esponse'. Suggest to rename it to 'AddressValidationResult' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billin
g.csproj::TargetFramework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\MoveProductRequest.cs(14,26): error AZC0030: Model name 'MoveProductRequest' ends with 'Request'. Sugge
st to rename it to 'MoveProductContent' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.csproj::TargetFram
ework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\RenewPropertiesResponse.cs(14,26): error AZC0030: Model name 'RenewPropertiesResponse' ends with 'Respo
nse'. Suggest to rename it to 'RenewPropertiesResult' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.cspr
oj::TargetFramework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\DocumentDownloadRequest.cs(14,26): error AZC0030: Model name 'DocumentDownloadRequest' ends with 'Reque
st'. Suggest to rename it to 'DocumentDownloadContent' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.csp
roj::TargetFramework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\PurchaseRequest.cs(14,26): error AZC0030: Model name 'PurchaseRequest' ends with 'Request'. Suggest to
rename it to 'PurchaseContent' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.csproj::TargetFramework=net
standard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\ReservationPurchaseRequest.cs(15,26): error AZC0030: Model name 'ReservationPurchaseRequest' ends with
'Request'. Suggest to rename it to 'ReservationPurchaseContent' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Bi
lling.csproj::TargetFramework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\SavingsPlanValidateResponse.cs(14,26): error AZC0030: Model name 'SavingsPlanValidateResponse' ends wit
h 'Response'. Suggest to rename it to 'SavingsPlanValidateResult' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.
Billing.csproj::TargetFramework=netstandard2.0]
C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Generated\Models\ValidateTransferResponse.cs(14,26): error AZC0030: Model name 'ValidateTransferResponse' ends with 'Res
ponse'. Suggest to rename it to 'ValidateTransferResult' or any other appropriate name. [C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net\sdk\billing\Azure.ResourceManager.Billing\src\Azure.ResourceManager.Billing.c
sproj::TargetFramework=netstandard2.0]
    0 Warning(s)
    11 Error(s)

Time Elapsed 00:00:07.90
PS C:\Users\umangshah\source\repos\us6193\azure-sdk-for-net>

Expected behavior We have not seen similar issues on any other language SDK.

  1. How can we suppress these errors?
  2. If suppression is not the correct way, can you please provide correct guidance to fix it?
    • Does it need to be fixed in generated SDK files?
    • Does that demand a swagger change too? Or just add the renaming mapping to autorest.md.

Additional context Add any other context about the problem here.

jsquire commented 2 months ago

@ArthurMa1978: Can you please triage on behalf of the management team?

ArthurMa1978 commented 2 months ago

Hey @us6193 , These errors are due to naming convention check failures. Please rename these models according to the suggested names which you can add configs in the autrest.md https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/billing/Azure.ResourceManager.Billing/src/autorest.md?plain=1#L105.

github-actions[bot] commented 1 month ago

Hi @us6193. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

github-actions[bot] commented 1 month ago

Hi @us6193, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.