Skip to content

Comments

merge: v1.16.4#1245

Merged
hwbrzzl merged 18 commits intomasterfrom
bowen/merge-v1.16.4
Oct 26, 2025
Merged

merge: v1.16.4#1245
hwbrzzl merged 18 commits intomasterfrom
bowen/merge-v1.16.4

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Oct 26, 2025

📑 Description

This pull request makes significant improvements to the Goravel console application, focusing on better help command support, improved concurrency handling, and a more robust CLI flag system. The most important changes include refactoring the console application structure, introducing a built-in help command, enhancing CLI flag handling (especially for help flags), and updating tests to cover new concurrency and help features.

Console Application Refactor and Help Command Integration:

  • Refactored the Application struct in console/application.go to manage commands, output writer, and metadata directly, replacing the previous instance field. Added a new command() method to dynamically construct the CLI command structure, improving flexibility and concurrency safety. [1] [2]
  • Added a built-in HelpCommand in console/console/help_command.go that provides a consistent way to show available commands and help information. Registered this command by default in the service provider. [1] [2]

CLI Flag Handling and Help Improvements:

  • Improved CLI flag handling in console/application.go by automatically adding a --help/-h flag to commands if not present, ensuring consistent help availability. Also, modified help invocation logic to use the new help command when no command argument is provided. [1] [2]
  • Updated the help template and output in console/cli_helper.go and related tests to reflect the new help command and flag structure, including more accurate and user-friendly help messages. [1] [2]

Concurrency and Testing Enhancements:

  • Added new concurrent test cases in console/application_test.go to verify thread safety when running multiple commands simultaneously, using atomic counters and goroutines. [1] [2]
  • Updated the test suite to cover the new help command and flag logic, ensuring correct behavior and output under various scenarios. [1] [2]

Interface and Mock Updates:

  • Extended the console.Context interface in contracts/console/command.go to expose the underlying cli.Command instance, supporting advanced help and context features. Updated mocks accordingly. [1] [2]

Other Minor Updates:

  • Bumped the framework version to v1.16.4 in support/constant.go.
  • Updated workflow configuration to use the new stable test workflow version. (.github/workflows/test_pr.yml)

These changes collectively modernize the Goravel console experience, making it more extensible, user-friendly, and robust under concurrent usage.

✅ Checks

  • Added test cases for my code

krishankumar01 and others added 17 commits July 25, 2025 19:59
…not reset when Booting (#1162)

* fix: The configuredServiceProviders, publishes and publishGroups are not reset when Booting

* optimize
…th the Model method (#1166)

* fix: [#738] The Orm Creating event can be triggered when the query with the Model method

* fix tests
* fix: [#762] handle panic when using transaction

* v1.16.2

* optimize

* fix lint
* fix: [#768] facades.DB will panic when migrating a new column

* optimize

* optimize
* fix: [#770] Add a SelectRaw function for the ORM

* fix: [#770] Add a SelectRaw function for the ORM
* fix: comand cannot be run concurrently

* fix ci

* fix ci

* optimize

* optimize

* optimize

* optimize

* optimize global options

* fix ci
@hwbrzzl hwbrzzl marked this pull request as ready for review October 26, 2025 03:44
@hwbrzzl hwbrzzl requested a review from a team as a code owner October 26, 2025 03:44
Copilot AI review requested due to automatic review settings October 26, 2025 03:44
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 bumps the framework version to v1.16.4 and introduces significant improvements to the console application architecture, focusing on better help command support, enhanced concurrency safety, and more robust CLI flag handling.

Key Changes:

  • Refactored the Application struct to eliminate the shared instance field in favor of dynamically constructing CLI commands per invocation, improving thread safety
  • Added a dedicated HelpCommand for consistent help display across the application
  • Enhanced CLI flag handling with automatic help flag injection and improved help invocation logic

Reviewed Changes

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

Show a summary per file
File Description
support/constant.go Updates framework version from v1.16.3 to v1.16.4
contracts/console/command.go Adds Instance() method to Context interface for accessing underlying cli.Command
mocks/console/Context.go Generates mock implementation for new Instance() method
console/service_provider.go Updates usage text and registers new HelpCommand
console/console/help_command.go Introduces new HelpCommand for displaying available commands
console/cli_context.go Implements Instance() method returning the underlying cli.Command
console/application.go Refactors Application to build commands dynamically and adds automatic help flag injection
console/application_test.go Adds concurrent execution tests and updates assertions for new flag count
console/cli_helper.go Simplifies help templates and removes unused global options formatting
console/cli_helper_test.go Updates tests to reflect new help command behavior and output formats

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

@codecov
Copy link

codecov bot commented Oct 26, 2025

Codecov Report

❌ Patch coverage is 68.75000% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.48%. Comparing base (6490c80) to head (ab8c9f4).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
console/console/help_command.go 0.00% 10 Missing ⚠️
console/application.go 83.67% 4 Missing and 4 partials ⚠️
console/service_provider.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1245      +/-   ##
==========================================
- Coverage   67.50%   67.48%   -0.02%     
==========================================
  Files         248      249       +1     
  Lines       14023    14063      +40     
==========================================
+ Hits         9466     9491      +25     
- Misses       4179     4191      +12     
- Partials      378      381       +3     

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

@hwbrzzl hwbrzzl merged commit c1347c3 into master Oct 26, 2025
14 checks passed
@hwbrzzl hwbrzzl deleted the bowen/merge-v1.16.4 branch October 26, 2025 04:38
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