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

[communication] add LROs #11713

Merged
merged 25 commits into from
Oct 28, 2020
Merged

[communication] add LROs #11713

merged 25 commits into from
Oct 28, 2020

Conversation

0rland0Wats0n
Copy link
Contributor

@0rland0Wats0n 0rland0Wats0n commented Oct 7, 2020

This PR:

  1. adds beginReservePhoneNumbers LRO
    • implements cancel on beginReservePhoneNumbers LRO
  2. adds beginReleasePhoneNumbers LRO
  3. adds beginPurchaseReservation LRO
    • implements cancel on beginPurchaseReservation LRO
  4. adds beginReservePhoneNumbers LRO recorded tests
  5. adds beginReleasePhoneNumbers LRO recorded tests
  6. adds beginPurchaseReservation LRO recorded tests
  7. updates README to reflect new LROs
  8. renames PhoneNumberSearch to PhoneNumberReservation on code generation
  9. renames searchId to reservationId on code generation

/**
* Represents the poller client used internally.
*/
client: PhoneNumberPollerClient;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi! I know we've been using this pattern in other clients, but the client's don't need to live as part of the operation state. The client can be passed only through parameters. I'll make a PR today to showcase this. Please ping me if you don't hear of me today.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've added you as a reviewer to this PR: #11717 it's a cleanup of the Key Vault Keys LROs, based on a recent brainstorming session I had with @willmtemple ! Reviews appreciated 🙏

Copy link
Member

@DominikMe DominikMe left a comment

Choose a reason for hiding this comment

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

Great to see this :-)
Left a few initial comments. I'm curious to see how the code gets simpler once we don't use the internal Client subset in the poller state objects.

Copy link
Member

@DominikMe DominikMe left a comment

Choose a reason for hiding this comment

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

Greate work, I've done another pass and added some more comments. I agree that once those are addressed we can merge this and refactor later.

sdk/communication/communication-administration/README.md Outdated Show resolved Hide resolved
sdk/communication/communication-administration/README.md Outdated Show resolved Hide resolved
sdk/communication/communication-administration/README.md Outdated Show resolved Hide resolved
@@ -397,6 +416,12 @@ export interface PhoneNumberEntity {
status?: string;
}

// @public
export interface PhoneNumberPollerOptions extends OperationOptions {
intervalInMs?: number;
Copy link
Member

Choose a reason for hiding this comment

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

I think the guidelines want us to name this pollInterval but I like that we're specifying milliseconds here.
https://azure.github.io/azure-sdk/typescript_design.html#ts-lro

@xirzec What would the right property name?


await purchasePoller.pollUntilDone();
assert.ok(purchasePoller.getOperationState().isCompleted);
}).timeout(60000);
Copy link
Member

Choose a reason for hiding this comment

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

Does the timeout need to be that high?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea the test actually took about that time to run


const { status } = await client.getReservation(reservationId);
assert.equal(status, "Cancelling" || "Cancelled");
}).timeout(30000);
Copy link
Member

Choose a reason for hiding this comment

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

Can this be shorter?

Copy link
Member

@DominikMe DominikMe left a comment

Choose a reason for hiding this comment

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

🎉 Lgtm, let's get this merged

@DominikMe DominikMe merged commit 351da5f into Azure:master Oct 28, 2020
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this pull request Nov 18, 2020
Fixed some more Swagger issues (Azure#11713)

Co-authored-by: Amogh Natu <amnat@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.

3 participants