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-blob] Storage core v2 migration #24141

Merged
merged 74 commits into from
Jan 20, 2023
Merged

Conversation

xirzec
Copy link
Member

@xirzec xirzec commented Dec 6, 2022

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 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

Azure Pipelines successfully started running 1 pipeline(s).

@xirzec
Copy link
Member Author

xirzec commented Jan 3, 2023

@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
Contributor

@sarangan12 sarangan12 left a comment

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!!!!

@@ -49,7 +48,6 @@ describe("Aborter", () => {
assert.fail();
} catch (err: any) {
assert.equal(err.name, "AbortError");
assert.equal(err.message, "The operation was aborted.", "Unexpected error caught: " + err);
Copy link
Member

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
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
Member

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
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
Member

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
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.

@xirzec
Copy link
Member Author

xirzec commented Jan 20, 2023

/azp run js - storage-blob - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@xirzec xirzec merged commit 8d0ce9d into Azure:main Jan 20, 2023
@xirzec xirzec deleted the storageCoreV2 branch January 20, 2023 19:34
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
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
KarishmaGhiya pushed a commit that referenced this pull request Jun 8, 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
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