Page MenuHomeSoftware Heritage

Update swh.storage.origin_get calls to latest api change
ClosedPublic

Authored by ardumont on Fri, Jul 24, 6:30 PM.

Details

Summary

Note that I'm not modifying anything in the swh-web right now.
I'm just making just conversion happens at the right place so everything is fine. [1]

[1] I believe that when we'll be done with typing swh-storage and that we use swh-model objects everywhere.
We can discuss with @anlambert to simplify a bit the "swh-model" used within swh-web (preceding the almost "pervasive" use of our swh.model now), same goes for the archive-data storage used here (preceding the pytest fixtures).
I recall the main swh-model divergence needed here is a way to convert to hex the hashes in bytes and also make the optional value not shown in the main output result.
Like i said, to discuss later ;)

Related to T645

Test Plan

tox

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

ardumont created this revision.Fri, Jul 24, 6:30 PM

Build has FAILED

Patch application report for D3618 (id=12725)

Rebasing onto fdd3fe73d7...

Current branch diff-target is up to date.
Changes applied before test
commit 2a44d0cc1e7a610af8914a72663ced97c8efb223
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 24 18:29:50 2020 +0200

    Update swh.storage.origin_get calls to latest api change
    
    Related to T645

Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/277/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/277/console

ardumont added inline comments.Fri, Jul 24, 6:34 PM
swh/web/common/service.py
310–312

Can't use OriginInfo here as mypy complains rightfully about the dict not being one.

333

thus the conversion from_swh here and not from_origin.

ardumont edited the test plan for this revision. (Show Details)Mon, Jul 27, 8:39 AM

Build is green

Patch application report for D3618 (id=12725)

Rebasing onto fdd3fe73d7...

Current branch diff-target is up to date.
Changes applied before test
commit 2a44d0cc1e7a610af8914a72663ced97c8efb223
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 24 18:29:50 2020 +0200

    Update swh.storage.origin_get calls to latest api change
    
    Related to T645

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

vlorentz added inline comments.
swh/web/common/service.py
310–312

Could you add a new TypedDict, then?

337

If that's not too much work, I think you should change the argument to just be the URL.

ardumont edited the summary of this revision. (Show Details)Mon, Jul 27, 10:23 AM
ardumont added a subscriber: anlambert.
ardumont added inline comments.Mon, Jul 27, 10:39 AM
swh/web/common/service.py
310–312

same as below, unsure of the impacts.
I'd like to keep those minimal right now (updated the description about my reasoning).

337

No idea of the impact.
I'll have a look.

ardumont added inline comments.Mon, Jul 27, 12:06 PM
swh/web/common/service.py
337

ok, this one sounds sensible to rework ;)

ardumont added inline comments.Mon, Jul 27, 12:14 PM
swh/web/common/service.py
310–312

Sounds reasonable a change as well ;)

ardumont updated this revision to Diff 12750.Mon, Jul 27, 12:15 PM

Adapt according to review. In the end, the changes were reasonable.

ardumont added inline comments.Mon, Jul 27, 12:17 PM
swh/web/common/service.py
333

for an older version of the diff.

Build is green

Patch application report for D3618 (id=12750)

Rebasing onto fdd3fe73d7...

Current branch diff-target is up to date.
Changes applied before test
commit 26622a3425f45606e8a0d34d472604cd075cb065
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 24 18:29:50 2020 +0200

    Update swh.storage.origin_get calls to latest api change
    
    Related to T645

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

vlorentz accepted this revision.Mon, Jul 27, 12:40 PM
This revision is now accepted and ready to land.Mon, Jul 27, 12:40 PM