Page MenuHomeSoftware Heritage

Search page drag & drop
AbandonedPublic

Authored by jbertran on Apr 19 2016, 5:10 PM.

Details

Reviewers
olasd
zack
Group Reviewers
Developers
Summary

Updated search page to support drag&drop and client-side file hashing (sha1 only)
Updated static folder to contain js, css and lib categories
Updated service and backend to provide batch lookup for sha1 lists.
Updated relevant files for inclusion of CryptoJS library.

Test Plan

Updated relevant tests to reflect changes.
Tests requiring POST data currently do not pass, to be continued.

Diff Detail

Repository
rDWAPPS Web applications
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 34
Build 42: Software Heritage Python tests
Build 41: arc lint + arc unit

Event Timeline

jbertran retitled this revision from to test.
jbertran updated this object.
jbertran edited the test plan for this revision. (Show Details)
olasd added a reviewer: olasd.
olasd added a subscriber: olasd.

Nice work!

This revision is now accepted and ready to land.Apr 19 2016, 5:23 PM
jbertran edited edge metadata.
  • Updated search page to: * support drag&dropping files to search them. * calculate hash client-side
zack requested changes to this revision.Apr 27 2016, 4:47 PM
zack added a reviewer: zack.
zack added a subscriber: zack.

closing, as @jbertran should be submitted as a new diff (not called "test" :-))

This revision now requires changes to proceed.Apr 27 2016, 4:47 PM
zack removed a reviewer: zack.
zack removed a subscriber: zack.
jbertran edited edge metadata.
This comment was removed by jbertran.
jbertran retitled this revision from test to Search page drag & drop.Apr 27 2016, 5:50 PM
jbertran updated this object.
jbertran edited the test plan for this revision. (Show Details)
jbertran removed a reviewer: zack.

The overall diff looks good, thanks for a great first feature. My comments above are mostly nits, but please go through them and address them accordingly.

On the other hand, the git commit history doesn't look good :) We really would like to have separate logic commits, while here we have only 3 that mix together unrelated stuff. Please rewrite your history to fix that.
Some other suggestions about the commits:

  • please separate each commit in a short description (72 chars max), an empty line, and a longer description (if needed), pretty much as you would do in an email
  • commits that add blurb, such as the jquery one, should be separate from everything else as otherwise they pollute the diff
  • the commit fixing a phabricator bug should have something like Closes: Txx. That will automatically close the issue in phabricator, and also nicely cross-reference the task and the commit

Sorry for being a pain :-), next iteration will be much more swifter!

(Note: I haven't yet actually tested the code, but will do so.)

debian/control
13

white space issue here, libjs-cryptojs is not aligned

resources/test/webapp.ini
3

please revert this change, our internal as-deployed URLs shouldn't be used in tests

swh/web/ui/service.py
13

We should look for all hashes at once, rather than one-by-one, as we discussed.
So is this code dead and not used? If so, just remove it. If not, we should find a way to lookup all hashes at once instead.

swh/web/ui/static/css/style.css
28

remove this line, maybe?

31

nitpick: please expand "nfound" to "not-found", it's annoying to have some parts of names fully expanded and some not :)

swh/web/ui/static/js/filedrop.js
5

lots of whitespace issues in this snippet, please "M-x untabify" it

135

Please add a comment about why this conversion is needed and what it does.
Otherwise I'm sure we'll forget :)

Also: this is here because, in the end, the same conversion function is not actually part of cryptoJs, right?

swh/web/ui/templates/layout.html
6

I'm curious: why is this change needed?

swh/web/ui/templates/upload_and_search.html
32–33

as we are not sure whether we are going to have a form to insert checksums by hand, I suggest rephrasing this as something like "Filesizes over 20Mb can be slow to process, so use with care".

63

s/hash/checksum/

swh/web/ui/views/api.py
8

this looks like an extra line that should go away

swh/web/ui/views/browse.py
38–39

please submit this as a task on the forge too

zack requested changes to this revision.Apr 27 2016, 6:25 PM
zack added a reviewer: zack.
This revision now requires changes to proceed.Apr 27 2016, 6:25 PM
jbertran added inline comments.
swh/web/ui/service.py
13

This does do that! :)

swh/web/ui/templates/layout.html
6

It's not, I just forgot I had changed this --'

jbertran marked 2 inline comments as done.

Abandoning due to rebasing changing the diff. Up to date diff is now D6.

zack changed the visibility from "All Users" to "Public (No Login Required)".