From 5ed40b997c978c3af9ad86b215e7d33490b9aefb Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Thu, 2 Apr 2026 12:51:12 +0100 Subject: [PATCH 1/3] CSHARP-5943: Initial small AGENTS.md file for the C# driver See notes in DRIVERS-3428. --- AGENTS.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000000..a7f7d6feb5b --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,47 @@ +# AGENTS.md - CSharpDriver + +## Overview +The C# driver for MongoDB. + +## Tech Stack +- .NET library projects producing NuGet packages +- Multi-targeted to various .NET versions from .NET Framework 4.7.2 up +- xUnit + FluentAssertions for testing + +## Project Structure +- `src/MongoDB.Bson/` - BSON for MongoDB +- `src/MongoDB.Driver/` - C# driver for MongoDB +- `src/MongoDB.Driver.Encryption/` - Client encryption (CSFLE with KMS). +- `src/MongoDB.Driver.Authentication.AWS/` - AWS IAM authentication +- `tests/MongoDB.Driver.Tests/` - Main C# driver tests +- `tests/MongoDB.Bson.Tests/` - BSON handling tests +- `tests/*/TestHelpers` - Common test utilities +- `tests/*` - Specialized tests; less common +- `tests/MongoDB.Driver.Tests/Specifications/` are JSON-driven tests using a common runner. + +## Commands +- Build: `dotnet build CSharpDriver.sln` +- Run all tests: `dotnet test tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj -f net10.0` +- Run a single test class: `dotnet test tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj -f net10.0 --filter "FullyQualifiedName~ClassName"` + +A MongoDB connection is always available locally, so "integration" tests can be run as well as unit tests. Some test suites also require additional environment variables — if you need to run those tests and the variables are not set, stop and tell the user which variables are needed rather than working around it. + +| Feature area | Required environment variables | +|---|---| +| Atlas Search | `ATLAS_SEARCH_TESTS_ENABLED`, `ATLAS_SEARCH_URI` | +| Atlas Search index helpers | `ATLAS_SEARCH_INDEX_HELPERS_TESTS_ENABLED`, `ATLAS_SEARCH_URI` | +| CSFLE / auto-encryption | `CRYPT_SHARED_LIB_PATH` | +| CSFLE with KMS mock servers | `KMS_MOCK_SERVERS_ENABLED` | +| CSFLE with AWS KMS | `CSFLE_AWS_TEMPORARY_CREDS_ENABLED` | +| CSFLE with Azure KMS | `CSFLE_AZURE_KMS_TESTS_ENABLED` | +| CSFLE with GCP KMS | `CSFLE_GCP_KMS_TESTS_ENABLED` | +| AWS authentication | `AWS_TESTS_ENABLED` | +| GSSAPI / Kerberos | `GSSAPI_TESTS_ENABLED`, `AUTH_HOST`, `AUTH_GSSAPI` | +| OIDC authentication | `OIDC_ENV` | +| X.509 authentication | `MONGO_X509_CLIENT_CERTIFICATE_PATH`, `MONGO_X509_CLIENT_CERTIFICATE_PASSWORD` | +| PLAIN authentication | `PLAIN_AUTH_TESTS_ENABLED` | +| SOCKS5 proxy | `SOCKS5_PROXY_SERVERS_ENABLED` | + +## Commit and PR Conventions + +- Commit and PR messages start with a JIRA number: `CSHARP-1234: Description` From 8f7e9478ac7c3fa6448d609f2533a1c8722f424e Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Tue, 14 Apr 2026 15:36:03 +0100 Subject: [PATCH 2/3] Feedback --- AGENTS.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index a7f7d6feb5b..2b735cac985 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,12 +19,17 @@ The C# driver for MongoDB. - `tests/*` - Specialized tests; less common - `tests/MongoDB.Driver.Tests/Specifications/` are JSON-driven tests using a common runner. +## Editing +- Be careful to preserve file BOMs. + ## Commands - Build: `dotnet build CSharpDriver.sln` - Run all tests: `dotnet test tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj -f net10.0` - Run a single test class: `dotnet test tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj -f net10.0 --filter "FullyQualifiedName~ClassName"` -A MongoDB connection is always available locally, so "integration" tests can be run as well as unit tests. Some test suites also require additional environment variables — if you need to run those tests and the variables are not set, stop and tell the user which variables are needed rather than working around it. +## Testing +- Tests cannot be run in parallel. +- A MongoDB connection is always available locally, so "integration" tests can be run as well as unit tests. Some test suites also require additional environment variables — if you need to run those tests and the variables are not set, stop and tell the user which variables are needed rather than working around it. | Feature area | Required environment variables | |---|---| @@ -44,4 +49,5 @@ A MongoDB connection is always available locally, so "integration" tests can be ## Commit and PR Conventions -- Commit and PR messages start with a JIRA number: `CSHARP-1234: Description` +- The first commit message and the PR message start with a JIRA number: `CSHARP-1234: Description` +- The branch name will usually match the JIRA number: `CSHARP-1234` From c1e306c319475037649ce5caccc94dc10e18b8ea Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Wed, 15 Apr 2026 15:19:27 +0100 Subject: [PATCH 3/3] Add reference to AGENTS.md from CLAUDE.md --- CLAUDE.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000000..43c994c2d36 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md