Skip to content

feat(dpg): initial support of lro#3810

Merged
m-nash merged 22 commits intoAzure:feature/v3from
archerzz:dpg/lro/standard-2
Oct 13, 2023
Merged

feat(dpg): initial support of lro#3810
m-nash merged 22 commits intoAzure:feature/v3from
archerzz:dpg/lro/standard-2

Conversation

@archerzz
Copy link
Member

@archerzz archerzz commented Oct 10, 2023

Description

  • adopt getLroMetadata from @azure-tools/typespec-azure-core instead of fetching lro metadata by ourselves
  • add cadl-ranch test cases:
    • lro/standard: but disable the case of model property
    • lro/rpg-legancy
  • delete test project LroBasic-TypeSpec which can be covered by cadl-ranch test cases
  • in code generator, for dpg, use final response as the return type of the generated methods
  • minor refactoring and cleanup

resolve #2988

Checklist

To ensure a quick review and merge, please ensure:

  • The PR has a understandable title and description explaining the why and what.
  • The PR is opened in draft if not ready for review yet.
    • If opened in draft, please allocate sufficient time (24 hours) after moving out of draft for review
  • The branch is recent enough to not have merge conflicts upon creation.

Ready to Land?

  • Build is completely green
    • Submissions with test failures require tracking issue and approval of a CODEOWNER
  • At least one +1 review by a CODEOWNER
  • All -1 reviews are confirmed resolved by the reviewer
    • Override/Marking reviews stale must be discussed with CODEOWNERS first- adopt getLroMetadata from @azure-tools/typespec-azure-core instead of fetching lro metadata by ourselves
  • add cadl-ranch test cases of lro/standard, but disable the case of model property
  • disable test case of LongRunningResourceCreateWithServiceProvidedName which is blocked by a defect in typespec-azure
  • in code generator, for dpg, use final response as the return type of the generated methods
  • minor refactoring and cleanup

archerzz and others added 14 commits June 27, 2023 18:28
- adopt `getLroMetadata` from `@azure-tools/typespec-azure-core` instead of fetching lro metadata by ourselves
- add `cadl-ranch` test cases of `lro/standard`, but disable the case of model property
- disable test case of `LongRunningResourceCreateWithServiceProvidedName` which is blocked by a defect in `typespec-azure`
- in code generator, for dpg, use final response as the return type of the generated methods
- minor refactoring and cleanup
# Conflicts:
#	src/AutoRest.CSharp/LowLevel/Output/OperationMethodChainBuilder.cs
#	test/TestProjects/Authoring-TypeSpec/src/Generated/AuthoringTypeSpecClient.cs
#	test/TestProjects/Authoring-TypeSpec/src/Generated/Docs/AuthoringTypeSpecClient.xml
#	test/TestProjects/Authoring-TypeSpec/src/Generated/tspCodeModel.json
#	test/TestProjects/Authoring-TypeSpec/tests/Generated/Samples/Samples_AuthoringTypeSpecClient.cs
#	test/TestProjects/Lro-Basic-TypeSpec/src/Generated/LroBasicTypeSpecClient.cs
- remove `Lro-Basic-TypeSpec` which can be replaced by cadl-ranch tests
- add `lro/rpc/legacy` tests from cadl-ranch
- rename namespace to avoid `Azure.Core` which mess up Roslyn code simplification
- add leading `_` to `Azure` to avoid generator scaffolding logic to create test projects as Azure SDK projects
# Conflicts:
#	src/AutoRest.CSharp/LowLevel/Output/OperationMethodChainBuilder.cs
#	test/CadlRanchProjects/azure/core/lro/standard/src/Generated/StandardClient.cs
#	test/TestProjects/Authoring-TypeSpec/src/Generated/Docs/AuthoringTypeSpecClient.xml
#	test/TestProjects/Authoring-TypeSpec/src/Generated/tspCodeModel.json
#	test/TestProjects/Authoring-TypeSpec/tests/Generated/Samples/Samples_AuthoringTypeSpecClient.cs
#	test/TestProjects/Lro-Basic-TypeSpec/Lro-Basic-TypeSpec.tsp
#	test/TestProjects/Lro-Basic-TypeSpec/src/Generated/Docs/LroBasicTypeSpecClient.xml
#	test/TestProjects/Lro-Basic-TypeSpec/src/Generated/tspCodeModel.json
#	test/TestProjects/Lro-Basic-TypeSpec/tests/Generated/Samples/Samples_LroBasicTypeSpecClient.cs
# Conflicts:
#	test/CadlRanchProjects/azure/core/lro/standard/src/Generated/StandardClient.cs
#	test/TestProjects/Authoring-TypeSpec/src/Generated/Docs/AuthoringTypeSpecClient.xml
#	test/TestProjects/Authoring-TypeSpec/src/Generated/tspCodeModel.json
#	test/TestProjects/Authoring-TypeSpec/tests/Generated/Samples/Samples_AuthoringTypeSpecClient.cs
#	test/TestProjects/Lro-Basic-TypeSpec/src/Generated/Docs/LroBasicTypeSpecClient.xml
#	test/TestProjects/Lro-Basic-TypeSpec/tests/Generated/Samples/Samples_LroBasicTypeSpecClient.cs
@archerzz archerzz force-pushed the dpg/lro/standard-2 branch 5 times, most recently from 5668b59 to 4bf1b1f Compare October 10, 2023 09:02
@m-nash m-nash merged commit bb1b965 into Azure:feature/v3 Oct 13, 2023
live1206 pushed a commit to live1206/autorest.csharp that referenced this pull request Dec 11, 2023
* feat(dpg): initial support of lro

- adopt `getLroMetadata` from `@azure-tools/typespec-azure-core` instead of fetching lro metadata by ourselves
- add `cadl-ranch` test cases of `lro/standard`, but disable the case of model property
- disable test case of `LongRunningResourceCreateWithServiceProvidedName` which is blocked by a defect in `typespec-azure`
- in code generator, for dpg, use final response as the return type of the generated methods
- minor refactoring and cleanup

* add unit test

* update test cases

- remove `Lro-Basic-TypeSpec` which can be replaced by cadl-ranch tests
- add `lro/rpc/legacy` tests from cadl-ranch

* fix errors in cadl ranch lro test projects

- rename namespace to avoid `Azure.Core` which mess up Roslyn code simplification
- add leading `_` to `Azure` to avoid generator scaffolding logic to create test projects as Azure SDK projects

* fix test cases

* regen

* add custom-link and custom-operation-reference as final state via

* use `envelopResult` to keep existing behavior (maybe temporarily)

* regen after merge

* update to use logical result

* update authoring

* regen unit tests

---------

Co-authored-by: Mingzhe Huang (from Dev Box) <mingzhehuang@microsoft.com>
Co-authored-by: m-nash <prognash@gmail.com>
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.

How to define a correct LRO

2 participants