How googlecloudplatform/dotnet-docs-samples works
Project type and purpose
• This repo is a collection of C# sample applications and tests for many Google Cloud services.
• It is organized as a monorepo of independent .NET solutions (.sln), each demonstrating a different API (e.g., BigQuery, Pub/Sub, Cloud Storage), plus shared build/test infrastructure.
Top-level components
• GitHub Repository (source code host)
• CI/CD Orchestration
• Kokoro scripts under .kokoro/ and .kokoro-windows/
• buildAndRunTests.ps1, GitHub actions settings, Renovate config, Blunderbuss bot
• Common Build Files
• Directory.Build.props, BuildTools.psm1
• testutil/ library for reusable test helpers
• Service-Specific Folders
Each folder named after a Google Cloud product (e.g., bigquery/, pubsub/, storage/, …) contains:
• Sub-folders api/ or appengine/ with a solution file (.sln)
• C# sample projects (*.csproj) and corresponding Samples code
• *Tests projects containing NUnit/xUnit tests
• runTests.ps1: per-folder test harness
• README.md: usage instructions
Developer workflow
• Local Developer Machine
• Clone GitHub repo
• Open a specific .sln in Visual Studio 2017+ or VS Code
• Restore NuGet packages, build projects
• Run runTests.ps1 or use Test Explorer to execute tests
• CI Pipeline
• Commit triggers Kokoro or GitHub Actions
• Scripts iterate service folders, invoke build-local-docker.ps1 or Dockerfiles to build containers
• Run runTests.ps1 in each folder under Linux/Windows environments
• Collect and publish test results
Important patterns & principles
• Monorepo with modular solutions: each API’s samples are self-contained under its own folder.
• Separation of concerns: samples vs. tests vs. CI config vs. shared tooling.
• Convention-over-configuration: uniform structure (api/, Samples, *.Tests, runTests.ps1) across modules.
• Cross-platform CI: Windows (PowerShell) and Linux (bash) paths scripted under .kokoro and Dockerfiles.