Skip to content

Add storage-specific AGENTS.md for sdk/storage subtree#49714

Open
amnguye with Copilot wants to merge 13 commits into
mainfrom
copilot/create-agents-md-file
Open

Add storage-specific AGENTS.md for sdk/storage subtree#49714
amnguye with Copilot wants to merge 13 commits into
mainfrom
copilot/create-agents-md-file

Conversation

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Adds sdk/storage/AGENTS.md to give AI agents (Copilot Coding Agent, etc.) storage-specific context that is too narrow for the root AGENTS.md.

What's in the file

  • Module table — maps each azure-storage-* module to its Azure service
  • 4 agent rules:
    • Do not edit generated code in implementation/ or models/ paths — fix upstream in TypeSpec/OpenAPI
    • Preserve API consistency (parameter names, types, option bag names, return types) across Blob, Queue, File, and Data Lake clients
    • Prefer existing patterns (RequestRetryOptions, ParallelTransferOptions, PagedIterable/PagedFlux, Reactor async) over new abstractions
    • No magic strings — use HttpHeaderName, service-specific *Constants classes, and *ServiceVersion enums
  • Storage service semantics — per-service behavioral notes (AppendBlob overwrite safety, BlockBlob commit flow, Queue visibility timeout, File share hierarchy)
  • Build/test commands — including Azurite startup and live-test invocation

Co-authored-by: amnguye <48961492+amnguye@users.noreply.github.com>
Copilot AI changed the title [WIP] Add AGENTS.md for Azure Storage SDK guidance Add storage-specific AGENTS.md for sdk/storage subtree Jul 2, 2026
Copilot AI requested a review from amnguye July 2, 2026 23:10
@amnguye amnguye marked this pull request as ready for review July 6, 2026 20:38
Copilot AI review requested due to automatic review settings July 6, 2026 20:38
@amnguye

amnguye commented Jul 6, 2026

Copy link
Copy Markdown
Member

@browndav-msft @ibrandes @kyleknap Feel free to add any comments or new suggested sections for the AGENTS.md file

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread sdk/storage/AGENTS.md Outdated
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 ibrandes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for setting all this up! i had a couple of questions / suggestions, feel free to ping me if anything was unclear :)

Comment thread sdk/storage/AGENTS.md
Comment on lines +10 to +21
| 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) |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread sdk/storage/AGENTS.md Outdated
Comment on lines +56 to +60
- **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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread sdk/storage/AGENTS.md

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread sdk/storage/AGENTS.md
# 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be useful to point to tests-install-azurite.yml here too

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread sdk/storage/AGENTS.md
- Hierarchical directory semantics differ from blobs.

## Build and Test

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add a note here that any changes to the sync/async client surfaces require separate sync and async tests

amnguye added 6 commits July 13, 2026 13:57
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants