Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

joheredi
Copy link
Member

@joheredi joheredi commented Jun 9, 2021

Tables service take dates for access policy on an ISO8061 format without decimals on the seconds. However, when Javascript serializes a Date object the ISO representation contains decimals which cause the service to reject the request.

This PR includes:

  • Custom serialization/deserialization to truncate dates when setting AccessPolicies
  • Add Swagger transform to take AccessPolicy as a string to allow us to do custom serialization
  • Re-generate with latest version of Autorest
  • Add tests for ACL
  • Small updates in the README
  • Changelog update

@joheredi joheredi requested review from xirzec and ellismg June 9, 2021 02:19
@joheredi joheredi requested review from bterlson and chradek as code owners June 9, 2021 02:19
@ghost ghost added the Tables label Jun 9, 2021

import "./env";

const mockAccountName = "fakestorageaccount";
Copy link
Member Author

Choose a reason for hiding this comment

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

signature auth methods are sensitive to changes in the account name. So I decided to bring back the account name to allow us to test with playback using AzureNamedKeyCredential

Copy link
Member

Choose a reason for hiding this comment

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

is this going to make it harder for someone who isn't you to update the tests? Or would they just need to change the name to the account they recorded with?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I found a way to keep it replaced so that this doesn't become a problem. Waiting for CI to confirm

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.

Looks good! Just a few little remarks


import "./env";

const mockAccountName = "fakestorageaccount";
Copy link
Member

Choose a reason for hiding this comment

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

is this going to make it harder for someone who isn't you to update the tests? Or would they just need to change the name to the account they recorded with?

@joheredi
Copy link
Member Author

joheredi commented Jun 9, 2021

/azp run js - data-tables - test

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

Copy link
Member

@ellismg ellismg left a comment

Choose a reason for hiding this comment

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

This could very likely be a case of "Matt doesn't grok promises again today" but I made a note about us maybe wanting to await something we weren't previously. Not sure if this is indicative of a larger issue.

Also, I made one small note on the generated code before I realized I was reviewing generated code, but maybe it's worthwhile feedback.

throw new Error("'url' cannot be null or empty");
constructor(url: string, options?: GeneratedClientOptionalParams) {
if (url === undefined) {
throw new Error("'url' cannot be null");
Copy link
Member

Choose a reason for hiding this comment

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

The error message says url can not be null but the check just ensures it is not undefined.

I guess this is all generated code anyway and we wouldn't call it with null but it feels a little weird that the generate code comment is misleading?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes this is great feedback, thanks!

fyi: @sarangan12

override-client-name: GeneratedClient
use-extension:
"@autorest/typescript": "https://aka.ms/autorest/typescript/corev2"
"@autorest/typescript": "latest"
Copy link
Member

Choose a reason for hiding this comment

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

Woohoo!

Copy link
Member

@ellismg ellismg left a comment

Choose a reason for hiding this comment

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

LGTM

@joheredi
Copy link
Member Author

joheredi commented Jun 9, 2021

/azp run js - data-tables - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ghost
Copy link

ghost commented Jun 9, 2021

Hello @joheredi!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@joheredi joheredi merged commit 540791d into Azure:master Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants