Skip to content

Return custom domain first (if exists) in Spree::Store#storefront_url#2

Merged
damianlegawiec merged 1 commit into
mainfrom
fix-storefront-url-method
Apr 29, 2026
Merged

Return custom domain first (if exists) in Spree::Store#storefront_url#2
damianlegawiec merged 1 commit into
mainfrom
fix-storefront-url-method

Conversation

@KacperMekarski
Copy link
Copy Markdown
Contributor

@KacperMekarski KacperMekarski commented Apr 29, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced storefront URL handling with improved custom domain resolution. The system now prioritizes custom domain URLs when configured, providing a fallback to standard store URLs when custom domains are unavailable.
  • Tests

    • Added comprehensive test coverage verifying storefront URL behavior with and without custom domain configuration.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d2aebad3-7fe6-4956-af27-e846309a0e66

📥 Commits

Reviewing files that changed from the base of the PR and between 143d396 and 245b15b.

📒 Files selected for processing (2)
  • app/models/concerns/spree/store/multi_store_overrides.rb
  • spec/models/spree/store/multi_store_methods_spec.rb

Walkthrough

The PR adds a storefront_url method override to the Spree::Store::MultiStoreOverrides module that returns the formatted custom domain when available, otherwise delegates to the parent implementation. Corresponding RSpec tests validate the method's behavior with and without custom domains.

Changes

Cohort / File(s) Summary
Storefront URL Override
app/models/concerns/spree/store/multi_store_overrides.rb, spec/models/spree/store/multi_store_methods_spec.rb
Adds storefront_url method override that prefers formatted_custom_domain and falls back to parent implementation. Includes RSpec tests validating behavior with and without custom domains.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A fluffy method, fresh and neat,
Custom domains make it complete,
When none exist, hop back we go,
Fallback magic steals the show! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding logic to prefer custom domain in the storefront_url method. It is specific, clear, and directly related to the primary change in the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-storefront-url-method

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@github-actions
Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@damianlegawiec damianlegawiec merged commit b83a379 into main Apr 29, 2026
5 of 6 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 29, 2026
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.

2 participants