Skip to content

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Jun 4, 2025

Summary

This removes some of the uses of Rails.logger in rake tasks and generators and either allows the logger to be passed in as dependency injection, or - in a generator - uses Thor's say instead.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@mamhoff mamhoff requested a review from a team as a code owner June 4, 2025 10:08
@github-actions github-actions bot added changelog:solidus_core Changes to the solidus_core gem changelog:solidus_promotions Changes to the solidus_promotions gem labels Jun 4, 2025
@mamhoff mamhoff force-pushed the use-dedicated-logger-in-rake-tasks branch from 6309e2b to 6e4ae91 Compare June 4, 2025 11:13
Copy link

codecov bot commented Jun 4, 2025

Codecov Report

Attention: Patch coverage is 38.46154% with 8 lines in your changes missing coverage. Please review.

Project coverage is 88.97%. Comparing base (bbca5cc) to head (f15b78c).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
core/lib/spree/testing_support/common_rake.rb 0.00% 6 Missing ⚠️
...rs/solidus_promotions/install/install_generator.rb 0.00% 1 Missing ⚠️
...tions/lib/solidus_promotions/promotion_migrator.rb 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6272      +/-   ##
==========================================
+ Coverage   86.65%   88.97%   +2.31%     
==========================================
  Files         521      862     +341     
  Lines       11943    18424    +6481     
==========================================
+ Hits        10349    16392    +6043     
- Misses       1594     2032     +438     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tvdeyen tvdeyen added this to the 4.6 milestone Jun 4, 2025
@tvdeyen tvdeyen force-pushed the use-dedicated-logger-in-rake-tasks branch from 6e4ae91 to f9b1d52 Compare June 20, 2025 08:24
@mamhoff mamhoff force-pushed the use-dedicated-logger-in-rake-tasks branch 2 times, most recently from 37bfd92 to f078ca5 Compare June 26, 2025 11:17
mamhoff added 3 commits July 2, 2025 10:44
Rather than assuming Rails.logger exists, let's allow passing it in as a
dependency and fall back on `Logger.new($stdout)`.
We need to output, let's use what's within the class.
Let's remove this implicit dependency.
@mamhoff mamhoff force-pushed the use-dedicated-logger-in-rake-tasks branch from f078ca5 to f15b78c Compare July 2, 2025 08:44
@tvdeyen tvdeyen enabled auto-merge July 2, 2025 08:54
@tvdeyen tvdeyen merged commit 5810ef4 into solidusio:main Jul 2, 2025
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_core Changes to the solidus_core gem changelog:solidus_promotions Changes to the solidus_promotions gem
Projects
Development

Successfully merging this pull request may close these issues.

2 participants