Closed Bug 1281044 Opened 10 years ago Closed 10 years ago

Remove the bugscache API endpoint

Categories

(Tree Management :: Treeherder: API, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: ShrutiJ)

References

Details

Attachments

(1 file)

Bug 1280910 is making Treeherder access the bugscache via the DB directly, rather than via the API. autophone no longer uses the bugscache API as of bug 1160188, leaving no other consumers. We should just remove it, once bug 1280910 lands. However we'll need to convert the tests in test_bugscache.py to call `.search()` directly, since they provide most of the coverage of the feature.
Assignee: emorley → nobody
Status: ASSIGNED → NEW
Hi Shruti, if you're interested in fixing this bug go ahead and take it; this is a pretty simple one that you can work on if you need a break from bug 1273513. I believe it should mostly be about removing this chunk of code (and anything that references it, the unit tests should tell you what needs to be modified by failing): https://github.com/mozilla/treeherder/blob/master/treeherder/webapp/api/refdata.py#L64 Ed can hopefully answer any other questions you might have. :)
Assignee: nobody → shrutijasoria1996
After removing bugscache API and all the references to it, the tests in test_bugscache.py started to fail. https://github.com/mozilla/treeherder/blob/master/tests/webapp/api/test_bugscache.py#L79 How are these get requests supposed to be altered as reverse() will not work anymore?
Flags: needinfo?(emorley)
I would: * Move the test file to `tests/model/test_bugscache.py` * Instead of doing a `webapp.get()`, use `Bugscache.search(search_term)` directly (see the switch made in https://github.com/mozilla/treeherder/commit/78bd30bb3b5b0e4c3a7fc40f102d809133b7b051) * Remove any leftovers in the file relating to using the API (eg the `webapp` fixture that spins up an app instance to connect to) Let me know if you have any other questions :-)
Flags: needinfo?(emorley)
ie instead of: test_bugscache.py -> /bugscache/ HTTP request -> BugscacheViewSet -> models.Bugscache.search(search_term) It's now: test_bugscache.py -> models.Bugscache.search(search_term) So the public API can be removed.
Comment on attachment 8770093 [details] [review] [treeherder] SJasoria:Bug_1281044 > mozilla:master I have made some changes. Please take a look and let me know if any change has to be made. Also can you rerun the Travis CI build? It has stopped running due to some error.
Attachment #8770093 - Flags: review?(emorley)
Attachment #8770093 - Flags: review?(emorley) → review+
Looks great - many thanks! :-)
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: