feat: auto-register console commands and validation filters/rules when created via CLI#1014
Merged
feat: auto-register console commands and validation filters/rules when created via CLI#1014
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a feature to auto-register console commands created via make:command. Key changes include:
- Adding a new error message for console command registration failures.
- Updating the seeder to pass error objects instead of their string representations.
- Modifying MakeCommand to accept and use a command signature for stub population and command registration.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| errors/list.go | Adds a new error message to indicate command registration failure. |
| database/console/seeder_make_command.go | Updates error messaging to pass error objects directly. |
| console/console/make_command_test.go | Adds tests for the new command registration process and adjusts signature expectations. |
| console/console/make_command.go | Updates the command stub generation to include a passed signature and registers the new command. |
Comments suppressed due to low confidence (2)
console/console/make_command_test.go:65
- [nitpick] Ensure that the updated command signature 'app:goravel-clean-cache' aligns with the project's naming conventions and documentation for consistency.
assert.True(t, file.Contain("app/console/commands/Goravel/clean_cache.go", "app:goravel-clean-cache"))
console/console/make_command.go:78
- [nitpick] Verify that the provided signature via m.GetSignature() is correctly formatted and that the transformation meets the intended command registration format.
stub = strings.ReplaceAll(stub, "DummySignature", str.Of(signature).Kebab().Prepend("app:").String())
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1014 +/- ##
==========================================
+ Coverage 70.76% 70.90% +0.13%
==========================================
Files 170 170
Lines 11635 11690 +55
==========================================
+ Hits 8234 8289 +55
Misses 3048 3048
Partials 353 353 ☔ 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
Closes https://github.com/goravel/goravel/issues/
✅ Checks