Skip to content

feat: [#794] Add WithCommands function#1259

Merged
hwbrzzl merged 4 commits intomasterfrom
bowen/#794
Nov 15, 2025
Merged

feat: [#794] Add WithCommands function#1259
hwbrzzl merged 4 commits intomasterfrom
bowen/#794

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Nov 10, 2025

📑 Description

Closes goravel/goravel#794

This pull request introduces improvements to the Goravel framework's command and middleware registration system, especially for projects using bootstrap setup. It adds support for registering console commands and HTTP middleware via a new chainable API (foundation.Setup().WithCommands(...)), updates code generation logic to handle both kernel and bootstrap scenarios, and enhances test coverage and code documentation.

image

✅ Checks

  • Added test cases for my code

@hwbrzzl hwbrzzl requested a review from a team as a code owner November 10, 2025 13:23
Copilot AI review requested due to automatic review settings November 10, 2025 13:23
@hwbrzzl hwbrzzl changed the title feat: [#786] Add WithCommands function feat: [#794] Add WithCommands function Nov 10, 2025
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.05%. Comparing base (bb7a660) to head (07d6370).

Files with missing lines Patch % Lines
foundation/application_builder.go 77.77% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1259   +/-   ##
=======================================
  Coverage   68.04%   68.05%           
=======================================
  Files         261      261           
  Lines       14929    14938    +9     
=======================================
+ Hits        10159    10166    +7     
- Misses       4334     4335    +1     
- Partials      436      437    +1     

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

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 adds support for registering console commands through the ApplicationBuilder via a new WithCommands method. This allows developers to configure commands during application startup in a fluent manner, consistent with other builder methods like WithEvents and WithMiddleware.

  • Added WithCommands method to register console commands
  • Updated the ApplicationBuilder contract and implementation
  • Auto-generated mock for the new method
  • Added test coverage for the nil Artisan facade scenario

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
contracts/foundation/application_builder.go Added WithCommands method to the ApplicationBuilder interface
foundation/application_builder.go Implemented WithCommands method and command registration logic in the Create method
foundation/application_builder_test.go Added test cases for WithCommands functionality
mocks/foundation/ApplicationBuilder.go Auto-generated mock implementation for the new WithCommands method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hwbrzzl hwbrzzl marked this pull request as draft November 10, 2025 13:30
@hwbrzzl hwbrzzl marked this pull request as ready for review November 15, 2025 06:21
@hwbrzzl hwbrzzl merged commit 6918a00 into master Nov 15, 2025
11 of 12 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#794 branch November 15, 2025 07:34
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.

[SUB-786] Add WithCommands function

2 participants