chore: [#822] Clean unnecessary code when installing facades#1282
chore: [#822] Clean unnecessary code when installing facades#1282
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1282 +/- ##
==========================================
+ Coverage 68.57% 68.90% +0.33%
==========================================
Files 264 264
Lines 15611 15515 -96
==========================================
- Hits 10705 10691 -14
+ Misses 4443 4363 -80
+ Partials 463 461 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR simplifies the setup and uninstall process for Goravel framework packages by removing code that directly modifies app/providers/app_service_provider.go. Instead of programmatically adding imports and registration calls to the app service provider, the setup scripts now focus solely on managing configuration files, kernel files, and facades.
Key Changes:
- Removed logic that added/removed imports and registration code in
app/providers/app_service_provider.goacross all setup scripts - Deleted the
initKernelmethod fromconsole/console/make_command.goand its associated tests - Cleaned up unused imports and variable declarations that were only needed for AppServiceProvider modifications
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| schedule/setup/setup.go | Removed schedule registration logic for AppServiceProvider; setup now only manages kernel and facade files |
| route/setup/setup.go | Removed HTTP middleware and routes registration from AppServiceProvider; setup focuses on route files and templates |
| queue/setup/setup.go | Removed queue job registration from AppServiceProvider; setup handles only queue config and facade |
| grpc/setup/setup.go | Removed gRPC interceptor and routes registration from AppServiceProvider; setup manages grpc config, kernel, and routes files |
| event/setup/setup.go | Removed event listener registration from AppServiceProvider; setup only handles event facade |
| database/setup/setup.go | Removed migration and seeder registration from AppServiceProvider; setup manages database config, kernel, and facades |
| console/console/make_command.go | Removed initKernel method that previously modified AppServiceProvider when creating new commands |
| console/console/make_command_test.go | Removed tests for the deleted initKernel method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📑 Description
Closes goravel/goravel#822
This pull request removes logic across multiple setup scripts that previously modified
app/providers/app_service_provider.goto register facades, service providers, middleware, interceptors, and other features. The changes simplify the setup and uninstall processes by eliminating direct modifications to the application service provider, focusing instead on managing configuration, kernel, and facade files. Related tests and unused imports have also been removed.The most important changes are:
Removal of AppServiceProvider Modification Logic:
database/setup/setup.go,event/setup/setup.go,grpc/setup/setup.go,queue/setup/setup.go,route/setup/setup.go) that added or removed imports and registration calls inapp/providers/app_service_provider.gofor various features (facades, service providers, middleware, interceptors, etc.). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]Code and Test Cleanup:
initKernelmethod and related registration logic fromconsole/console/make_command.go, and deleted its associated tests inconsole/console/make_command_test.go. [1] [2] [3]Refactoring Setup Logic:
These changes streamline the setup and uninstall processes, reduce coupling to the app service provider, and make the codebase easier to maintain.
✅ Checks