-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[storage-blob] refactor to dedupe code that is available in storage-common #36333
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors storage-blob to deduplicate code by moving common functionality to storage-common. The changes primarily involve removing duplicate implementations of credentials, policies, and utilities from storage-blob and importing them from storage-common instead. This improves maintainability and reduces code duplication across storage packages.
- Removed duplicate policy implementations (StorageSharedKeyCredentialPolicy, StorageRetryPolicy, StorageBrowserPolicy, etc.)
- Removed duplicate credential implementations (StorageSharedKeyCredential, AnonymousCredential)
- Updated imports across the codebase to use
@azure/storage-common - Updated documentation URLs to remove locale prefix (
en-us)
Reviewed Changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/storage/storage-common/src/utils/utils.common.ts | Updated documentation URLs to remove locale prefix |
| sdk/storage/storage-common/src/policies/StorageSharedKeyCredentialPolicyV2.ts | Updated documentation URLs to remove locale prefix |
| sdk/storage/storage-common/src/policies/StorageSharedKeyCredentialPolicy.ts | Updated documentation URLs to remove locale prefix |
| sdk/storage/storage-common/src/StorageRetryPolicyFactory.ts | Updated documentation URLs to remove locale prefix |
| sdk/storage/storage-blob/test/utils/index.ts | Updated import to use StorageSharedKeyCredential from @azure/storage-common |
| sdk/storage/storage-blob/test/node/sas.spec.ts | Reorganized imports to separate storage-common types from local types |
| sdk/storage/storage-blob/test/node/pageblobclient.spec.ts | Updated imports to use StorageSharedKeyCredential from @azure/storage-common |
| sdk/storage/storage-blob/test/node/containerclient.spec.ts | Updated imports to use StorageSharedKeyCredential from @azure/storage-common |
| sdk/storage/storage-blob/test/node/blockblobclient.spec.ts | Updated imports to use StorageSharedKeyCredential and AnonymousCredential from @azure/storage-common |
| sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts | Updated imports to use StorageSharedKeyCredential from @azure/storage-common |
| sdk/storage/storage-blob/test/node/blobclient.spec.ts | Updated imports to use StorageSharedKeyCredential from @azure/storage-common |
| sdk/storage/storage-blob/test/node/appendblobclient.spec.ts | Updated imports to use StorageSharedKeyCredential from @azure/storage-common |
| sdk/storage/storage-blob/test/blobbatch.spec.ts | Updated imports to use StorageSharedKeyCredential from @azure/storage-common |
| sdk/storage/storage-blob/src/sas/BlobSASSignatureValues.ts | Updated import to use StorageSharedKeyCredential from @azure/storage-common |
| sdk/storage/storage-blob/src/sas/AccountSASSignatureValues.ts | Updated import to use StorageSharedKeyCredential from @azure/storage-common |
| sdk/storage/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2-browser.mts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/policies/StorageRetryPolicyV2.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/policies/StorageRetryPolicyType.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/policies/StorageRetryPolicy.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/policies/StorageCorrectContentLengthPolicy.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/policies/StorageCorrectContentLengthPolicy-browser.mts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/policies/StorageBrowserPolicyV2.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/policies/StorageBrowserPolicy.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/policies/RequestPolicy.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/policies/CredentialPolicy.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/policies/AnonymousCredentialPolicy.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/index.ts | Re-exported types from @azure/storage-common for backward compatibility |
| sdk/storage/storage-blob/src/index-browser.mts | Re-exported types from @azure/storage-common for backward compatibility |
| sdk/storage/storage-blob/src/credentials/StorageSharedKeyCredential.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/credentials/StorageSharedKeyCredential-browser.mts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/credentials/Credential.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/credentials/AnonymousCredential.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/StorageRetryPolicyFactory.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/StorageClient.ts | Updated imports to use credentials from @azure/storage-common |
| sdk/storage/storage-blob/src/StorageBrowserPolicyFactory.ts | Removed entire file - implementation moved to @azure/storage-common |
| sdk/storage/storage-blob/src/Pipeline.ts | Updated imports to use policies and credentials from @azure/storage-common |
| sdk/storage/storage-blob/src/ContainerClient.ts | Updated imports and minor comment formatting adjustment |
| sdk/storage/storage-blob/src/Clients.ts | Updated imports to use credentials from @azure/storage-common |
| sdk/storage/storage-blob/src/BlobServiceClient.ts | Updated imports to use credentials from @azure/storage-common |
| sdk/storage/storage-blob/src/BlobBatchClient.ts | Updated imports to use credentials from @azure/storage-common |
| sdk/storage/storage-blob/src/BlobBatch.ts | Updated imports to use credentials and policies from @azure/storage-common |
| sdk/storage/storage-blob/review/storage-blob-node.api.md | Updated API surface to show re-exports from @azure/storage-common |
| sdk/storage/storage-blob/review/storage-blob-browser.api.diff.md | Updated browser-specific API diff to reflect changes |
Comments suppressed due to low confidence (1)
sdk/storage/storage-blob/src/ContainerClient.ts:1
- The comment 'Example using
for awaitsyntax' should be placed before thefor awaitloop initialization to better reflect what it documents. Currently, it appears after the variable initialization, which may be confusing.
// Copyright (c) Microsoft Corporation.
…storage-common and update API reports
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
|
@jeremymeng , the change LGTM. I'll approve it. It may introduce API View change which will need your approval later. |
No description provided.