Page MenuHomeSoftware Heritage

Open '/revision/<sha1>/prev/<sha1list>/log/' route
ClosedPublic

Authored by jbertran on Jun 23 2016, 5:01 PM.

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jbertran retitled this revision from to Open '/revision/<sha1>/prev/<sha1list>/log/' route.
jbertran updated this object.
jbertran edited the test plan for this revision. (Show Details)
jbertran edited edge metadata.

Api: revision_log test fixes

ardumont added inline comments.
swh/web/ui/backend.py
182

I don't remember, do we absolutely need to check the length?

swh/web/ui/service.py
236 ↗(On Diff #216)

What about lookup_revisions?

255 ↗(On Diff #216)

you could use map or a generator here.

In general, personally, i avoid round-trips if i can avoid it.

258 ↗(On Diff #216)

You could also use map

map(converters.from_revisions, revisions)

or a generator ^^

(converters.from_revision(x) for x in revisions)

The superior layer does the translation before serializing anyway.

Impact: You'll need to force the lazyness in your tests for this function (by wrapping your call in a list for example).

swh/web/ui/views/api.py
705 ↗(On Diff #216)

children path

723 ↗(On Diff #216)

if not prev_sha1s:

725 ↗(On Diff #216)

you can remove the else: altogether.

jbertran added inline comments.
swh/web/ui/service.py
236 ↗(On Diff #216)

I feel it's too easy to misread lookup_revisions as lookup_revision or the other way around.

255 ↗(On Diff #216)

This creates a problem with backend call args checking, which I'm currently solving.

swh/web/ui/service.py
236 ↗(On Diff #216)

That's a good point ^^

jbertran edited edge metadata.

service: minor fixes, switch to map objects instead of lists

This revision is now accepted and ready to land.Jun 24 2016, 2:51 PM
This revision was automatically updated to reflect the committed changes.