Skip to content

[storage-blob] Storage core v2 migration - #24141

Merged
Jeff Fisher (xirzec) merged 74 commits into
Azure:mainfrom
xirzec:storageCoreV2
Jan 20, 2023
Merged

[storage-blob] Storage core v2 migration#24141
Jeff Fisher (xirzec) merged 74 commits into
Azure:mainfrom
xirzec:storageCoreV2

Conversation

@xirzec

@xirzec Jeff Fisher (xirzec) commented Dec 6, 2022

Copy link
Copy Markdown
Member

This is a full migration of storage-blob to core-rest-pipeline. Feedback would be greatly appreciated!

This PR includes:

  • Support for custom HttpClient defined by consumer
  • Support for custom policies defined by consumer
  • No public breaking changes to existing storage API surface
  • Fully typed _response properties on service responses
  • Passing recorded and live tests ✅

Packages impacted by this PR

storage-blob

Known issues/limitations

  • Two of the tracing tests are currently broken due to the need to migrate to core-tracing 1.0.0.

@xirzec Jeff Fisher (xirzec) added Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) labels Dec 6, 2022
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@xirzec

Copy link
Copy Markdown
Member Author

EmmaZhu-MSFT (@EmmaZhu) I moved the Core changes out of this PR to simplify things a bit. Are you planning to release Storage next week? I'd like to get this change merged ASAP so we can work on the remaining Storage SDKs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks a lot for these changes Jeff!!!!

assert.fail();
} catch (err: any) {
assert.equal(err.name, "AbortError");
assert.equal(err.message, "The operation was aborted.", "Unexpected error caught: " + err);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why removed this line? Is the message deleted or changed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The message is slightly different in browsers if I recall correctly, since it gets handled by fetch and thrown from there

if (err.name === "AbortError") {
resolve();
} else {
reject(new Error("Expected readableStreamBody to emit AbortError"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I understand it's a rare case. Here may cause an exception thrown out from the test cases, I think we should do our best to avoid this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm confused about the concern. Since this promise is awaited by the test function, if it rejects with an error Mocha should catch it and fail the test. Or am I misunderstanding your comment?

it("Retry Policy should work when on PARSE_ERROR with unclosed root tag", async () => {
let injectCounter = 0;
const injector = new InjectorPolicyFactory(() => {
const injector = injectorPolicy(() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We may keep this case to test its compatibility.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure I follow, but are you suggesting we add a test case with an old-style PolicyFactory to ensure compatibility of user defined policies? That seems like a good idea since today we get some coverage from the SDKs that depend on storage-blob, but after those are migrated this will go down.

Comment thread sdk/storage/storage-blob/package.json
@xirzec

Copy link
Copy Markdown
Member Author

/azp run js - storage-blob - tests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@xirzec
Jeff Fisher (xirzec) merged commit 8d0ce9d into Azure:main Jan 20, 2023
@xirzec
Jeff Fisher (xirzec) deleted the storageCoreV2 branch January 20, 2023 19:34
Jeff Fisher (xirzec) added a commit that referenced this pull request Mar 1, 2023
### Packages impacted by this PR

`@azure/storage-file-datalake`

### Issues associated with this PR

#15813

### Describe the problem that is addressed by this PR

This PR migrates storage-file-datalake to the new core pipeline in the
same fashion that storage-blob was recently migrated. There are no
changes to the public surface and existing recorded tests still pass.


### Provide a list of related PRs _(if any)_

#24141
Jeff Fisher (xirzec) added a commit that referenced this pull request Jun 7, 2023
### Packages impacted by this PR

`@azure/storage-file-share`

### Issues associated with this PR

#15813

### Describe the problem that is addressed by this PR

This PR migrates storage-file-share to the new core pipeline in the same
way that storage-blob and storage-file-datalake were migrated. There are
no changes to the public surface and existing recorded tests still pass.

### Provide a list of related PRs _(if any)_

#24141, #24835
Minh-Anh Phan (minhanh-phan) pushed a commit to minhanh-phan/azure-sdk-for-js that referenced this pull request Jun 12, 2023
### Packages impacted by this PR

`@azure/storage-file-share`

### Issues associated with this PR

Azure#15813

### Describe the problem that is addressed by this PR

This PR migrates storage-file-share to the new core pipeline in the same
way that storage-blob and storage-file-datalake were migrated. There are
no changes to the public surface and existing recorded tests still pass.

### Provide a list of related PRs _(if any)_

Azure#24141, Azure#24835
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants