Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1234 +/- ##
==========================================
- Coverage 66.35% 66.35% -0.01%
==========================================
Files 245 245
Lines 16914 16933 +19
==========================================
+ Hits 11224 11236 +12
- Misses 5308 5315 +7
Partials 382 382 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: 2c95b91 | Previous: 2d07c62 | Ratio |
|---|---|---|---|
Benchmark_EncryptString |
5292 ns/op 2152 B/op 14 allocs/op |
1610 ns/op 2152 B/op 14 allocs/op |
3.29 |
Benchmark_EncryptString - ns/op |
5292 ns/op |
1610 ns/op |
3.29 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Pull Request Overview
Introduces a new WithEvents method to the ApplicationBuilder interface and implementation, enabling event listener registration during application setup. This extends the existing fluent API pattern for application configuration.
- Added
WithEventsmethod to register event listeners during application building - Updated imports and implementation to support event system integration
- Enhanced test coverage and mock support for the new functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| contracts/foundation/application.go | Adds WithEvents method signature to ApplicationBuilder interface |
| foundation/application_builder.go | Implements WithEvents method with event registration logic |
| foundation/application_builder_test.go | Updates tests to verify event listener registration functionality |
| mocks/foundation/ApplicationBuilder.go | Adds mock implementation and expectation helpers for WithEvents method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📑 Description
Closes goravel/goravel#791
This pull request introduces support for registering event listeners during application setup by adding a new
WithEventsmethod to theApplicationBuilderinterface and its implementation. The changes also update related tests and mocks to ensure correct behavior and coverage for the new functionality.Event system integration:
WithEventsmethod to theApplicationBuilderinterface, allowing event listeners to be registered during application configuration. (contracts/foundation/application.go)WithEventsmethod inApplicationBuilder, storing the event-to-listener mapping and registering them during application creation. (foundation/application_builder.go) [1] [2] [3]foundation/application_builder.go)Testing and mocks:
WithEventsmethod. (foundation/application_builder_test.go) [1] [2]WithEventsmethod in theApplicationBuildermock, including expectation helpers. (mocks/foundation/ApplicationBuilder.go) [1] [2]✅ Checks