Page MenuHomeSoftware Heritage

client: add `visits` method to get the list of an origin visits
ClosedPublic

Authored by lewo on Mar 25 2020, 6:07 PM.

Details

Summary

A test is added to ensure the pagination and the data typing are
working as expected.

Diff Detail

Repository
rDWCLI Web client
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11592
Build 17577: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 17576: arc lint + arc unit

Event Timeline

olasd added inline comments.
swh/web/client/client.py
48

We use origin_visit in most places, so I guess this should use that name as well.

363

Should have a trailing slash.

swh/web/client/tests/gen-api-data.sh
33

If you add the trailing slash you shouldn't need to follow redirects.

lewo marked 3 inline comments as done.

@olasd I addressed all of your comments. Thanks for your review.

Build is green

Patch application report for D2881 (id=10488)

Rebasing onto 492be567e2...

Current branch diff-target is up to date.
Changes applied before test
commit 151b77349d34ead96b6667e472761b57e0454f3c
Author: Antoine Eiche <lewo@abesis.fr>
Date:   Wed Mar 25 17:52:19 2020 +0100

    client: add `visits` method to get the list of an origin visits
    
    A test is added to ensure the pagination and the data typing are
    working as expected.

See https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/3/ for more details.

zack requested changes to this revision.Apr 2 2020, 5:10 PM

LGTM, just minor docstring/comment issue, then we're good to go

thanks !

Do not forget to add yourself to the top-level CONTRIBUTORS file

swh/web/client/client.py
342

maybe "origin: the URL of a software origin"

343

just "number of visits to list", for consistency with other docstrings

swh/web/client/tests/conftest.py
23–24

this is no longer "the only URL" :-)

can you fix this comment and the one you copied this from, to simply state why each URL needs monkey patching?

This revision now requires changes to proceed.Apr 2 2020, 5:10 PM
ardumont added inline comments.
swh/web/client/client.py
351

indentation ;)

Thanks @zack @ardumont. I addressed your comments.

Build is green

Patch application report for D2881 (id=10500)

Rebasing onto 492be567e2...

Current branch diff-target is up to date.
Changes applied before test
commit 8d47566785824aa219ddb44e51e7b364b2fca54c
Author: Antoine Eiche <lewo@abesis.fr>
Date:   Wed Mar 25 17:52:19 2020 +0100

    client: add `visits` method to get the list of an origin visits
    
    A test is added to ensure the pagination and the data typing are
    working as expected.

See https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/4/ for more details.

fine for me and thanks ;)

This revision is now accepted and ready to land.Apr 14 2020, 11:40 AM

Build is green

Patch application report for D2881 (id=10731)

Rebasing onto e5ef2a0dc3...

Current branch diff-target is up to date.
Changes applied before test
commit 7622c584ea6c9aeaaba38264b19145258ce7b78f
Author: Antoine Eiche <lewo@abesis.fr>
Date:   Wed Mar 25 17:52:19 2020 +0100

    client: add `visits` method to get the list of an origin visits
    
    A test is added to ensure the pagination and the data typing are
    working as expected.

See https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/7/ for more details.

Build is green

Patch application report for D2881 (id=10996)

Rebasing onto 3a493dbf55...

Current branch diff-target is up to date.
Changes applied before test
commit 6bb36697bea8288c9d84a77c4e0dc0fc82bf27c6
Author: Antoine Eiche <lewo@abesis.fr>
Date:   Wed Mar 25 17:52:19 2020 +0100

    client: add `visits` method to get the list of an origin visits
    
    A test is added to ensure the pagination and the data typing are
    working as expected.

See https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/8/ for more details.