Page MenuHomeSoftware Heritage

storage*: origin_get_by_sha1: Type remaining existing endpoints
ClosedPublic

Authored by ardumont on Aug 4 2020, 6:02 PM.

Details

Summary

Last origin endpoint. I'll change it soon to return origin objects.
But let's type remaining as is for now.

Related to T645

Test Plan

tox

Diff Detail

Event Timeline

Build has FAILED

Patch application report for D3698 (id=13029)

Could not rebase; Attempt merge onto a5232b7a7b...

Updating a5232b7a..8d740295
Fast-forward
 swh/storage/cassandra/storage.py |  2 +-
 swh/storage/in_memory.py         |  9 ++++++---
 swh/storage/interface.py         | 14 +++++++-------
 swh/storage/storage.py           |  6 ++++--
 4 files changed, 18 insertions(+), 13 deletions(-)
Changes applied before test
commit 8d7402954e16a8b1e2a3b3f8b6bd0547ba3995e6
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Aug 4 17:59:46 2020 +0200

    storage*: origin_get_by_sha1: Type remaining existing endpoints
    
    Related to T645

commit 26ef01563f058bdfe77fcf5d2ca6a897e2894bc8
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Aug 4 17:59:24 2020 +0200

    storage*: check_config: Type remaining existing endpoints
    
    Related to T645

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

swh/storage/in_memory.py
677

ardu: -> List !!!

swh/storage/in_memory.py
677

ah yeah, not now, it's yielding here.

Build is green

Patch application report for D3698 (id=13030)

Could not rebase; Attempt merge onto a5232b7a7b...

Updating a5232b7a..c32e224d
Fast-forward
 swh/storage/cassandra/storage.py | 12 ++++++------
 swh/storage/in_memory.py         |  9 ++++++---
 swh/storage/interface.py         | 14 +++++++-------
 swh/storage/storage.py           |  6 ++++--
 4 files changed, 23 insertions(+), 18 deletions(-)
Changes applied before test
commit c32e224d23996705a6ca969696cc4715598ed796
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Aug 4 17:59:46 2020 +0200

    storage*: origin_get_by_sha1: Type remaining existing endpoints
    
    Related to T645

commit 26ef01563f058bdfe77fcf5d2ca6a897e2894bc8
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Aug 4 17:59:24 2020 +0200

    storage*: check_config: Type remaining existing endpoints
    
    Related to T645

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

vlorentz added inline comments.
swh/storage/in_memory.py
677–678

why this change? We should move toward returning lists, so that's a step backward

swh/storage/in_memory.py
677–678

well, i'm aligning with what the production does (pg).
so we have signature that matches.

so that's a step backward

no, that's not running anywhere besides test.

I can probably change towards what you say though.
Make the pg implementation returns a list as is and change the type with a list.

swh/storage/in_memory.py
677–678

so we have signature that matches.

The signature also matches if you return a list, because lists are iterables.

To avoid too much hassle with git/arc/jenkins (this is a base root of my other changes/diff you accepted...), i'll commit this as is and improve as you suggest in another diff if you don't mind [1]

[1] D3708

This revision is now accepted and ready to land.Aug 5 2020, 10:22 AM