Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused ShippingRateTaxer service object #4136

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

aldesantis
Copy link
Member

Description

The Spree::Tax::ShippingRateTaxer service object is not being used anywhere. Its original purpose was to apply taxes to estimated shipping rates, but that logic was moved into Spree::Stock::Estimator in 3639585 for performance reasons.

The only call site was removed, but the service object itself was not, and it's currently sitting unused in the codebase (I found out about it while writing the Tax calculation guide).

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

@aldesantis aldesantis requested a review from a team July 27, 2021 12:10
@aldesantis aldesantis requested a review from a team July 28, 2021 10:30
@aldesantis
Copy link
Member Author

@solidusio/core-team can I get one more review on this? 🙏

This class was originally used by `Spree::Stock::Estimator` to apply
taxes to a shipping rate, much like `Spree::Tax::OrderAdjuster` does
for orders.

The only call site was then removed in 3639585[1] with the goal of
improving the performance of shipping rate estimation, but the actual
service object was not removed, and is currently sitting unused in the
codebase.

[1]: 3639585
@aldesantis aldesantis force-pushed the remove-shipping-rate-taxer branch from 479ebb4 to 73e7470 Compare July 28, 2021 10:38
@spaghetticode
Copy link
Member

@aldesantis I understand this class has not been used for a long time in Solidus codebase, but I'm wondering should we deprecate it before removing it?

@aldesantis
Copy link
Member Author

aldesantis commented Jul 28, 2021

@spaghetticode I gave it some consideration and I'm not totally sure. I'm sure someone might be using it for some reason but... what reason exactly? The class is not used by Solidus in any way, so I guess the only situation is if someone overrode the shipping rate estimator and their custom estimator uses ShippingRateTaxer (or a custom class that inherits from it).

I think when you see it this way, the class is a public API and should be deprecated. On the other hand, it also feels weird to deprecate a class that has no call sites in Solidus.

@jarednorman
Copy link
Member

I'm also fine with removing this since it's not in use. I don't see a benefit to deprecating an orphaned class. If it breaks something for some hypothetical person who decided to build off of an interrnal class we aren't using then their test suite should catch it and they can copy the class into their codebase.

@aldesantis
Copy link
Member Author

We posted a message about this in the Solidus Slack and no one objected, so I'm merging! :shipit:

@aldesantis aldesantis merged commit 052dc22 into solidusio:master Jul 30, 2021
@aldesantis aldesantis deleted the remove-shipping-rate-taxer branch July 30, 2021 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants