Skip to content

feat: [#447] install/uninstall Auth facade#1176

Merged
hwbrzzl merged 10 commits intomasterfrom
bowen/#447
Sep 5, 2025
Merged

feat: [#447] install/uninstall Auth facade#1176
hwbrzzl merged 10 commits intomasterfrom
bowen/#447

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Aug 26, 2025

📑 Description

Relates to goravel/goravel#447

This pull request refactors the setup and uninstall logic for the authentication package and improves the handling and testing of facade dependencies. The main changes include moving configuration stubs to a dedicated struct, updating uninstall logic to prevent removal of facades that are depended on by others, and enhancing the test suite to cover these scenarios.

image

✅ Checks

  • Added test cases for my code

Copilot AI review requested due to automatic review settings August 26, 2025 09:33
@hwbrzzl hwbrzzl requested a review from a team as a code owner August 26, 2025 09:33

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Aug 26, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 81 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.19%. Comparing base (f9cbddb) to head (9826f91).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
auth/setup/stubs.go 0.00% 30 Missing ⚠️
auth/setup/setup.go 0.00% 12 Missing ⚠️
foundation/application.go 33.33% 6 Missing ⚠️
foundation/console/package_uninstall_command.go 87.80% 1 Missing and 4 partials ⚠️
support/path/path.go 0.00% 4 Missing ⚠️
http/service_provider.go 0.00% 3 Missing ⚠️
packages/modify/modify.go 95.08% 2 Missing and 1 partial ⚠️
auth/service_provider.go 0.00% 2 Missing ⚠️
cache/service_provider.go 0.00% 1 Missing ⚠️
console/service_provider.go 0.00% 1 Missing ⚠️
... and 14 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1176      +/-   ##
==========================================
- Coverage   68.86%   68.19%   -0.68%     
==========================================
  Files         230      232       +2     
  Lines       14879    14993     +114     
==========================================
- Hits        10246    10224      -22     
- Misses       4235     4390     +155     
+ Partials      398      379      -19     

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


func main() {
// TODO: optimize this in https://github.com/goravel/goravel/issues/447
// config, err := supportfile.GetFrameworkContent("auth/setup/config/auth.go")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

GetFrameworkContent is not a good choice, it's unstable.

@hwbrzzl hwbrzzl marked this pull request as draft August 27, 2025 11:06
s.Equal("config1.go", s.app.publishGroups["public"]["config.go"])
}

func (s *ApplicationTestSuite) TestMakeArtisan() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Avoid cycle dependency.

Dependencies: collect.Unique(
binding.Facades[binding.Auth].Dependencies,
binding.Facades[binding.Gate].Dependencies,
binding.Bindings[binding.Auth].Dependencies,
Copy link
Contributor

@almas-x almas-x Sep 1, 2025

Choose a reason for hiding this comment

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

How about renaming binding.Bindings to something like binding.Builtin to avoid redundancy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

em, I think Builtin is a bit meaningless.

Copy link
Contributor

Choose a reason for hiding this comment

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

The term Builtin may seem meaningless on its own, but when combined as binding.Builtin, it clearly indicates that these are the framework’s built-in bindings. By the way binding.Bindings is also fine.

@hwbrzzl hwbrzzl marked this pull request as ready for review September 5, 2025 03:40
@hwbrzzl hwbrzzl requested a review from Copilot September 5, 2025 03:42
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 pull request implements install/uninstall functionality for the Auth facade as part of issue #447. It refactors the packages setup system to support facade-specific installation with improved dependency management and better testing coverage.

Key changes include:

  • Adds facade-specific installation/uninstallation with --facade flags
  • Refactors service providers to use binding.Bindings instead of binding.Facades
  • Introduces facade/binding conversion utilities and conditional modification logic

Reviewed Changes

Copilot reviewed 49 out of 49 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
auth/setup/setup.go Implements Auth and Gate facade installation/uninstallation logic
auth/setup/stubs.go Adds facade stub templates for Auth and Gate
packages/setup.go Adds facade and force flag parsing for setup commands
packages/modify/modify.go Adds conditional facade installation modifiers and options system
support/convert/facade.go Utility functions for converting between facade names and bindings
contracts/binding/binding.go Moves facade info from facades.go to bindings with Info struct
foundation/application.go Adds Bindings() method and FacadesPath() support

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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 f716e5a into master Sep 5, 2025
15 of 17 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#447 branch September 5, 2025 06:28
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