Skip to content

feat: [#802] Add WithPaths function#1272

Merged
hwbrzzl merged 4 commits intomasterfrom
bowen/#802
Nov 22, 2025
Merged

feat: [#802] Add WithPaths function#1272
hwbrzzl merged 4 commits intomasterfrom
bowen/#802

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Nov 21, 2025

📑 Description

Closes goravel/goravel#802

This pull request introduces a new mechanism for configuring and customizing application paths throughout the framework. It adds a Paths interface and implementation, updates the application builder to support custom path configuration, and refactors existing code to use the new path utilities. The changes also include updates to tests and internal utilities to ensure consistency and maintainability.

image

✅ Checks

  • Added test cases for my code

@hwbrzzl hwbrzzl marked this pull request as ready for review November 22, 2025 02:02
@hwbrzzl hwbrzzl requested a review from a team as a code owner November 22, 2025 02:02
Copilot AI review requested due to automatic review settings November 22, 2025 02:02
@codecov
Copy link

codecov bot commented Nov 22, 2025

Codecov Report

❌ Patch coverage is 23.52941% with 65 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.19%. Comparing base (c8dbfa0) to head (3551783).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
foundation/configuration/paths.go 0.00% 62 Missing ⚠️
support/path/internals/path.go 60.00% 2 Missing ⚠️
foundation/application.go 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1272      +/-   ##
==========================================
- Coverage   68.46%   68.19%   -0.28%     
==========================================
  Files         263      264       +1     
  Lines       15350    15425      +75     
==========================================
+ Hits        10510    10519       +9     
- Misses       4383     4449      +66     
  Partials      457      457              

☔ 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 pull request adds a new WithPaths function to allow customizable application path configuration in the Goravel framework. The PR introduces a fluent API for setting custom paths and refactors existing path-related code for better maintainability and consistency.

Key Changes:

  • Introduces a new Paths interface and implementation that allows developers to customize application paths via WithPaths in the application builder
  • Refactors the support.Paths struct by renaming App field to Bootstrap to more accurately reflect its purpose as a directory rather than a specific file path
  • Consolidates path resolution logic by adding a BootstrapApp() helper function and renaming internal path functions (AbsPathAbs, FacadesPathFacades) for consistency

Reviewed changes

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

Show a summary per file
File Description
support/variable.go Renames App field to Bootstrap in Paths struct and updates default path from full file path to directory
contracts/foundation/configuration/paths.go Defines new Paths interface with fluent API for path configuration
foundation/configuration/paths.go Implements Paths interface with methods that modify global path configuration
contracts/foundation/application_builder.go Adds WithPaths method to ApplicationBuilder interface
foundation/application_builder.go Implements WithPaths method and calls it before service provider registration in Create()
foundation/application_builder_test.go Adds tests for WithPaths functionality
support/path/internals/path.go Renames AbsPath to Abs and FacadesPath to Facades, adds new BootstrapApp() helper
support/path/internals/path_test.go Updates tests to use renamed functions
foundation/application.go Updates calls to use renamed Abs and Facades functions
packages/modify/actions.go Refactors to use new BootstrapApp() helper
packages/modify/with_slice_actions.go Refactors to use new BootstrapApp() helper
packages/modify/modify.go Updates to use renamed Facades function
packages/modify/actions_test.go Updates tests to use new path structure with proper cleanup
packages/modify/with_slice_actions_test.go Updates tests to use new path structure with proper cleanup
mocks/foundation/ApplicationBuilder.go Adds mock for WithPaths method
mocks/foundation/configuration/Paths.go Adds complete mock implementation for Paths interface

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@hwbrzzl hwbrzzl merged commit 100c50f into master Nov 22, 2025
12 of 14 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#802 branch November 22, 2025 02:16
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 WithPaths function

2 participants