Skip to content

Comments

feat: [#667] Registering service providers don't dependent order#54

Merged
hwbrzzl merged 1 commit intomasterfrom
bowen/#667
Jul 1, 2025
Merged

feat: [#667] Registering service providers don't dependent order#54
hwbrzzl merged 1 commit intomasterfrom
bowen/#667

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Jul 1, 2025

📑 Description

Closes goravel/goravel#667

This pull request introduces several updates to the Goravel Postgres driver, including improvements to the installation process, dependency updates, and enhancements to the ServiceProvider implementation. The most important changes are grouped below by theme.

Documentation Updates:

  • Simplified installation instructions in README.md, replacing manual setup steps with a single command (./artisan package:install) and linking to a setup file for manual installation. Testing instructions were also added.

Dependency Updates:

  • Updated github.com/goravel/framework to a newer version (v1.15.2-0.20250701070909-51b5ee2aed12) in go.mod.
  • Updated github.com/dromara/carbon/v2 to v2.6.9 in go.mod.

Code Enhancements:

  • Added binding.Relationship method to the ServiceProvider class in service_provider.go, defining bindings, dependencies, and provisions for database and ORM components.
  • Refactored ServiceProvider methods (Register and Boot) to use a consistent receiver name (r).

Import Adjustments:

  • Added an import for github.com/goravel/framework/contracts/binding in service_provider.go to support the new binding.Relationship method.

✅ Checks

  • Added test cases for my code

Copilot AI review requested due to automatic review settings July 1, 2025 09:22
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 enhances the Goravel Postgres driver by introducing a new relationship-based registration method, updating dependencies, and streamlining installation and testing instructions.

  • Add a Relationship method to ServiceProvider for defining bindings, dependencies, and provisions
  • Bump github.com/goravel/framework and github.com/dromara/carbon/v2 versions in go.mod
  • Simplify installation steps and add testing instructions in README.md

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
service_provider.go Added Relationship method, updated receiver names to r, imported binding
go.mod Updated goravel/framework to v1.15.2-0.20250701070909-51b5ee2aed12 and carbon/v2 to v2.6.9
README.md Rewrote install steps using ./artisan package:install, added a Testing section
Comments suppressed due to low confidence (2)

service_provider.go:19

  • Add unit tests to verify the Relationship method returns the correct Bindings, Dependencies, and ProvideFor values to ensure this new registration mechanism works as intended.
func (r *ServiceProvider) Relationship() binding.Relationship {

README.md:23

  • [nitpick] Revise this line to 'Run the following command to run tests:' for clarity and correct grammar.
Run command below to run test:


func (receiver *ServiceProvider) Boot(app foundation.Application) {
func (r *ServiceProvider) Boot(app foundation.Application) {

Copy link

Copilot AI Jul 1, 2025

Choose a reason for hiding this comment

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

[nitpick] The Boot method is currently empty; consider removing it if not needed or adding a comment to explain why it's intentionally left blank for clarity.

Suggested change
// The Boot method is intentionally left blank as it is not currently needed.
// It may be implemented in the future if additional bootstrapping logic is required.

Copilot uses AI. Check for mistakes.
@hwbrzzl hwbrzzl merged commit ae60e3b into master Jul 1, 2025
5 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#667 branch September 6, 2025 10:37
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.

Registering service providers don't dependent order

1 participant