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

[Key Vault] Full LRO refactoring #12630

Merged
merged 16 commits into from
Nov 25, 2020
Merged

Conversation

sadasant
Copy link
Contributor

@sadasant sadasant commented Nov 20, 2020

Following the Key Vault Keys LRO refactoring PR (link), this PR refactors all of the LROs in the other Key Vault clients. It also cleans up the initial refactor of the Key Vault Keys LROs.

There are some small changes in the public API, but they're only renames.

I'll leave in draft for a while since we're not releasing Key Vault so soon.

@sadasant sadasant added Client This issue points to a problem in the data-plane of the library. KeyVault labels Nov 20, 2020
@sadasant sadasant requested a review from xirzec November 20, 2020 00:26
@sadasant sadasant self-assigned this Nov 20, 2020
Copy link
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

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

Seems like a clean refactoring to me! Good work on this.

if (endTime) {
state.isCompleted = true;
}
if (error && error.message) {
Copy link
Member

Choose a reason for hiding this comment

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

what happens if error has an empty message? Does it never finish? Do we ignore it?

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 think the error is only valid if it has a message. I'll ask the team!

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 made an issue! #12693 I'll follow up before the next Key Vault release.

}
if (error && error.message) {
state.isCompleted = true;
state.error = new Error(error.message);
Copy link
Member

Choose a reason for hiding this comment

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

Curious why we recreate the error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error we receive is of the type ErrorModel, which is some sort of error tree:

/**
 * The key vault server error.
 */
export interface ErrorModel {
  /**
   * The error code.
   */
  readonly code?: string;
  /**
   * The error message.
   */
  readonly message?: string;
  /**
   * The key vault server error.
   */
  readonly innerError?: ErrorModel;
}

I'll leave this as creating a new error for now.

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 made an issue! #12693 I'll follow up before the next Key Vault release.

Copy link
Member

@bterlson bterlson left a comment

Choose a reason for hiding this comment

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

Hey this is pretty great! Quite a satisfying diff to read through 😁

@sadasant
Copy link
Contributor Author

@bterlson wow! thank you for that review 🙏🙌❤

@sadasant sadasant merged commit 6c6ce54 into Azure:master Nov 25, 2020
@sadasant sadasant deleted the keyvault/full-lro-update branch November 25, 2020 18:54
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this pull request Jan 26, 2021
add vmss capabilities to force delete (Azure#12630)
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this pull request Jan 26, 2021
add vmss capabilities to force delete (Azure#12630)
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this pull request Jan 26, 2021
add vmss capabilities to force delete (Azure#12630)
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this pull request Jan 26, 2021
add vmss capabilities to force delete (Azure#12630)
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this pull request Jan 26, 2021
add vmss capabilities to force delete (Azure#12630)
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this pull request Jan 26, 2021
add vmss capabilities to force delete (Azure#12630)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. KeyVault
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants