Skip to content

[Storage] Improve Storage test utilities and refactor navigation methods #2525

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

Merged

Conversation

vincenttran-msft
Copy link
Member

@vincenttran-msft vincenttran-msft commented Apr 25, 2025

This PR contains the following:

  • Improves the Storage test utilities for common cases (i.e. conditionally create a container upon instrumentation)
  • Updates the navigation methods so that the pipeline properly persists

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Apr 25, 2025
@azure-sdk
Copy link
Collaborator

azure-sdk commented Apr 25, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure_storage_blob

@vincenttran-msft vincenttran-msft changed the title [Storage] [Storage] Improve Storage test utilities and refactor navigation methods Apr 25, 2025
@vincenttran-msft vincenttran-msft marked this pull request as ready for review April 28, 2025 18:09
@Copilot Copilot AI review requested due to automatic review settings April 28, 2025 18:09
Copy link
Contributor

@Copilot Copilot AI left a 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 improves test utilities and refactors navigation methods for Azure Storage by updating helper functions and client constructions to better support asynchronous container creation and pipeline persistence.

  • Adds new utility functions (get_blob_name and get_container_name) to generate consistent names.
  • Refactors get_container_client into an async function with an optional flag to create the container.
  • Updates tests and client constructors in BlobServiceClient, BlobContainerClient, and BlobClient to align with these changes.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/storage/azure_storage_blob_test/src/lib.rs Added get_blob_name and get_container_name; refactored get_container_client to support async container creation and removed the legacy get_blob_client.
sdk/storage/azure_storage_blob/tests/blob_container_client.rs Updated usage of get_container_client to use the async API with an explicit creation flag.
sdk/storage/azure_storage_blob/tests/blob_client.rs Adjusted blob client retrieval by using container_client.blob_client with the new naming utilities and async container creation.
sdk/storage/azure_storage_blob/src/clients/blob_service_client.rs Refactored to expose internal fields and update blob_container_client construction for improved pipeline persistence.
sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs Refactored to expose internal fields and update blob_client creation via a generated client instance.
sdk/storage/azure_storage_blob/src/clients/blob_client.rs Refactored to expose internal fields representing the endpoint and client.
Files not reviewed (1)
  • sdk/storage/assets.json: Language not supported
Comments suppressed due to low confidence (1)

sdk/storage/azure_storage_blob_test/src/lib.rs:66

  • [nitpick] The function documentation could be enhanced to clearly explain the behavior of the 'create' flag, including its asynchronous container creation and any error propagation.
pub async fn get_container_client(

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure_storage_blob

@vincenttran-msft vincenttran-msft merged commit 476da31 into Azure:main Apr 29, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants