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

Sync the branch feature/modular/lro/v3 to main #2473

Merged
merged 25 commits into from May 7, 2024
Merged

Conversation

MaryGao
Copy link
Contributor

@MaryGao MaryGao commented Apr 24, 2024

Sync the branch feature/modular/lro/v3 to main

MaryGao and others added 6 commits March 21, 2024 12:42
* Generate lro test cases

* Update the dependencies to the latest

* Manually update the sdk for new lro interfaces

* Update the logical result

* Add the lro cases

* Add the test cases for lro

* Update the restore from helpers

* update changes

* Add test cases for restore from helper

* Update the type inference

* update the test cases with next sub path changes

* update the version

* Update the test cases for sub path design

* Update the test cases and refine the helper function

* Update the helper for resouce location config

* Revert changes

* update the lro code to fix issues

* Build the restore poller helper

* Update the comments

* Update the generated code

* Regenerate operations

* Update the lro options

* update the restore hard-code parts

* Fix compile errors

* Update the skip files

* Update the restore poller hard-coded imports

* Fix the in unexpected helper issues

* Support the abort signal in lro operation

* Fix import issue in classical client

* Update the poller dependency

* Fix import issues

* Update the smoke test and fix small issues

* Add test cases for multiple groups with same name lro operation

* Update the core-lro dependency

* Resolve the name conflict in restorePollerHelpers

* update the codegen

* Regenerate the integration testing

* Remove the only filters

* Resolve conflicts

* Resolve conflicts

* update the code

* Regenerate after fix the error model import issue

* Fix the client name issue

* Re-generate the codes

* Resolve conflicts

* Added lro standard test cases

* Update the open ai code

* Update the rpc cases

* Update the health insight cases

* Update the lro logic response castcading

* resolve conflicts

* Update the logical results

* update changes

* update changes

* Update dirty files

* update to the v3 for testing purpose

* Temp verification

* Reset changes

* Regenerate with the new lro interface

* Add filters when importing models

* Regenerate the lro code

* Install deps for lro sdk

* Update the smoke testing

* Revert changes

* Update .vscode/launch.json

* Add comments and refactor code a little bit

* Update the comments

* Import OperationState from core not directly generating it

* Remove useless code

* Regenerate the integration testing

* Update the smoke test code and enrich the lro ut

* Adjust the comment for restore poller

* Regenerate code

* Update lock file

* Update the  load-testing.api.md

* Update the case

* Resolve comments here

* Remove useless console.log

* Remove the health-insights-clinicalmatching.api

* Remove useless code and update the core-lro to v3

* Regen the smoke testings

* Update the metadata

* Remove useless codes

* Update packages/typespec-ts/test/modularIntegration/lroStardard.spec.ts

Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com>

* Refactor the code a little bit and change the patch hack

* Always generate result.body for patch lro

* spell refinement

* Revert order changes

* Update packages/rlc-common/src/buildIndexFile.ts

* update changes

---------

Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com>
* deprecate-baseurl-in-favor-of-endpoint (#2246)

* deprecate-baseurl-in-favor-of-endpoint

* codegen change

* fix integration test and unit test

* update smoke-test && merge main

* revert smoke-test-list

* update

* revert change

* update

* update

* update

* update

* Revert "update"

This reverts commit 02967a1.

* update

* fix ci

* rename endpoint parameter

* update (#15)

* update test

---------

Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>

* Support usage and access (#2356)

* support-usage-and-access

* add generate orphan models options

* test push code to pr

* add test case for clientGeneratorCore access and usage

* rename public as operation name for now

* fix integration test

* add modular test case and remove duplicate case

* regenerate all test

* regenerate rlc test

* fix ci

---------

Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com>

* Support server versions in modular and add cadl-ranch test cases (#2261)

* add modular server versions

* fix version param global calculation

* fix api version in operation logic

* fix versioned test

* fix ci

* fix ci

* add rlc server versions in this pr

* revert smoke test

* should only have client side api version if api version exists in all operations

* fix batch

* fix ut

* unify api version when it exists in all operations

* fix smoke test

* fix ci

* fix parameters

* fix ci

* add ut for api version in modular

* Update packages/typespec-ts/test/modularUnit/apiOperations.spec.ts

* fix ut

* reserve work

* generate client level required apiVersion

* handle api-version in both url and query

* fix ci

* should not export apiVersion in operation level signature when it has default value

* Update packages/typespec-ts/src/modular/helpers/operationHelpers.ts

* fix integration test

* fix smoke-test

* regen smoke-test

* regen cadl test case

* add ut and fix smoke test

* resolve comments

---------

Co-authored-by: qiaozha <qiaozha@microsoft.com>
Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com>

* Add coverage cases for Server NotDefined in cadl-ranch (#2370)

* Supplement server endpoint not-defined

* update cadl-ranch version

* bump cadl ranch version regen code

* Add coverage cases for Azure Core Scalar in cadl-ranch (#2369)

* Supplement azure core scalar

* update test case

* remove .only in test case

* update test case

* Fix cadl-ranch test

* Fix the un-used reference issue

* Fix name conflict issues

* fix ci smoke test error

---------

Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com>
Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>
Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com>
Co-authored-by: qiaozha <qiaozha@microsoft.com>
* Fix typo issues

* Update the reference property

* Remove the useLegacyLro options

* Update the template to adopt with v3 changes

* Update the lro flag and enable useLegacyV2Lro for load test

* Update the changes

* Update the swagger side with this options

* Update the flag in smoke test

* Update the integration testing in swagger repo

* Adopt the option useLegacyV2Lro for swagger way

* Revert change in smoke test

* Update packages/autorest.typescript/test/commands/smoke-test-list.ts

* Update the smoke test in typespec

* Update the test case for lro rpcClient

* Add test cases for lro rpc rlc

* Change to lro rpc

* Update the modular poller in rlc and disable legacy code in modular

* Add a warning

* Testing in local env

* Fix the exception issue during polling initial process

* regen lro code

* regen smoke-test code

* Update packages/typespec-ts/package.json

* Update packages/typespec-ts/package.json

* Update the lock file

* Remove the option for useLegacyV2Lro

* Revert testing changes

* Regenerate rlc lro with v3 version

* Update the modular test

* Regenerate smoke testing in swagger

* Refresh the smoke test in tsp

* Update the content

* regen smoke test

* regen integration code

* Should report the server message

* Update the package.json for rlc integration

* update the commands

* Update the smoke git diff

* update the rlc path

* Add extra steps to install dependencies

* Update the dependencies for browser testing

* Revert changes

* Update the install commands

* Remove the option useLegacyV2Lro

* Update the documents

* Update the swagger generation

* regen integration code

* regen smoke test

* remove the un-used command

* Update the scripts to install deps

* Update the RLC simplepollerlike with comments

* regen smoke test and integration

* regen smoke test tag rlc

* Update the namings

* Avoid breakings for toString

* Update the integration for swagger

* update changes

* regen test

* Update the lro template

* Support abort signal for modular lro

* regen integration test

* regen smoke test

* regen rlc swagger test

* Update the node version

* Update the smoke test

* update the ut name

* update the test cases

* Regen smoke testing

* update the smoke testing

---------

Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com>
Co-authored-by: Di Jiao <v-jiaodi@microsoft.com>
* deprecate-baseurl-in-favor-of-endpoint (#2246)

* deprecate-baseurl-in-favor-of-endpoint

* codegen change

* fix integration test and unit test

* update smoke-test && merge main

* revert smoke-test-list

* update

* revert change

* update

* update

* update

* update

* Revert "update"

This reverts commit 02967a1.

* update

* fix ci

* rename endpoint parameter

* update (#15)

* update test

---------

Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>

* Support usage and access (#2356)

* support-usage-and-access

* add generate orphan models options

* test push code to pr

* add test case for clientGeneratorCore access and usage

* rename public as operation name for now

* fix integration test

* add modular test case and remove duplicate case

* regenerate all test

* regenerate rlc test

* fix ci

---------

Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com>

* Support server versions in modular and add cadl-ranch test cases (#2261)

* add modular server versions

* fix version param global calculation

* fix api version in operation logic

* fix versioned test

* fix ci

* fix ci

* add rlc server versions in this pr

* revert smoke test

* should only have client side api version if api version exists in all operations

* fix batch

* fix ut

* unify api version when it exists in all operations

* fix smoke test

* fix ci

* fix parameters

* fix ci

* add ut for api version in modular

* Update packages/typespec-ts/test/modularUnit/apiOperations.spec.ts

* fix ut

* reserve work

* generate client level required apiVersion

* handle api-version in both url and query

* fix ci

* should not export apiVersion in operation level signature when it has default value

* Update packages/typespec-ts/src/modular/helpers/operationHelpers.ts

* fix integration test

* fix smoke-test

* regen smoke-test

* regen cadl test case

* add ut and fix smoke test

* resolve comments

---------

Co-authored-by: qiaozha <qiaozha@microsoft.com>
Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com>

* Add coverage cases for Server NotDefined in cadl-ranch (#2370)

* Supplement server endpoint not-defined

* update cadl-ranch version

* bump cadl ranch version regen code

* Add coverage cases for Azure Core Scalar in cadl-ranch (#2369)

* Supplement azure core scalar

* update test case

* remove .only in test case

* update test case

* fix easm build failure (#2379)

* add easm test case

* Fix the core model renaming due to enableModelNamespace option enabled

* update

* update

* remove easm

---------

Co-authored-by: Mary Gao <yanmeigao1210@gmail.com>

* Upgrade the emitter version in April (#2395)

* Upgrade the emitter version

* Update the changelog

* Update the changelog

* Update the changelog

* Update packages/autorest.typescript/CHANGELOG.md

* Update packages/rlc-common/CHANGELOG.md

* Update packages/typespec-ts/CHANGELOG.md

---------

Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com>

* Fix missing scripts issue in package.json and bump emitter version (#2402)

* fix rlc package.json script issue

* Update the Unit test

* Update the changelog and regen smoke test

* Update the issue number

* Update the lock file

---------

Co-authored-by: Mary Gao <yanmeigao1210@gmail.com>

* Support special words (#2387)

* support-special-words

* update cadl ranch list

* update

* Update specialWords.spec.ts

* design implementation

* update test

* Update nameUtils.spec.ts

* update

* fix naming if operation name duplicate

* update typespec-test smoke-test

* Update clientContext.spec.ts

* fix-naming-parity-with-hlc (#17)

* fix optional params

* update rlc test

* update non-branded-test

* should not rename property name

---------

Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>

* Update specialWords.spec.ts (#2431)

* Add rlc coverage cases for payload media type in cadl-ranch (#2265)

* add rlc payload media type

* rege code and remove .only in test case

* update test case

* Upgrade `mkdirp` to ^3.0.1

by doing a string replacement

* Support server parameter in modular (#2424)

* enable-modular-in-parameterized-host

* support optional client parameter in modular

* enable anomaly detector modular generation

* fix ut

* fix cadl ranch test case

* fix smoke test

* reserve work

* fix anomaly detector api version missing

* use camel case for file name in modular client

* fix filename uppercase

* fix client name upper case

* resolve duplicate files

* fix batch rename

* fix rename in chatapi

* fix rename for contentsafety

* fix renaming in smoke test

* fix renaming in integration test

* fix batch rename

* fix smoke-test

* normalize name

* fix non-branded case

* fix ci

* fix ci

* Add modular coverage cases for payload media type in cadl-ranch (#2266)

* add modular payload media type

* update test case

* fix issus

* use local dev version

* update @azure-rest/core-client to 1.4.0

* regen code

---------

Co-authored-by: Qiaoqiao Zhang <qiaozha@microsoft.com>

* Fix the missing scripts issues and add test config (#2426)

* Fix the missing scripts issues

* add ut

* update

* update

* fix ci

* Remove the @azure-tools/vite-plugin-browser-test-map dependency

* Added the browser config in azure mono repo

* update smoke test

* update

---------

Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>

* Upgrade generated packages to have `typescript@~5.4.5`

* Extensible/fixed enum support & upgrade compiler to v0.55 (#2380)

* Update the tcgc to latest dev

* Fix build issue

* Update the UTs

* Update the enum and union cases

* Update the extensible enum

* Update the modular enum and union

* regen code

* Set the default flattenUnionAsEnum option

* gen fixedEnums and extensibleEnums code

* Enable the option flatten-union-as-enum as false for ts

* Refactor rlc UTs

* Regenerate the union cases in modular

* update smoeke test

* Update the UnitTest

* update input usage

* skip overload and generate code

* Update the import issue

* Disable the overload case

* regen code

* Upgrade to the latest

* Revert overload

* Resolve conflicts

* Remove skipped cases

* add union enum case

* smoke test

* regen integration code

* Disable the server case

* regen smoke test

* enable server path multiple

* rege integration code

* rebuild server path multiple

* Update the apiVerison fix

* update lock file

* lock file update

* Update the extensible and fixed enum

* update the changes

* update deleted files

* Regenerate smoke test

* Resolve comments

---------

Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com>
Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>

* Update core client (#2441)

* update core client

* update format

* fix ci error

* Bump `typescript` version to ~5.4.5 in code generator packages

* Upgrade `c8` version to ^9.1.0 in generated packages

The c8 version azure-sdk-for-js repro has been upgraded to ^9.1.0 already.

* Support additional properties full cases in RLC (#2445)

* upgrade cadl-ranch version

* update

* fix rlc additional properties

* update test case

* update

* update test case

---------

Co-authored-by: qiaozha <qiaozha@microsoft.com>

* 9.1.0

* Update the changelog and bump versions in mid April (#2452)

* Update the changelog and bump versions

* update the lock file

* upgrade the tcgc to the latest stable

* revert version

* Downgrade to 18.19.x version

* Downgrade to 18.19.x

---------

Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com>

* add server test case for modular and rlc (#2457)

* Document package-version in README.md (#2365)

* Add encode bytes missing test (#2456)

* add missing test

* fix body parameter format

---------

Co-authored-by: qiaozha <qiaozha@microsoft.com>

* Replace `esm` dev dependency with `tsx` for js mono repo

as we already switched to `tsx` in PR https://github.com/Azure/azure-sdk-for-js/pull/28826/files#diff-164a9ae95cf7571742ca1882b5fdc0a43e7000c271ff566de5e99ef2c2820021R34

* update unit test

* use `dev-tool run extract-api` in packages generated for JS mono repo

This follows the commit in JS repo: Azure/azure-sdk-for-js@224f7c1

* update test baselines

* fix unit tests

* fix test

* switch back to nyc

* update unit test

* add cancellationToken case (#2463)

* add cancellationToken case

* update

* update to the latest

* Update the smoke test code to the latest main

* update the integration to latest main

* update the latest modular int

* Adopt change to latest main

* Regen smoke and integration test

* change the client name

* Delete useless code

* remove ut

* update the integration for lro

* Upgrade the tcgc to v0.41.3 (#2453)

* Update the changelog and bump versions

* update the lock file

* upgrade the tcgc to the latest stable

* update version

* update version

* upgrade tcgc

* fix ci error

* regen smoke test

* Remove the hard coded template logic

* regen integration and smoke test

---------

Co-authored-by: Mary Gao <yanmeigao1210@gmail.com>

* upgrade rush version (#2468)

* merge to the latest feature branch

* merge to the main

* update the lock file

* fix ci error

---------

Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com>
Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>
Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com>
Co-authored-by: qiaozha <qiaozha@microsoft.com>
Co-authored-by: Jeremy Meng <jeremy.ymeng@gmail.com>
Co-authored-by: Jeremy Meng <yumeng@microsoft.com>
Co-authored-by: Max Horstmann <MaxHorstmann@users.noreply.github.com>
@MaryGao MaryGao marked this pull request as ready for review April 24, 2024 09:01
@MaryGao MaryGao changed the title Feature/modular/lro/v3 Sync the branch feature/modular/lro/v3 to main Apr 24, 2024
MaryGao and others added 18 commits April 24, 2024 17:12
# Conflicts:
#	packages/typespec-test/test/openai_modular/generated/typespec-ts/src/rest/pollingHelper.ts
#	packages/typespec-ts/src/index.ts
#	packages/typespec-ts/src/modular/buildPagingFiles.ts
#	packages/typespec-ts/src/transform/transformHelperFunctionDetails.ts
#	packages/typespec-ts/test/integration/generated/lro/lroRPC/src/isUnexpected.ts
Copy link
Member

@qiaozha qiaozha left a comment

Choose a reason for hiding this comment

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

lgtm, some small comments.

@@ -27,8 +27,8 @@
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.6.2",
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^1.0.0"
"@azure/core-lro": "3.0.0-beta.1",
Copy link
Member

Choose a reason for hiding this comment

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

when do we plan to GA core-lro?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i plan to GA core lro in May and the pr is here Azure/azure-sdk-for-js#29450.

packages/autorest.typescript/webpack.config.test.js Outdated Show resolved Hide resolved
@@ -45,8 +45,8 @@
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.6.2",
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^1.0.0",
"@azure/core-lro": "3.0.0-beta.1",
Copy link
Member

Choose a reason for hiding this comment

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

another question is why are we still using 3.0.0-beta.1 since beta.2 is released several weeks?

Copy link
Contributor Author

@MaryGao MaryGao May 7, 2024

Choose a reason for hiding this comment

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

With deya's comments added, beta.2 has new changes compared with beta1, we need small adoption effort for it. the pr is mainly for sync the feature branch back.

@@ -81,7 +82,7 @@ export const rlcTsps = [
},
{
outputPath: "lro/lroRPC",
inputPath: "azure/core/lro/rpc-legacy"
inputPath: "azure/core/lro/rpc"
Copy link
Member

Choose a reason for hiding this comment

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

can we change the output path to be consistent with modular?

Copy link
Contributor Author

@MaryGao MaryGao May 7, 2024

Choose a reason for hiding this comment

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

sure let me revisit this in seperated pr.

@MaryGao MaryGao merged commit 8a35e4d into main May 7, 2024
14 checks passed
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.

None yet

3 participants