Skip to content

feat: [#792] Add WithRouting function#1246

Merged
hwbrzzl merged 2 commits intomasterfrom
bowen/#792
Oct 26, 2025
Merged

feat: [#792] Add WithRouting function#1246
hwbrzzl merged 2 commits intomasterfrom
bowen/#792

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Oct 26, 2025

📑 Description

Closes goravel/goravel#792

This pull request introduces a new routing registration feature to the application builder, refines the runner execution logic to respect a ShouldRun() predicate, and improves test coverage and mocks to support these changes. The most significant updates are the addition of the WithRouting method to the ApplicationBuilder interface and its implementation, as well as stricter runner filtering based on configuration and runner state.

image

✅ Checks

  • Added test cases for my code

@hwbrzzl hwbrzzl requested a review from a team as a code owner October 26, 2025 09:28
Copilot AI review requested due to automatic review settings October 26, 2025 09:28
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 a new WithRouting function to the ApplicationBuilder interface, enabling explicit route registration during application setup. It also refines the runner execution logic to skip runners when ShouldRun() returns false, preventing unnecessary execution of disabled components.

Key changes:

  • Added WithRouting method to ApplicationBuilder for route registration
  • Enhanced QueueRunner.ShouldRun() to exclude sync driver connections
  • Updated runner execution to respect ShouldRun() predicate before starting

Reviewed Changes

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

Show a summary per file
File Description
contracts/foundation/application_builder.go Adds WithRouting method signature and improves parameter naming
foundation/application_builder.go Implements WithRouting method and route registration logic
foundation/application_builder_test.go Adds test coverage for WithRouting functionality
foundation/application.go Filters runners based on ShouldRun() before execution
foundation/application_test.go Updates tests to verify ShouldRun() filtering behavior
mocks/foundation/ApplicationBuilder.go Regenerates mock with WithRouting support and improved naming
queue/runners.go Enhances ShouldRun() to check for sync driver configuration

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

}

func (r *ApplicationBuilder) Create() foundation.Application {
if len(r.configuredServiceProviders) > 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The length is judged internally.

@codecov
Copy link

codecov bot commented Oct 26, 2025

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.67%. Comparing base (3747c0f) to head (7d97401).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
queue/runners.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1246   +/-   ##
=======================================
  Coverage   67.66%   67.67%           
=======================================
  Files         250      250           
  Lines       14109    14116    +7     
=======================================
+ Hits         9547     9553    +6     
- Misses       4180     4181    +1     
  Partials      382      382           

☔ 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 e7c38a7 into master Oct 26, 2025
14 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#792 branch October 26, 2025 14:02
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 WithRouting function

2 participants