-
Notifications
You must be signed in to change notification settings - Fork 316
[Storage] Flattened Client Refactor #3176
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
base: main
Are you sure you want to change the base?
[Storage] Flattened Client Refactor #3176
Conversation
|
@vincenttran-msft is there a reason PRs with similar titles keep getting created and closed? Everything the PRs do you can do locally e.g., |
Sorry for that. I am not concerned about using these for CI pipelines or Analyze checks, these are because there have been some design decisions that we have been discussing internally on the DevEx side, and so I had both proof-of-concepts in two separate branches and we were reviewing them side by side. Having them up in draft PRs was what I thought was easiest to allow reviewers to pre-read at their leisure and also take a look separately if they weren't as concerned with what was being projected during our screenshare. I prematurely closed one of them thinking we were going with another design, but after our meeting yesterday we ended up going back in the other direction. |
|
You can reopen PRs. |
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
|
@LarryOsterman Hi Larry, any ideas on the test failures in azure_messaging_eventhubs_checkpointstore_blob? Here is the beginning of the relevant portion of the logs: The main change that would affect your codepath is that pub fn new(
endpoint: &str,
container_name: String,
credential: Arc<dyn TokenCredential>,
options: Option<BlobContainerClientOptions>,
) -> Result<Self> {to pub fn new(
endpoint: &str,
container_name: &str,
credential: Option<Arc<dyn TokenCredential>>,
options: Option<BlobContainerClientOptions>,
) -> Result<Self> {Namely:
I did go ahead and update the relevant call-sites to get everything compiling nicely, but I seem to have broke the unit tests in the process 😞 Thanks! |
…t since can't generate recording, add changelog entry
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 Azure Storage Blob clients to use a flattened client structure based on new TypeSpec definitions. The refactor changes client construction patterns to support optional credentials (enabling SAS URL and public access scenarios) and adds from_url methods for constructing clients directly from URLs.
Key changes:
- Updated all client constructors to accept optional credentials instead of required credentials
- Changed string parameters to string references for container and blob names
- Added
from_urlfactory methods to all client types for URL-based construction - Replaced manual URL construction with
blob_client.url()accessor throughout tests
Reviewed Changes
Copilot reviewed 28 out of 38 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/storage/azure_storage_blob/src/clients/*.rs | Refactored all client types to support optional credentials and URL-based construction |
| sdk/storage/azure_storage_blob/tests/*.rs | Updated test code to use reference parameters and .url() accessor |
| sdk/storage/azure_storage_blob_test/src/lib.rs | Updated test helper functions for new client constructor signatures |
| sdk/eventhubs/azure_messaging_eventhubs_checkpointstore_blob/* | Updated Event Hubs checkpoint store to use new BlobContainerClient API |
| eng/emitter-package.json | Updated TypeSpec tooling dependencies to newer versions |
Files not reviewed (1)
- eng/emitter-package-lock.json: Language not supported
sdk/storage/azure_storage_blob/src/clients/block_blob_client.rs
Outdated
Show resolved
Hide resolved
sdk/storage/azure_storage_blob/src/clients/block_blob_client.rs
Outdated
Show resolved
Hide resolved
sdk/storage/azure_storage_blob/src/clients/append_blob_client.rs
Outdated
Show resolved
Hide resolved
sdk/storage/azure_storage_blob/src/clients/blob_service_client.rs
Outdated
Show resolved
Hide resolved
sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs
Outdated
Show resolved
Hide resolved
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.
I've not done a full review because I think my one comment is going to cause enough churn already. As is, this is not what we previously discussed.
sdk/eventhubs/azure_messaging_eventhubs_checkpointstore_blob/examples/checkpoint_store_basic.rs
Show resolved
Hide resolved
sdk/storage/azure_storage_blob/src/clients/append_blob_client.rs
Outdated
Show resolved
Hide resolved
sdk/storage/azure_storage_blob/src/clients/blob_service_client.rs
Outdated
Show resolved
Hide resolved
sdk/storage/azure_storage_blob/src/clients/block_blob_client.rs
Outdated
Show resolved
Hide resolved
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.
Much better, but we shouldn't panic at runtime when we can avoid it.
sdk/storage/azure_storage_blob/src/clients/append_blob_client.rs
Outdated
Show resolved
Hide resolved
…tion to encoding_edge_cases
sdk/storage/azure_storage_blob/src/clients/append_blob_client.rs
Outdated
Show resolved
Hide resolved
sdk/storage/azure_storage_blob/src/clients/blob_service_client.rs
Outdated
Show resolved
Hide resolved
sdk/storage/azure_storage_blob/src/clients/blob_service_client.rs
Outdated
Show resolved
Hide resolved
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.
Apart from my one overarching comment about idiomacy, the rest of the changes look great!
.tsp: Azure/azure-rest-api-specs#37830from_urlmethods to support client construction directly from URLs, as well as specifically URLs already containing SAS parameters i.e.from_blob_sas_url