Skip to content

feat: [#576] Only choose once if drivers are the same when installing facades#1227

Merged
hwbrzzl merged 3 commits intomasterfrom
bowen/#576-2
Oct 16, 2025
Merged

feat: [#576] Only choose once if drivers are the same when installing facades#1227
hwbrzzl merged 3 commits intomasterfrom
bowen/#576-2

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Oct 15, 2025

📑 Description

Relate goravel/goravel#576

This pull request refactors the PackageInstallCommand to prevent duplicate driver installations when multiple facades share the same set of drivers. The changes improve type safety by consistently using the fully qualified contractsbinding package and add a new test to verify the correct behavior. The most important changes are:

Driver installation logic improvements:

  • Added a choosenDrivers field to PackageInstallCommand to track which driver sets have already been installed, and updated the installDriver method 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:

  • Updated all references to the binding package to use the fully qualified contractsbinding import, improving clarity and type safety throughout package_install_command.go. [1] [2] [3] [4] [5]

Testing enhancements:

  • Added a new test, Test_installFacade_TwoFacadesHaveTheSameDrivers_ShouldOnlyInstallOnce, to ensure that when two facades share the same drivers, the driver installation is performed only once.

✅ Checks

  • Added test cases for my code

@hwbrzzl hwbrzzl requested a review from a team as a code owner October 15, 2025 11:16
Copilot AI review requested due to automatic review settings October 15, 2025 11:16
@hwbrzzl hwbrzzl changed the title Bowen/#576 2 feat: [#576] Only choose once if drivers are the same when installing facades Oct 15, 2025
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

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
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.95%. Comparing base (2cd1634) to head (46a531f).
⚠️ Report is 4 commits behind head on master.

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.
📢 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.

almas-x
almas-x previously approved these changes Oct 15, 2025
Copy link
Contributor

@almas-x almas-x left a comment

Choose a reason for hiding this comment

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

LGTM👍

@hwbrzzl hwbrzzl merged commit a136858 into master Oct 16, 2025
13 of 14 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#576-2 branch October 16, 2025 09:42
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.

3 participants