-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 Library type + GeoIP & iptools dependencies #2955
Conversation
From a deployment perspective, you probably want to make sure that there aren't crontab entries or something similar which are updating the GeoIP database, etc. The only dependency changes are dependencies which are no longer needed, so they can be cleaned up when convenient. |
self.set_inlibrary = True | ||
self.inlibrary = inlibrary.get_library() | ||
return self.inlibrary | ||
|
||
|
||
def get_item_status(self, ekey, iaid, collections, subjects): |
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.
@mekarpeles Is this readlinks.get_item_status()
method use anywhere in the current lending system? It looks like it should be @deprecated
or removed. I believe using subjects to determine lending status is fully deprecated, and the subjects are being cleared (see #2107) -- if this is still used, I don't think it will be giving good results.
status = 'restricted' | ||
elif not self.get_inlibrary(): | ||
elif True: # not self.get_inlibrary(): - Deprecated |
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.
I'd probably use else
here, but this whole method looks like it should be deprecated, so I'd rather get confirmation from @mekarpeles before changing anything else.
@@ -30,5 +24,4 @@ def on_new_version(self, page): | |||
def setup(): | |||
"""Installs handlers for various events. | |||
""" | |||
eventer.bind("page.edit.libraries", on_library_edit) | |||
eventer.bind("page.edit", on_page_edit) |
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.
This looks like it could be removed, along with the def on_page_edit(page)
-- I wouldn't know if this causes other problems. Is there a specific reason you left it with a pass
, or just general caution?
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.
Mainly to leave a vestige of the mechanism in place in case someone wanted to use it again. I'm OK with removing the whole thing if you think that's best.
Thanks @tfmorris , I'm still reviewing. There are more changes here that I expected, but everything you have removed looks like stuff I'm happy to see gone! I think even more of that lending code you have touched should be deprecated, but not necessarily in this PR. I think it means there is little risk of changes to those files causing problems since the lending system and has been updated, and we now have an availability API used to provide this functionality elsewhere. I'm hoping @mekarpeles can confirm and ok these changes too. The main thing I'm unsure about is the stats aspect. I don't know where those stats were going, and whether they are still being used in any way. Again, @mekarpeles will hopefully have more insight. On the whole this looks like the right approach to me, and I'd like to see it through after some due diligence and review. Thanks! Getting rid of the Library class and all those templates feels long overdue. I hope no one disagrees - @cdrini, @jdlrobson , please comment here if you have any reservations about removing these files touched by this PR. I'm definitely in favour of seeing them gone. |
sorry, just realised that @cclauss is responsible for many of these changes too, thank you! :) |
Most of this LGTM, core.lending is what drives lending and I'm seeing much in the way of dependencies here. |
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.
RSLGTM
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.
This looks good, I'm happy it avoids current lending code and is only removing stuff we want gone.
@tfmorris I was going to merge, but this has conflicts -- are you able to resolve / rebase against master?
Remove all remaining code and templates for the libraries page type as well as the inlibrary and geo_ip modules and the code that references them.
3c9d1d7
to
7dd26fd
Compare
@hornc I've rebased it against the current master. |
Thanks for your efforts in pushing this forward @tfmorris! I tested locally in my local env, and also on dev.openlibrary.org. Mainly to check that lending status and borrowing were not affected. I did not notice anything. We should keep an eye out after deploy just in case. This should unblock a number of the smaller Python 3 PRs currently in flight, @cclauss |
return LoanStats().get_active_loans_of_libraries() | ||
|
||
|
||
def on_loan_created_statsdb(loan): |
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.
:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(
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.
Context: Looks like these methods were being used to populate the Borrows graph on the homepage. The setup
method of this file hooks to to events and calls these functions. Today we learned. Mek's got a fix in progress.
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.
Thank you for a more meaningful message. The relevant issue is #3194
Closes #2896. Replaces #2866.
Technical
This removes the Library page type and all associated templates, as well as the
inlibrary
andgeo_ip
modules, along with all code the references them.Testing
Evidence
Stakeholders