-
-
Notifications
You must be signed in to change notification settings - Fork 42
Contributing
Thank you for your interest in contributing to the Azure Event Grid Simulator! This guide will help you get started with development.
- .NET 10.0 SDK or later
- A code editor (Visual Studio, VS Code, Rider, etc.)
- Git
-
Clone the repository:
git clone https://github.com/pm7y/AzureEventGridSimulator.git cd AzureEventGridSimulator -
Restore dependencies:
dotnet restore src/AzureEventGridSimulator.sln
-
Build the project:
dotnet build src/AzureEventGridSimulator.sln
-
Run the simulator:
cd src/AzureEventGridSimulator dotnet run
AzureEventGridSimulator/
├── src/
│ ├── AzureEventGridSimulator/ # Main application
│ │ ├── Controllers/ # HTTP endpoints
│ │ ├── Domain/
│ │ │ ├── Commands/ # Command handlers
│ │ │ ├── Entities/ # Domain models
│ │ │ └── Services/ # Delivery, retry, dashboard, validation
│ │ ├── Infrastructure/
│ │ │ ├── Extensions/ # Filtering logic
│ │ │ ├── Mediator/ # Custom mediator
│ │ │ ├── Middleware/ # Request processing
│ │ │ └── Settings/ # Configuration models
│ │ └── Program.cs
│ ├── AzureEventGridSimulator.Tests/ # Tests
│ │ ├── UnitTests/
│ │ ├── IntegrationTests/
│ │ └── ActualSimulatorTests/
│ ├── AzureEventGridSimulator.AppHost/ # .NET Aspire orchestration
│ └── AzureEventGridSimulator.ServiceDefaults/ # Aspire service defaults
└── wiki/ # Documentation
See the Architecture page for a detailed explanation of the codebase.
Building the solution produces two flavours of the simulator. The AppHost builds the simulator
with ASPIRE_ENABLED=true (which compiles in the ServiceDefaults OpenTelemetry wiring) into
separate bin/aspire/ and obj/aspire/ directories, while the regular build goes to the usual
bin/ and obj/. Don't be surprised by the extra aspire output folders — the split keeps the
two flavours from overwriting each other's outputs.
This project uses CSharpier for consistent code formatting. CSharpier runs automatically on every build.
dotnet tool restore
dotnet csharpier format srcFor the best experience, install the CSharpier extension for your editor:
- VS Code: CSharpier extension
- Visual Studio: CSharpier extension
- Rider: Built-in support via settings
dotnet test src/AzureEventGridSimulator.sln --filter "Category=unit"Integration tests require Docker for running dependent services:
dotnet test src/AzureEventGridSimulator.sln --filter "Category=integration"dotnet test src/AzureEventGridSimulator.slnThe project uses several GitHub Actions workflows:
| Workflow | Trigger | Purpose |
|---|---|---|
CI (ci.yml) |
Pull requests | Build and test on Windows, Ubuntu, macOS |
Release Please (release-please.yml) |
Push to master | Creates release PRs from conventional commits |
Release (release.yml) |
Release published | Builds and uploads platform binaries |
NuGet Release (nuget-release.yml) |
Release published | Publishes to NuGet.org |
Docker Release (docker-release.yml) |
Release published | Publishes to Docker Hub |
CodeQL (codeql.yml) |
Push/PR | Security analysis |
This project uses Release Please to automate releases. It works by:
- Analyzing commits - Scans conventional commit messages since the last release
- Creating a release PR - Automatically opens a PR with version bump and changelog updates
- Publishing on merge - When the release PR is merged, it creates a GitHub release and triggers deployment workflows
Commit messages must follow Conventional Commits format. This is enforced by git hooks installed on first build.
| Prefix | Purpose | Appears in Changelog |
|---|---|---|
feat: |
New feature | Yes |
fix: |
Bug fix | Yes |
perf: |
Performance improvement | Yes |
deps: |
Dependency updates | Yes |
docs: |
Documentation | No |
chore: |
Maintenance | No |
refactor: |
Code changes | No |
test: |
Tests | No |
build: |
Build system | No |
ci: |
CI configuration | No |
Examples:
feat: add Azure Storage Queue subscriber support
fix: correct retry delay calculation
docs: update configuration examples
chore: update dependencies
Release Please determines version bumps based on commit types:
-
feat:commits trigger a minor version bump (1.0.0 → 1.1.0) -
fix:commits trigger a patch version bump (1.0.0 → 1.0.1) - Breaking changes trigger a major version bump (1.0.0 → 2.0.0)
Indicating breaking changes:
Use ! after the type (recommended):
feat!: remove deprecated API endpoint
feat(api)!: change authentication method
Or use BREAKING CHANGE: in the commit footer:
feat: change authentication method
BREAKING CHANGE: API now requires OAuth tokens instead of API keys
Use descriptive branch names:
feature/add-new-subscriber-typefix/retry-calculation-bugdocs/update-configuration-guide
- Follow existing patterns in the codebase
- Use meaningful variable and method names
- Add XML documentation for public APIs
- Keep methods focused and small
-
Ensure tests pass:
dotnet test src/AzureEventGridSimulator.sln -
Format your code:
dotnet csharpier format src
-
Build without warnings:
dotnet build src/AzureEventGridSimulator.sln --warnaserror
- Provide a clear description of what the PR does
- Reference any related issues
- Include tests for new functionality
- Update documentation if needed
- Keep PRs focused - one feature or fix per PR
- Submit your PR against the
masterbranch - Wait for CI checks to pass
- Address any review feedback
- Once approved, the maintainer will merge
To add a new subscriber type:
- Create settings class in
Infrastructure/Settings/ - Implement delivery service in
Domain/Services/Delivery/ - Register in dependency injection
- Add configuration documentation
- Add tests
- Add property to appropriate settings class
- Update validation if needed
- Document in wiki Configuration page
- Add tests
When reporting bugs, please include:
-
Environment details:
- OS and version
- .NET version (
dotnet --version) - Simulator version
-
Configuration:
- Relevant
appsettings.json(redact sensitive values)
- Relevant
-
Steps to reproduce:
- Clear, numbered steps
- Expected vs actual behavior
-
Logs:
- Any error messages or stack traces
Before submitting a feature request:
- Check existing issues for duplicates
- Consider if the feature aligns with the project's goals
- Provide a clear use case
- Open a GitHub Discussion for questions
- Check Troubleshooting for common issues
- Review the Architecture documentation
- Architecture - System design and internals
- Configuration - Configuration options
- Known Limitations - Current limitations
Getting Started
Subscribers
Features
Deployment
Reference