[Storage] get_account_info all clients, set/get_tags for BlobClient, set_properties for BlobServiceClient#2795
Conversation
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
There was a problem hiding this comment.
Pull Request Overview
This PR adds new functionality to the Azure Storage Blob client library, implementing get_account_info for all clients, set/get_tags and start_copy_from_url for BlobClient, and set_properties for BlobServiceClient. These additions align with the Azure REST API specifications and provide essential blob management capabilities.
- Adds account information retrieval across all client types (BlobClient, BlobContainerClient, BlobServiceClient)
- Implements blob tagging functionality with set/get operations for BlobClient
- Adds blob copy functionality and service properties management
Reviewed Changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
sdk/storage/azure_storage_blob_test/src/lib.rs |
Adds utility function for comparing blob tags in tests |
sdk/storage/azure_storage_blob/src/parsers.rs |
Implements blob tags serialization helper function |
sdk/storage/azure_storage_blob/src/models/mod.rs |
Exports new model types for account info, tags, and copy operations |
sdk/storage/azure_storage_blob/src/clients/blob_service_client.rs |
Adds set_properties and get_account_info methods |
sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs |
Adds get_account_info method |
sdk/storage/azure_storage_blob/src/clients/blob_client.rs |
Adds start_copy_from_url, set_tags, get_tags, and get_account_info methods |
sdk/storage/azure_storage_blob/tests/ |
Comprehensive test coverage for all new functionality |
Comments suppressed due to low confidence (3)
sdk/storage/azure_storage_blob_test/src/lib.rs:124
- [nitpick] The function name
test_blob_tag_equalitydoesn't follow the naming convention for utility functions. Consider renaming tocompare_blob_tagsorblob_tags_equalsince it's not a test function itself but a helper for tests.
pub fn test_blob_tag_equality(tags1: BlobTags, tags2: BlobTags) -> bool {
sdk/storage/azure_storage_blob_test/src/lib.rs:125
- The variable name
count_mapis misleading since it stores key-value pairs from tags, not counts. Consider renaming totag_maporfirst_tags_mapto better reflect its purpose.
let mut count_map = HashMap::new();
sdk/storage/azure_storage_blob/src/parsers.rs:50
- Variable names
kandvare too short and unclear. Consider using more descriptive names likekeyandvalueto improve readability.
for (k, v) in tags.into_iter() {
get_account_info all clients, set/get_tags and start_copy_from_url for BlobClient, set_properties for BlobServiceClientget_account_info all clients, set/get_tags for BlobClient, set_properties for BlobServiceClient
|
Also, I believe I'm stumbling upon a pretty fun issue 😄 <Tags>
<TagSet>
<Tag>
<Key>hello</Key>
<Value>world</Value>
</Tag>
<Tag>
<Key>ferris</Key>
<Value>crab</Value>
</Tag>
</TagSet>
</Tags>",Scenario 2: <Tags>
<TagSet>
<Tag>
<Key>ferris</Key>
<Value>crab</Value>
</Tag>
<Tag>
<Key>hello</Key>
<Value>world</Value>
</Tag>
</TagSet>
</Tags>",I am wondering if this is something we can resolve at the test proxy level (i.e. sort alphabetically before comparing) at least in areas where order shouldn't matter. |
heaths
left a comment
There was a problem hiding this comment.
Don't waste time sorting in production. Even if you need to, there are more efficient ways of doing so in production code.
heaths
left a comment
There was a problem hiding this comment.
Need to fix a lint issue, but otherwise LGTM.
.tsp: Azure/azure-rest-api-specs#36677BlobClientSetTagsResult
• ̶ ̶D̶a̶t̶e̶
BlobClientGetAccountInfoResult
• Date
• Account_kind
• Is_hns_enabled
• Sku_name
BlobContainerClientGetAccountInfoResult
• ̶ ̶D̶a̶t̶e̶
• Account_kind
• Is_hns_enabled
• Sku_name
BlobServiceClientGetAccountInfoResult
• ̶ ̶D̶a̶t̶e̶
• Account_kind
• Is_hns_enabled
• Sku_name