Skip to content

Conversation

@Boy132
Copy link
Member

@Boy132 Boy132 commented Sep 17, 2025

Only trim / at the end of the base to make sure absolute linux paths stay correct, e.g. join_paths(base_path(), 'test').

@Boy132 Boy132 requested a review from rmartinoscar September 17, 2025 06:57
@Boy132 Boy132 self-assigned this Sep 17, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 17, 2025

📝 Walkthrough

Walkthrough

Adjusted path normalization in app/helpers.php’s join_paths to stop trimming leading slashes from the base path while still trimming trailing slashes. This changes results for absolute bases (e.g., "/foo" with "bar" now becomes "/foo/bar"). Function signature and other logic remain unchanged.

Changes

Cohort / File(s) Summary
Path Joining Helper
app/helpers.php
Modified join_paths to preserve leading slashes on the base path (trim trailing slashes only). Joining logic, segment trimming, and filtering unchanged.

Possibly related PRs

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title accurately identifies the primary change—fixing join_paths handling for absolute Linux paths—so it reflects the main changeset; however it contains minor formatting issues (a mismatched opening accent instead of a backtick and "linux" lowercased) that reduce clarity.
Description Check ✅ Passed The description plainly states the functional change (only trimming trailing slashes from the base to preserve absolute paths) and directly relates to the changes in app/helpers.php, so it is on-topic and sufficient for this lenient check.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 932809f and 7f88560.

📒 Files selected for processing (1)
  • app/helpers.php (1 hunks)
🔇 Additional comments (2)
app/helpers.php (2)

55-55: Good fix: preserve absolute base by only trimming trailing slashes.

This resolves the regression for absolute Linux bases like "/foo" when joining with child segments.


52-65: Action: confirm no callers rely on join_paths('/', ...) or single-arg trailing-slash behavior

Automated search produced no output; cannot confirm. Re-run from repo root and paste results:

# list all call sites for manual inspection
rg -n --hidden -S -C2 "join_paths\(" -g '!node_modules' -g '!vendor'

# (a) calls with base '/' literal (single- or double-quoted)
rg -nP -C2 "\\bjoin_paths\\s*\\(\\s*(['\"])\\/\\1\\s*,"

# (b) single-argument calls (heuristic)
rg -nP -C2 "\\bjoin_paths\\s*\\(\\s*[^,()]+\\s*\\)"

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Boy132 Boy132 changed the title Fix ´join_paths` for absolute linux paths Fix join_paths for absolute linux paths Sep 17, 2025
@Boy132 Boy132 merged commit ce393af into main Sep 17, 2025
25 checks passed
@Boy132 Boy132 deleted the boy132/fix-join-paths branch September 17, 2025 10:35
@github-actions github-actions bot locked and limited conversation to collaborators Sep 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants