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

fix(doc): problematic polling operation for lro delete #1442

Merged
merged 8 commits into from
Oct 23, 2024

Conversation

archerzz
Copy link
Member

@archerzz archerzz commented Aug 28, 2024

Currently in the offical guide, the same polling operation is shared by all lro operations, which could cause problems for some emitters since the lro metadata contains value which doesn't fit for lro delete. See Azure/autorest.csharp#4827

This commit will create a separate polling operation which fits lro delete. The same definition is already available in

@sharedRoute
@doc("Gets status of a Widget operation.")
getWidgetOperationStatus is Operations.GetResourceOperationStatus<Widget>;
@doc("Gets status of a Widget delete operation.")
@sharedRoute
getWidgetDeleteOperationStatus is Operations.GetResourceOperationStatus<Widget, never>;

Currently in the offical guide, the same polling operation is shared by all lro operations, which could cause problems for some emitters since the lro metadata contains value which doesn't fit for lro delete. See Azure/autorest.csharp#4827
This commit will create a separate polling operation which fits lro delete. The same definition is already available in https://github.com/Azure/typespec-azure/blob/955fc9534c2f7153d45c9fbe5743baa0c104d803/packages/samples/specs/data-plane/trait-versioning/main.tsp#L72-L77
@azure-sdk
Copy link
Collaborator

No changes needing a change description found.

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

Copy link
Contributor

@XiaofeiCao XiaofeiCao left a comment

Choose a reason for hiding this comment

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

Update content below to use createOrReplace as well?

1. We change `createOrUpdateWidget` to use `LongRunningResourceCreateOrUpdate<Widget>` and `deleteWidget` to use `LongRunningResourceDelete`.

Copy link
Member

@markcowl markcowl left a comment

Choose a reason for hiding this comment

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

OK with the added changes

@archerzz archerzz added this pull request to the merge queue Oct 23, 2024
Merged via the queue into Azure:main with commit 0ec0106 Oct 23, 2024
22 checks passed
@archerzz archerzz deleted the docs/lro-delete-polling branch October 23, 2024 03:42
markcowl added a commit to markcowl/typespec-azure that referenced this pull request Dec 5, 2024
Currently in the offical guide, the same polling operation is shared by
all lro operations, which could cause problems for some emitters since
the lro metadata contains value which doesn't fit for lro delete. See
Azure/autorest.csharp#4827

This commit will create a separate polling operation which fits lro
delete. The same definition is already available in
https://github.com/Azure/typespec-azure/blob/955fc9534c2f7153d45c9fbe5743baa0c104d803/packages/samples/specs/data-plane/trait-versioning/main.tsp#L72-L77

---------

Co-authored-by: Mark Cowlishaw <markcowl@microsoft.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.

5 participants