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 Deprecated EmailValidator #3395

Merged
merged 2 commits into from
Nov 6, 2019
Merged

Conversation

JDutil
Copy link
Contributor

@JDutil JDutil commented Oct 23, 2019

Description

The email validator was deprecated Mar 15th 2018 almost 18 months ago
as part of: 6d8fd3c

The deprecation warning was part of v2.6.0rc1, and remains to this day
in v2.10.0.beta1 I think it's time to remove it altogether. It's been
4 minor version upgrades now.

Fixes #1794

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)

@JDutil JDutil force-pushed the fixes-1794 branch 2 times, most recently from 7921aa7 to c0f3105 Compare October 23, 2019 22:35
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am 👍 but for the record not Spree::EmailValidator has been deprecated but the namespace-less EmailValidator is deprecated.

Still I think we should not validate emails in core, but within extensions like solidus_auth_devise.

@tvdeyen tvdeyen changed the title Remove Deprecated Email Validator Remove Email Validator Oct 24, 2019
@spaghetticode
Copy link
Member

While I agree it's ok to remove EmailValidator, I'm not sure about completely removing the email validator Spree::EmailValidator as well.

I think a more conservative approach may be to deprecate Spree::EmailValidator first, as somebody may be using it, and remove it with a later version of Solidus.

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor of removing the deprecation warning but I think this will cut a whole feature off and users could be currently relying on that validation.

EmailValidator is just proxying through ActiveSupport::Deprecation to print a message but we are still currently using `Spree::EmailValidator', we could remove the deprecation though.

If we want to remove the validation or move it into solidus_auth_devise I think we need a more complex plan. I think an initial good solution for this could be using a preference like Spree::Config.email_validation_class providing a simple solution as a default, but allowing users to create extensions that replace the simple implementation with something better. What do you think?

core/lib/spree/core/validators/email.rb Show resolved Hide resolved
@JDutil
Copy link
Contributor Author

JDutil commented Oct 26, 2019

@kennyadsl updated 👍

@kennyadsl
Copy link
Member

I think specs are failing due to the core/lib/spree/core/validators/email.rb → core/lib/spree/validators/email.rb rename, which should not happen. Also, can you please remove the changelog entry? It will be autogenerated using the PR title, so it's better to change it and remove the entry, thanks!

@kennyadsl kennyadsl changed the title Remove Email Validator Remove Deprecated EmailValidator Oct 28, 2019
The email validator was deprecated Mar 15th 2018 almost 18 months ago
as part of: solidusio@6d8fd3c

The deprecation warning was part of v2.6.0rc1, and remains to this day
in v2.10.0.beta1 I think it's time to remove it altogether. It's been
4 minor version upgrades now.
Rubocop warns to use `match?` instead of `=~` for performance.
@JDutil
Copy link
Contributor Author

JDutil commented Oct 28, 2019

@kennyadsl updated 👍

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @JDutil!

@kennyadsl kennyadsl merged commit 55e523c into solidusio:master Nov 6, 2019
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.

Replace E-mail Validator
4 participants