mozilla/socorro — pull request #1265 by peterbe (2013-05-31 21:51:50+00:00)
Title: bug 876051 - correleations middleware service

@rhelmer @AdrianGaudebert r?

Adrian, can you please take a look at the middleware and service related stuff. Like the docs, how I added the new service etc. And also, a quick look at correlations.py itself.

Mind you, the core of correlations.py WILL BE GONE in a near future. As soon as selena finishes the stored procedure and the query to get correlations we'll do this entirely as a runtime query and NONE of this downloading, parsing and caching stuff.

I put `correlations.py` in `socorro/external/http/` which is new. It would be a lie to put it in `socorro/external/http/` and I like that this worked.

Rob, please start with looking at the tests. As you can see I did the quite rich. (Instead of running individual unit tests of the `_parse_content()` function). There's some repeated code in there which could maybe be refactored.

Also, what this code now does is, by default, it caches the download from crash-analysis.mozilla.com to the /tmp directory. I figured the parsing of a written file only takes about 1-3 milliseconds on my laptop but the downloading is potentially very very slow and might not work sometimes when there's a hiccup on the network.

NOTE: With this API there is no more bulk. It does the lookup with all required parameters.