-
Notifications
You must be signed in to change notification settings - Fork 331
docs: enhance copilot-instructions with build commands and architecture #3640
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,9 +8,38 @@ You are an expert Rust programmer. You write safe, efficient, maintainable, and | |||||
|
|
||||||
| > **Note**: For comprehensive guidance on how AI agents should interact with this repository, including workflows, automation boundaries, and repository structure, see [AGENTS.md](https://github.com/Azure/azure-sdk-for-rust/blob/main/AGENTS.md). | ||||||
|
|
||||||
| ## Prerequisites | ||||||
| ## Build, Test, and Lint | ||||||
|
|
||||||
| - To use Azure SDK MCP tool calls, the user must have PowerShell installed. Provide [PowerShell installation instructions](https://learn.microsoft.com/powershell/scripting/install/installing-powershell) if not installed, and recommend restarting the IDE to start the MCP server. | ||||||
| ```bash | ||||||
| # Build a specific crate | ||||||
| cargo build -p <crate-name> | ||||||
|
|
||||||
| # Run all tests for a crate | ||||||
| cargo test -p <crate-name> | ||||||
|
|
||||||
| # Run a single test by name | ||||||
| cargo test -p <crate-name> --test <test-file> <test-name> | ||||||
|
|
||||||
| # Run clippy lints | ||||||
| cargo clippy -p <crate-name> | ||||||
|
|
||||||
| # Format code | ||||||
| cargo fmt -p <crate-name> | ||||||
|
|
||||||
| # Record integration tests (requires provisioned Azure resources) | ||||||
| AZURE_TEST_MODE=record cargo test -p <crate-name> --test <test-file> | ||||||
| ``` | ||||||
|
|
||||||
| ## Architecture | ||||||
|
|
||||||
| - **Core crates** (`sdk/core/`): Foundation libraries that all service crates depend on. | ||||||
| - `azure_core`: HTTP pipeline, credentials, error types, `Result<T>` alias. | ||||||
| - `typespec`/`typespec_client_core`: Base types for TypeSpec-generated clients. | ||||||
| - `azure_core_test`: Test utilities including `#[recorded::test]` for integration tests. | ||||||
| - **Service crates** (`sdk/<service>/<crate>/`): Azure service clients (e.g., `azure_security_keyvault_secrets`). | ||||||
| - Most contain a `generated/` subdirectory with TypeSpec-generated code — **never edit these files**. | ||||||
| - Hand-written code in `src/` adds convenience methods or customizations. | ||||||
| - **Identity crate** (`sdk/identity/azure_identity`): Authentication via `DefaultAzureCredential` and related types. | ||||||
|
|
||||||
| ## Code Generation | ||||||
|
|
||||||
|
|
@@ -50,3 +79,15 @@ Use these instructions for test generation as well. | |||||
| - The `tests` module should always import APIs from `super`. | ||||||
| - Do not begin test function names with "test" unless necessary to disambiguate from the function being tested. | ||||||
| - Test functions do not need to be public. | ||||||
|
|
||||||
| ## Integration Tests | ||||||
|
|
||||||
| - Integration tests go in a crate's `tests/` directory and use `#[recorded::test]` (from `azure_core_test`). | ||||||
| - Recorded tests replay HTTP traffic from recordings in `sdk/<service>/assets/` (referenced via `assets.json`). | ||||||
|
||||||
| - Recorded tests replay HTTP traffic from recordings in `sdk/<service>/assets/` (referenced via `assets.json`). | |
| - Recorded tests replay HTTP traffic from recordings stored in the external `Azure/azure-sdk-assets` repository, as mapped by the per-service `assets.json` file. |
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.
The reference to
DefaultAzureCredentialis incorrect for the Rust SDK. The Rust SDK usesDeveloperToolsCredentialas the primary credential for development scenarios, notDefaultAzureCredential. Update this line to referenceDeveloperToolsCredentialand other available credentials (likeManagedIdentityCredentialfor production scenarios) to accurately reflect the Rust SDK's identity crate structure.