Skip to content

chore: [#822] Clean unnecessary code when installing facades#1282

Merged
hwbrzzl merged 1 commit intomasterfrom
bowen/#822
Dec 4, 2025
Merged

chore: [#822] Clean unnecessary code when installing facades#1282
hwbrzzl merged 1 commit intomasterfrom
bowen/#822

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Dec 4, 2025

📑 Description

Closes goravel/goravel#822

This pull request removes logic across multiple setup scripts that previously modified app/providers/app_service_provider.go to 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:

  • Deleted code in setup scripts (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 in app/providers/app_service_provider.go for 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:

  • Removed the initKernel method and related registration logic from console/console/make_command.go, and deleted its associated tests in console/console/make_command_test.go. [1] [2] [3]
  • Removed unused imports from several setup and test files. [1] [2] [3] [4] [5] [6]

Refactoring Setup Logic:

  • The setup scripts now focus on creating, overwriting, or removing kernel, facade, and configuration files as needed, without modifying the app service provider directly. [1] [2] [3] [4] [5] [6]

These changes streamline the setup and uninstall processes, reduce coupling to the app service provider, and make the codebase easier to maintain.

✅ Checks

  • Added test cases for my code

Copilot AI review requested due to automatic review settings December 4, 2025 09:10
@hwbrzzl hwbrzzl requested a review from a team as a code owner December 4, 2025 09:10
@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.90%. Comparing base (f59638f) to head (a9d37c5).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.go across all setup scripts
  • Deleted the initKernel method from console/console/make_command.go and 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.

@hwbrzzl hwbrzzl merged commit 4dcf6db into master Dec 4, 2025
20 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#822 branch December 4, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean unnecessary code when installing facades

2 participants