feat: [#576] Only choose once if drivers are the same when installing facades#1227
Merged
feat: [#576] Only choose once if drivers are the same when installing facades#1227
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Refactors PackageInstallCommand to avoid duplicate driver installations when multiple facades share identical driver sets and aligns types to use contractsbinding explicitly. Adds a test ensuring shared driver sets are only installed once.
- Added tracking of previously installed driver sets (choosenDrivers) to skip redundant installs
- Replaced binding import usages with fully qualified contractsbinding
- Added a new test for duplicate driver avoidance
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| foundation/console/package_install_command.go | Introduces driver set tracking and replaces binding with contractsbinding throughout |
| foundation/console/package_install_command_test.go | Adds test ensuring drivers shared across facades install only once |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1227 +/- ##
==========================================
- Coverage 66.69% 65.95% -0.75%
==========================================
Files 237 243 +6
Lines 15918 16698 +780
==========================================
+ Hits 10617 11013 +396
- Misses 4933 5304 +371
- Partials 368 381 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
📑 Description
Relate goravel/goravel#576
This pull request refactors the
PackageInstallCommandto prevent duplicate driver installations when multiple facades share the same set of drivers. The changes improve type safety by consistently using the fully qualifiedcontractsbindingpackage and add a new test to verify the correct behavior. The most important changes are:Driver installation logic improvements:
choosenDriversfield toPackageInstallCommandto track which driver sets have already been installed, and updated theinstallDrivermethod to skip installation if the drivers have already been handled. This prevents redundant installations when multiple facades require the same drivers. [1] [2] [3]Type consistency and code cleanup:
bindingpackage to use the fully qualifiedcontractsbindingimport, improving clarity and type safety throughoutpackage_install_command.go. [1] [2] [3] [4] [5]Testing enhancements:
Test_installFacade_TwoFacadesHaveTheSameDrivers_ShouldOnlyInstallOnce, to ensure that when two facades share the same drivers, the driver installation is performed only once.✅ Checks