On 04/20/2012 06:53 PM, Zygmunt Krynicki wrote:
W dniu 21.04.2012 01:10, Andy Doan pisze:
I was trying to get my local LAVA instance to work with our lab's data
base dump. So I had the DB, but not all the media files. LAVA almost
works when you do this, but I hit two small issues that prevented me
from looking at bundle streams and it their test runs.

I realize this is an edge case, but its handy for when you want to test
with a real database, but don't want all the media files. I'm not sure
this is the exact way we want to fix this, so rather than do a merge
proposal I thought I'd get your thoughts on the patch first.

There were two main issues in the code:

bundle_detail wants to get the "document format" for the media file
associated with the bundle. Since the file didn't exist we hit an
exception. I added a small check to the get_document_format to handle
this by returning "n/a".

bundle_detail and test_run_detail wanted to display the size of media
files. This calls a new function content_size which will catch an error
if the file doesn't exist and simply return 0.

I'm not sure if this patch is doing to good a job of hiding the fact an
error does exist. Maybe we should put a conditional in the template file
to display an error when the file doesn't exist also?

Are we going to review patches on the mailing list? I don't think our
current tools are up to the task.

I don't think so. I was trying to convey in the subject of the email that this was an RFC and I didn't think the code itself was worthy of a merge proposal.


As for your patches, I like the intent, though the motivation is
somewhat non-production. There is something that you may want to use
that allows you to work with just the database dump and pull the media
files from production on demand. There's a django app for that.

You are correct - its completely intended for non-production. In theory I like the idea of this app you are referring to. I'd like more details on it, but note since the production isn't reachable, we still need something to fill the gap.

Document format should be in the database, a proper fix would pull it
out. Current code will also fail when the document is bonkers and just
does not parse as JSON.

k, seems like that might be a follow-on patch?

File size can also fail in the template so we should double check that
we don't call any file size filters in any of the html files. (it looks
like {something|filesize})

yep - I should have grep'd through the code to check all the other places it went wrong. I was just concerned at the time with what was breaking me.

so - now that I have some feedback, I can try to put together a proper patch set and make a merge proposal

Thanks
ZK


_______________________________________________
linaro-validation mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/linaro-validation

Reply via email to