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 tech_support_email and admin_support_email #443
Conversation
8f0f3ec
to
843eda7
Compare
Codecov Report
@@ Coverage Diff @@
## master #443 +/- ##
=========================================
+ Coverage 92.86% 92.9% +0.03%
=========================================
Files 2390 2391 +1
Lines 77758 77851 +93
=========================================
+ Hits 72209 72326 +117
+ Misses 5549 5525 -24
Continue to review full report at Codecov.
|
@3scale/system if we could verify whether the liquid {{ admin_support_email }} is never used in SaaS without an |
843eda7
to
999e69d
Compare
999e69d
to
48aada1
Compare
According to what we spoke, this is what we need to remove from the attributes
I also see that a useful comment in I will review more in depth now 😉 |
app/views/account_messenger/expired_credit_card_notification_for_buyer.text.liquid
Show resolved
Hide resolved
app/views/cinstance_messenger/expired_trial_period_notification.text.liquid
Show resolved
Hide resolved
@josemigallas You still need to change this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c6bbcbb
to
ac19614
Compare
3eac7f5
to
2b35493
Compare
@@ -181,7 +181,7 @@ def metrics | |||
Drops::Metric.wrap(@service.metrics.top_level) | |||
end | |||
|
|||
# TODO: remove this and remove all references, views, controllers | |||
# NOTE: keeping in case somebody already using 'admin_support_email' liquid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it should return nil and I think we should think about removing for real those deprecated tags.
@secretsurf @3scale/product @3scale/support
We need to make a plan on when and how to remove those.
My idea would be in 3 steps (3 releases)
- add a logger there to know if people are still using it. And collect data.
- Send a deprecation notice to those tenants
- Remove the feature definitively
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hallelujah @macejmic
Should we add here as well 1 for the tech_support_email?
hidden
deprecated "Use **support_email** instead."
def tech_support_email
@service.support_email
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hallelujah I would be in favour of add a logger so we can collect usage data and go from there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I guess this should be like the following example (please confirm @hallelujah ):
# NOTE: keeping in case somebody already using 'admin_support_email' liquid
hidden
deprecated "Use **support_email** instead."
def admin_support_email
Rails.logger.info "Liquid::Drops::Service#admin_support_email is being used by Service ##{@service.id}"
nil
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josemigallas No need to add the tech_support_email
here 😄 If it isn't there is because nobody is using it which is what we want 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Sorry this method do not have to change, forget about my first comment.
fc5d406
to
55ed144
Compare
55ed144
to
7bb250e
Compare
@@ -42,6 +42,24 @@ class Api::ServicesControllerTest < ActionDispatch::IntegrationTest | |||
expected_signup_and_use.each { |attr_name, attr_value| assert_equal attr_value, service.public_send(attr_name) } | |||
end | |||
|
|||
# This test can be removed once used deprecated attributes have been removed from the schema | |||
test 'deprecated attributes should not be updated' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good 👍 💪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job @josemigallas 🎉 🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the attr_readonly and good to
7bb250e
to
a7ea2f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
About https://github.com/3scale/porta/pull/443/files#r271680214, it is either what you did there or strong parameters in the controllers instead of accepting everything from the exterior:
https://github.com/3scale/porta/blob/48aada188a78eb65620aa22323e34222d9ac020e/app/controllers/admin/api/services_controller.rb#L113-L115
https://github.com/3scale/porta/blob/48aada188a78eb65620aa22323e34222d9ac020e/app/controllers/api/services_controller.rb#L37
https://github.com/3scale/porta/blob/48aada188a78eb65620aa22323e34222d9ac020e/app/controllers/api/services_controller.rb#L52
Personally I prefer the strong params option instead of the readonly
for this, but I understand that it is more risky and scary 😜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok then prepare a separate PR to remove the columns then
It would've been great to get a public release notice about this, as it broke our production APIs 👎 |
Hi @ianseyer, that's very unfortunate. We are investigating what went wrong. Would you care to explain how this change broke your production APIs? |
ping @ianseyer: to get some more specifics would be good. |
What this PR does / why we need it:
Removes unused fields from the API request and response (they are not visible in the UI and not used anywhere).
Which issue(s) this PR fixes
Closes https://issues.jboss.org/browse/THREESCALE-1615
Verification steps
tech_support_email
andadmin_support_email
:Special notes for your reviewer: