feat: Code formatting cleanup and Postman test reorganization#240
Merged
feat: Code formatting cleanup and Postman test reorganization#240
Conversation
There was a problem hiding this comment.
Pull request overview
This PR performs comprehensive code quality improvements and test infrastructure enhancements, including applying consistent formatting via EditorConfig, reorganizing Postman test collections into a structured directory hierarchy, enhancing Docker configuration with dual-topic setup for both EventGrid and CloudEvents schemas, and introducing new infrastructure components for better error handling and JSON parsing.
Key Changes:
- Applied EditorConfig-based code formatting across the entire codebase (removing unnecessary braces, fixing whitespace)
- Reorganized Postman test collections from root
src/to structuredsrc/postman/directory with environment-specific configurations - Enhanced Docker setup with dual-topic configuration supporting both EventGrid Schema (port 60101) and CloudEvents v1.0 Schema (port 60102)
Reviewed changes
Copilot reviewed 78 out of 168 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/postman/environments/*.json |
New structured Postman environment files for both simulator and real Azure testing |
src/postman-test-patterns.md |
Comprehensive test patterns documentation for Azure Event Grid conformance testing |
src/environments/*.json |
Removed legacy Postman environment files |
src/Directory.Packages.props |
Added new package dependencies for configuration and CLI tooling |
src/appsettings.json |
Updated with dual-topic configuration and explicit input schemas |
src/AzureEventGridSimulator/Program.cs |
Applied code formatting cleanup (brace removal per EditorConfig) |
Multiple Infrastructure/Settings/*.cs |
Consistent brace removal and formatting across settings classes |
src/AzureEventGridSimulator/Infrastructure/Middleware/*.cs |
Enhanced error handling, SAS validation, and Azure-compliant behavior |
src/AzureEventGridSimulator/Infrastructure/JsonConverters/*.cs |
New JSON converter infrastructure for lenient type coercion |
src/AzureEventGridSimulator/Domain/Entities/*.cs |
Updated validation logic to match Azure's lenient behavior |
src/AzureEventGridSimulator/Domain/Services/*.cs |
Enhanced parsers and formatters with improved error messages |
| Test files | Updated test assertions to match new Azure-compliant behavior |
src/.editorconfig |
New EditorConfig file defining project code style rules |
docker/* |
Docker configuration updates for dual-topic setup |
Comments suppressed due to low confidence (1)
src/postman-test-patterns.md:1
- Line 221 shows 'Unauthorized' with 'InvalidSas' detail code returning 401, but earlier in the document (line 219), it states that 'BadRequest' with 'InvalidSas' returns 400. This appears inconsistent. Clarify which status code is returned for InvalidSas scenarios or document the conditions that determine whether it's a 400 vs 401 response.
# Postman Test Patterns for Azure Event Grid Conformance
src/postman/environments/Event Grid - Sim - EventGrid Schema.postman_environment.json
Outdated
Show resolved
Hide resolved
src/postman/environments/Event Grid - Sim - EventGrid Schema.postman_environment.json
Outdated
Show resolved
Hide resolved
src/AzureEventGridSimulator/Infrastructure/ValidationIpAddressProvider.cs
Show resolved
Hide resolved
src/AzureEventGridSimulator/Infrastructure/Extensions/HttpContextExtensions.cs
Outdated
Show resolved
Hide resolved
src/AzureEventGridSimulator/Domain/Services/Dashboard/EventHistoryStore.cs
Outdated
Show resolved
Hide resolved
2d9adaf to
d4c6b6b
Compare
src/postman/environments/Event Grid - Sim - EventGrid Schema.postman_environment.json
Outdated
Show resolved
Hide resolved
src/postman/environments/Event Grid - Sim - CloudEvents Schema.postman_environment.json
Outdated
Show resolved
Hide resolved
src/AzureEventGridSimulator/Infrastructure/Extensions/HttpContextExtensions.cs
Outdated
Show resolved
Hide resolved
b804baf to
1aafac9
Compare
1aafac9 to
82a2bec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Code Quality
.editorconfigto enforce consistent code style across the projectTesting Infrastructure
src/postman/directory structuresrc/src/postman-test-patterns.mddocumentation for test patterns.gitignoreto exclude test results and specsDocker Improvements
.editorconfigto Docker build contextappsettings.docker.json:docker-compose.ymlNew Infrastructure
TopicAuthorizationExceptionentity for authorization error handlingJsonConvertersinfrastructure directory