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

[Storage] Flattening Client Hierarchy - storage-queue #5579

Merged

Conversation

HarshaNalluru
Copy link
Member

@HarshaNalluru HarshaNalluru commented Oct 15, 2019

This PR proposes the new shape of QueueClient and QueueServiceClient.

Changes in this PR.

  • QueueClient is flattened into QueueServiceClient,
  • MesagesClient is renamed to QueueClient,
  • MessageIdClient is flattened into the new QueueClient.
  • Names of the methods on clients are updated as per the .NET Storage Queue SDK appropriately

The final version is consistent with the .NET.

this.pipeline.toServiceClientOptions()
);
// Override protocol layer's default content-type
(storageClientContext as any).requestContentType = undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

extract common code to a helper that takes url and pipeline then returns a storage client context

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@HarshaNalluru
Copy link
Member Author

HarshaNalluru commented Oct 16, 2019

  • Fixed all the tests to be able to use the existing recordings.
    • Live tests are fine ✔,
    • playback is also fine ✔.
  • Have not updated the test/test-suite titles. If they are updated, recordings should also be updated accordingly which would mean there would be too many changes in this PR.

Considering a followup PR for updating test titles/test refactoring. Any opinions?

*/
public async enqueueMessage(
messageText: string,
options: MessagesEnqueueOptions = {}
Copy link
Member Author

Choose a reason for hiding this comment

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

The name MessagesEnqueueOptions was for the enqueue method on MessagesClient.
Now that it is moved to QueueClient and the method is enqueueMessage, should this be renamed to EnqueueMessageOptions?

MessagesEnqueueOptions -> EnqueueMessageOptions or QueueEnqueueMessageOptions.

Same is applicable for many other options/responses interfaces in this file.

Copy link
Contributor

Choose a reason for hiding this comment

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

We will have to rename these for consistency. Let's leave them as is for now.

@HarshaNalluru HarshaNalluru requested review from xirzec and ramya-rao-a and removed request for xirzec October 16, 2019 01:52

// Override protocol layer's default content-type
const storageClientContext = this.storageClientContext as any;
storageClientContext.requestContentType = undefined;
Copy link
Member Author

@HarshaNalluru HarshaNalluru Oct 16, 2019

Choose a reason for hiding this comment

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

Refactoring - Defined getStorageClientContext in utils.common.ts file so that it can be reused for messagesContext and messageIdContext

public async createQueue(
queueName: string,
options: QueueCreateOptions = {}
): Promise<Models.QueueCreateResponse> {
Copy link
Member Author

Choose a reason for hiding this comment

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

Newly added.

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this have a tracing span for it?

Copy link
Member Author

@HarshaNalluru HarshaNalluru Oct 16, 2019

Choose a reason for hiding this comment

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

Logged an issue #5595

* @returns {Promise<Models.QueueDeleteResponse>} Response data for the Queue delete operation.
* @memberof QueueServiceClient
*/
public async deleteQueue(
Copy link
Member Author

Choose a reason for hiding this comment

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

Newly added.

Copy link
Member

Choose a reason for hiding this comment

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

Tracing span?

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought about it but since this is only a pass-through call it looks okay to not have the span?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@jeremymeng, @xirzec says that it would be good to have the consistency, If we have spans at both the places, we'll know the actual path it took.

Copy link
Contributor

@jeremymeng jeremymeng left a comment

Choose a reason for hiding this comment

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

:shipit:

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