refactor: Removes the deprecated redirect endpoint#26377
refactor: Removes the deprecated redirect endpoint#26377michael-s-molina merged 4 commits intoapache:masterfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #26377 +/- ##
==========================================
- Coverage 69.57% 69.56% -0.01%
==========================================
Files 1893 1892 -1
Lines 74220 74162 -58
Branches 8263 8263
==========================================
- Hits 51635 51592 -43
+ Misses 20504 20489 -15
Partials 2081 2081
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
@michael-s-molina although the redirect endpoint is deprecated and the functionality for creating /r links no longer exists, I wonder if we should try to preserve these URLs (for some period) by:
- Migrate the records from the
urlto thekey_valuetable where theresourcecolumn isredirectand thevaluecolumn is a JSON key/value pair mappingurl.idtourl.url. These records could have an expiration of 1–2 years given the somewhat transient nature of URLs. - Keep the
/rlink endpoint which—albeit inefficiently—scans thekey_valuetable (by leveraging JSON SQL UDFs) where theresourcecolumn isredirectand thevaluecolumn contains the/rID as they key. - Remove the deprecated RESTful HTTP endpoints in a far future version.
Alternatively, if code bloat is less of a concern, we could maybe punt this PR (as is) until v6.0 (or later) given the increased likelihood that the legacy redirects would be unused.
Note both options suffer from the same achilles heel in the sense that there’s no guarantee that an institution upgrade cadence will reflect that of the release cycle, hence users may feel short changed when the redirects no longer exist.
There was a problem hiding this comment.
What does this change have to do with the redirect logic?
There was a problem hiding this comment.
Nothing. It was something I caught while running the tests. It's a flaky test given that order is not guaranteed.
If we're going to keep the |
|
I don't have a strong opinion on whether to keep the urls, but I did notice that it doesn't look like the endpoint was ever marked as deprecated. Not a blocker but something to keep in mind for future. |
@eschutho I updated the PR description with more context. Let me know if that's sufficient to resolve your concern. |
|
Nevermind, found it :) Didn't realize it was just /r/id |
d7a8417 to
4fb63fc
Compare
|
|
||
|
|
||
| def upgrade(): | ||
| module.downgrade() |
SUMMARY
As part of the 4.0 approved initiatives, this PR removes the deprecated Redirect API that supported short URLs (
/r) and theurlmetadata table used to store them that was used before the permalink feature. Users lost the ability to generate R links ~1.5 years ago which seems sufficient time to remove the endpoint. It looks like we forgot to officially deprecate the endpoint inconfig.pywhen working on 3.0 but #19078 has the following message inUPDATING.mdwhich is more relevant from a communication standpoint as opposed to the# deprecatedcomment inconfig.py:TESTING INSTRUCTIONS
CI should be sufficient for merging this PR. We'll do a complete testing of 4.0 after all approved proposals are merged.
ADDITIONAL INFORMATION