Add storage-specific AGENTS.md for sdk/storage subtree#49714
Conversation
Co-authored-by: amnguye <48961492+amnguye@users.noreply.github.com>
|
@browndav-msft @ibrandes @kyleknap Feel free to add any comments or new suggested sections for the AGENTS.md file |
There was a problem hiding this comment.
Pull request overview
Adds a storage-specific sdk/storage/AGENTS.md to provide AI agents with Azure Storage SDK context and contribution constraints that are narrower than the repo-root AGENTS.md.
Changes:
- Introduces a module-to-service mapping table for
sdk/storage. - Documents storage-specific agent rules (generated code boundaries, API consistency expectations, preferred patterns, and avoiding magic strings).
- Adds storage build/test commands and references storage-local contribution guidance.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…remove duplication Co-authored-by: amnguye <48961492+amnguye@users.noreply.github.com>
ibrandes
left a comment
There was a problem hiding this comment.
thanks for setting all this up! i had a couple of questions / suggestions, feel free to ping me if anything was unclear :)
| | Module | Service | | ||
| |---|---| | ||
| | `azure-storage-blob` | Azure Blob Storage | | ||
| | `azure-storage-blob-batch` | Blob batch operations | | ||
| | `azure-storage-blob-changefeed` | Blob Change Feed | | ||
| | `azure-storage-blob-cryptography` | Client-side encryption for Blobs | | ||
| | `azure-storage-blob-nio` | `java.nio.file` provider backed by Blob Storage | | ||
| | `azure-storage-file-share` | Azure Files (SMB/REST) | | ||
| | `azure-storage-file-datalake` | Azure Data Lake Storage Gen2 | | ||
| | `azure-storage-queue` | Azure Queue Storage | | ||
| | `azure-storage-common` | Shared primitives used by all storage libraries | | ||
| | `azure-storage-internal-avro` | Internal Avro support (not public API) | |
There was a problem hiding this comment.
should we expand this list to include packages that aren't shipped, like the stress / perf packages? it may be possible for an agent to perceive this list as "incomplete" after listing directories in the overall storage package and may wander into the unlisted ones without instruction. we could also consider adding the stress / perf packages to the end of the list and adding a note that they're not shipped / out of scope.
| @@ -0,0 +1,58 @@ | |||
| # AGENTS.md — Azure Storage Blob SDK for Java | |||
There was a problem hiding this comment.
i noticed that queues didn't get an agents.md file - how do we determine what packages to add them to? would it be overkill to add them to every package?
There was a problem hiding this comment.
I left out queues because compared to the other services, Queues is pretty simple and straightforward, and doesn't receive a lot of updates and can rely on the sdk/storage/AGENTS.md file.
It wouldn't be overkill to add one for every package. I can add one for queues (and blob batch).
Though for things like NIO and cryptography, where I don't have a lot of experience on, is something I would trust yall to add in the next iteration. But seeing as those also don't get touched very often, it might be fine not to have one for those.
| - **Retry**: `RequestRetryOptions` / `RequestRetryPolicy` from `azure-storage-common` | ||
| - **Parallel transfer**: `ParallelTransferOptions` | ||
| - **Paging**: `PagedIterable` / `PagedFlux` from `azure-core` | ||
| - **Async clients**: mirror sync APIs with Reactor (`Mono`, `Flux`) | ||
| - **Client builders**: follow existing `*ClientBuilder` patterns and storage utility conventions |
There was a problem hiding this comment.
nit: we might want to consider listing any references with their fully qualified names - e.g com.azure.storage.common.policy.RequestRetryOptions to prevent agents from greping a package blindly
|
|
||
| Before assuming `src/main/java/**/models/` is generated, check the file header; many public model types are hand-written. | ||
|
|
||
| If a bug exists in generated code, the fix must be made upstream (in the TypeSpec/OpenAPI spec or the AutoRest/TypeSpec-Java emitter configuration), not in the generated file itself. |
There was a problem hiding this comment.
we should add a reference to the swagger/README.md here, and we'll make a note to edit this when the typespec implementation is released
| # Run live tests (requires Azure resources) | ||
| AZURE_TEST_MODE=LIVE mvn -f sdk/storage/azure-storage-blob/pom.xml test | ||
|
|
||
| # Start Azurite (local storage emulator) for tests |
There was a problem hiding this comment.
would be useful to point to tests-install-azurite.yml here too
There was a problem hiding this comment.
I added a line to reference tests-install-azurite.yml on line 120. Is that the right place to put that, or did you mean we should call it before "npx azurite"
| For shared storage rules (generated code, magic strings, cross-service consistency, common patterns), see [../AGENTS.md](../AGENTS.md). | ||
| For repo-wide guidance, see the [root AGENTS.md](../../../AGENTS.md). | ||
|
|
||
| ## Blob SDK Overview |
There was a problem hiding this comment.
could be useful to add a "related modules" section here with batch, changefeed, crypto, and nio, so agents know to check for downstream impact after modifying an api
|
|
||
| ## Data Lake Service Semantics | ||
|
|
||
| - Requires hierarchical namespace (HNS)-enabled accounts; this library does not support HNS-disabled accounts. |
There was a problem hiding this comment.
| - Requires hierarchical namespace (HNS)-enabled accounts; this library does not support HNS-disabled accounts. | |
| - Requires hierarchical namespace (HNS)-enabled accounts; this library is designed for and is only fully supported for HNS-enabled accounts. |
nit: soften this to avoid an agent removing a code path thinking something is dead code, since we do have some stuff regarding a few operations that work against non-hns accounts
| - `DataLakeFileClient` / `DataLakeFileAsyncClient` | ||
| - `DataLakeDirectoryClient` / `DataLakeDirectoryAsyncClient` | ||
|
|
||
| This module targets hierarchical namespace (HNS)-enabled accounts and uses the `dfs.core.windows.net` endpoint shape. |
There was a problem hiding this comment.
nit: since the sdk handles blob / dfs endpoint conversions internally, we should add a small sentence here about this dual endpoint behavior to prevent agents from simplifying things
| - `ShareClient` / `ShareAsyncClient` | ||
| - `ShareDirectoryClient` / `ShareDirectoryAsyncClient` | ||
| - `ShareFileClient` / `ShareFileAsyncClient` | ||
|
|
There was a problem hiding this comment.
we should add a short bullet about nfs / smb protocol distinctions so agents don't blend the two together and help them recognize that APIs may behave differently based on this.
| - Hierarchical directory semantics differ from blobs. | ||
|
|
||
| ## Build and Test | ||
|
|
There was a problem hiding this comment.
we should add a note here that any changes to the sync/async client surfaces require separate sync and async tests
Clarified endpoint usage for the Azure Data Lake SDK, specifying that both DFS and Blob endpoints are utilized for compatibility and performance.
Clarified support for hierarchical namespace (HNS) accounts and updated build command
Updated documentation to clarify protocol-specific behavior and modified build command.
Added related modules section to AGENTS.md to outline dependencies on azure-storage-blob.
Added guidelines for stress and performance testing of storage modules, including module-specific semantics and code generation documentation.
Clarify usage of ParallelTransferOptions for blob operations.
Co-authored-by: amnguye <48961492+amnguye@users.noreply.github.com>
Updated the Maven command to skip tests during build.
Adds
sdk/storage/AGENTS.mdto give AI agents (Copilot Coding Agent, etc.) storage-specific context that is too narrow for the rootAGENTS.md.What's in the file
azure-storage-*module to its Azure serviceimplementation/ormodels/paths — fix upstream in TypeSpec/OpenAPIRequestRetryOptions,ParallelTransferOptions,PagedIterable/PagedFlux, Reactor async) over new abstractionsHttpHeaderName, service-specific*Constantsclasses, and*ServiceVersionenums