Page MenuHomeSoftware Heritage

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

Authored by ardumont on Jul 24 2020, 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
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 13951
Build 21410: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 21409: arc lint + arc unit

Event Timeline

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

swh/web/common/service.py
310

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

331

thus the conversion from_swh here and not from_origin.

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

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 added a subscriber: anlambert.
swh/web/common/service.py
310

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.

swh/web/common/service.py
337

ok, this one sounds sensible to rework ;)

swh/web/common/service.py
310

Sounds reasonable a change as well ;)

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

swh/web/common/service.py
331

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.

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