Skip to content

docs: enhance copilot-instructions with build commands and architecture#3640

Open
j7nw4r wants to merge 1 commit intomainfrom
copilot-instructions-enhance-20260130
Open

docs: enhance copilot-instructions with build commands and architecture#3640
j7nw4r wants to merge 1 commit intomainfrom
copilot-instructions-enhance-20260130

Conversation

@j7nw4r
Copy link
Member

@j7nw4r j7nw4r commented Jan 30, 2026

Summary

Enhance .github/copilot-instructions.md\ with practical information for Copilot sessions.

Changes

  • Build, Test, and Lint: Add common cargo commands including how to run a single test and record integration tests
  • Architecture: Add overview of core crates, service crates, and identity crate hierarchy
  • Integration Tests: Document #[recorded::test]\ usage and recording workflow
  • Error Handling: Add \�zure_core::Result\ convention
  • Remove Prerequisites section about MCP servers (not universally relevant)

The file continues to reference \AGENTS.md\ for comprehensive details while providing quick-reference information useful during active coding.

Add Build, Test, and Lint section with common cargo commands including
how to run a single test and record integration tests.

Add Architecture section explaining core crates, service crates, and
the identity crate hierarchy.

Add Integration Tests section covering #[recorded::test] usage.

Add Error Handling section with azure_core::Result<T> convention.

Remove Prerequisites section about MCP servers.
Copilot AI review requested due to automatic review settings January 30, 2026 17:23
Copy link
Contributor

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 enhances the .github/copilot-instructions.md file with practical quick-reference information for developers using GitHub Copilot with the Azure SDK for Rust codebase.

Changes:

  • Added build, test, and lint commands with practical cargo examples
  • Added architecture overview describing core crates, service crates, and identity crate organization
  • Added integration testing documentation explaining #[recorded::test] usage and recording workflow
  • Added error handling conventions for service crates and examples
  • Removed the Prerequisites section about MCP servers

- **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.
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The reference to DefaultAzureCredential is incorrect for the Rust SDK. The Rust SDK uses DeveloperToolsCredential as the primary credential for development scenarios, not DefaultAzureCredential. Update this line to reference DeveloperToolsCredential and other available credentials (like ManagedIdentityCredential for production scenarios) to accurately reflect the Rust SDK's identity crate structure.

Suggested change
- **Identity crate** (`sdk/identity/azure_identity`): Authentication via `DefaultAzureCredential` and related types.
- **Identity crate** (`sdk/identity/azure_identity`): Authentication via `DeveloperToolsCredential`, `ManagedIdentityCredential`, and other identity types.

Copilot uses AI. Check for mistakes.
## 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`).
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The statement about recordings being in sdk/<service>/assets/ is inaccurate. Recordings are stored in an external repository (Azure/azure-sdk-assets) and referenced via the assets.json file. The recordings are not stored in a local assets/ subdirectory. Consider rephrasing to clarify that recordings are managed via assets.json which points to recordings in the azure-sdk-assets repository.

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

Copilot uses AI. Check for mistakes.
Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

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

This was already in AGENTS.md - or at least most of it was. VSCode uses both. Was that not working for you?

@heaths
Copy link
Member

heaths commented Jan 30, 2026

@scbedd @weshaggard what do you think about putting general "how to provision test resources" in https://github.com/Azure/azure-sdk-for-rust/tree/main/eng/common/instructions that we can link to from AGENTS.md.

@j7nw4r generally we want to keep .github/copilot-instructions.md more about code style than anything. We are talking separately internally about whether we event want both files, but some docs I had found suggested AGENTS.md for structure, commands, etc., and .github/copilot-instructions.md for style which is how I have this laid out now.

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.

2 participants