Page MenuHomeSoftware Heritage

storage*: use an enum to explicit the order in origin_visit_get
ClosedPublic

Authored by ardumont on Jul 28 2020, 1:14 PM.

Details

Diff Detail

Repository
rDSTO Storage manager
Branch
add-enum
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14044
Build 21562: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 21561: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D3629 (id=12775)

Could not rebase; Attempt merge onto 77960ca4b5...

Updating 77960ca4..0b1abbc1
Fast-forward
 swh/storage/api/serializers.py        |  47 ++++++++++++--
 swh/storage/cassandra/storage.py      |  36 ++++++++---
 swh/storage/db.py                     |  38 ++++++++++-
 swh/storage/in_memory.py              |  56 +++++++++-------
 swh/storage/interface.py              |  48 ++++++++++----
 swh/storage/storage.py                |  49 ++++++++++----
 swh/storage/tests/test_retry.py       |  11 ++--
 swh/storage/tests/test_serializers.py |  80 +++++++++++++++++++++++
 swh/storage/tests/test_storage.py     | 118 +++++++++++++++++++---------------
 9 files changed, 361 insertions(+), 122 deletions(-)
 create mode 100644 swh/storage/tests/test_serializers.py
Changes applied before test
commit 0b1abbc1aa9706f2440c9a294424f436ceb396dd
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Jul 28 13:10:05 2020 +0200

    storage*: use an enum to explicit the order in origin_visit_get
    
    Related to T645

commit 03a59bc5f10e6dfd2379add7abaeab0ee4cee48f
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 27 22:17:59 2020 +0200

    storage*: origin_visit_get(...) -> PagedResult[OriginVisit]
    
    Related to T645

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

vlorentz added inline comments.
swh/storage/interface.py
32

docstring

swh/storage/storage.py
902

could you pass the enum instance directly?

swh/storage/interface.py
32

I don't really know what to say ;)

swh/storage/storage.py
902

yes, but that means one more import in the backend(s).
I'm not sure it's worth the effort.

swh/storage/interface.py
32

in the docstring i mean.

vlorentz added inline comments.
swh/storage/interface.py
32

"""Specifies the order for paginated endpoints returning sorted results."""

This revision is now accepted and ready to land.Jul 29 2020, 9:18 AM
ardumont added inline comments.
swh/storage/storage.py
902

doing it ;)

Rebase and adapt according to review:

  • Add docstring to ListOrder
  • Push down ListOrder type to backends (cql, db)

Build is green

Patch application report for D3629 (id=12804)

Could not rebase; Attempt merge onto 77960ca4b5...

Updating 77960ca4..cf0dcf9c
Fast-forward
 mypy.ini                              |   3 +
 requirements-swh.txt                  |   2 +-
 swh/storage/api/serializers.py        |  21 ++++--
 swh/storage/cassandra/cql.py          |   9 ++-
 swh/storage/cassandra/storage.py      |  34 +++++++---
 swh/storage/db.py                     |  38 ++++++++++-
 swh/storage/in_memory.py              |  56 +++++++++-------
 swh/storage/interface.py              |  40 ++++++++----
 swh/storage/storage.py                |  49 ++++++++++----
 swh/storage/tests/test_retry.py       |  11 ++--
 swh/storage/tests/test_serializers.py |  41 ++++++++++++
 swh/storage/tests/test_storage.py     | 116 +++++++++++++++++++---------------
 12 files changed, 295 insertions(+), 125 deletions(-)
 create mode 100644 swh/storage/tests/test_serializers.py
Changes applied before test
commit cf0dcf9c3d1a009cb7fc46b5096b3b1b00049973
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Jul 28 13:10:05 2020 +0200

    storage*: use an enum to explicit the order in origin_visit_get
    
    Related to T645

commit 39ed4e85d0ffbf8fc78ce729a12b85ca5a108a47
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 27 22:17:59 2020 +0200

    storage*: origin_visit_get(...) -> PagedResult[OriginVisit]
    
    Related to T645

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

swh/storage/storage.py
902

It's worth the effort.
Thanks ;)

vlorentz added inline comments.
swh/storage/storage.py
892–894

I don't think that's needed, but no big deal

Build is green

Patch application report for D3629 (id=12808)

Could not rebase; Attempt merge onto 77960ca4b5...

Updating 77960ca4..5f690645
Fast-forward
 requirements-swh.txt                  |   2 +-
 swh/storage/api/serializers.py        |  21 ++++-
 swh/storage/cassandra/cql.py          |   9 +--
 swh/storage/cassandra/storage.py      |  37 +++++++--
 swh/storage/db.py                     |  38 ++++++++-
 swh/storage/in_memory.py              |  59 ++++++++------
 swh/storage/interface.py              |  40 +++++++---
 swh/storage/storage.py                |  52 ++++++++++---
 swh/storage/tests/test_retry.py       |  11 ++-
 swh/storage/tests/test_serializers.py |  41 ++++++++++
 swh/storage/tests/test_storage.py     | 140 +++++++++++++++++++++-------------
 11 files changed, 326 insertions(+), 124 deletions(-)
 create mode 100644 swh/storage/tests/test_serializers.py
Changes applied before test
commit 5f690645301fdf3c78b2259abad89b49134587b3
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Jul 28 13:10:05 2020 +0200

    storage*: use an enum to explicit the order in origin_visit_get
    
    Related to T645

commit c55ff7444b5f99b4e7163742d3e510c356f92d33
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 27 22:17:59 2020 +0200

    storage*: origin_visit_get(...) -> PagedResult[OriginVisit]
    
    Related to T645

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

Build is green

Patch application report for D3629 (id=12810)

Could not rebase; Attempt merge onto 77960ca4b5...

Updating 77960ca4..e1792e19
Fast-forward
 requirements-swh.txt                  |   2 +-
 swh/storage/api/serializers.py        |  21 ++++-
 swh/storage/cassandra/cql.py          |   9 +--
 swh/storage/cassandra/storage.py      |  37 +++++++--
 swh/storage/db.py                     |  38 ++++++++-
 swh/storage/in_memory.py              |  59 ++++++++------
 swh/storage/interface.py              |  40 +++++++---
 swh/storage/storage.py                |  52 ++++++++++---
 swh/storage/tests/test_retry.py       |  11 ++-
 swh/storage/tests/test_serializers.py |  41 ++++++++++
 swh/storage/tests/test_storage.py     | 140 +++++++++++++++++++++-------------
 11 files changed, 326 insertions(+), 124 deletions(-)
 create mode 100644 swh/storage/tests/test_serializers.py
Changes applied before test
commit e1792e194621c913d8178001dd5aa8f0a2c49de4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 27 22:17:59 2020 +0200

    storage*: use an enum to explicit the order in origin_visit_get
    
    Related to T645

commit fd55b818bf44f417595eb4f81aa659a6756a7510
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 27 22:17:59 2020 +0200

    storage*: origin_visit_get(...) -> PagedResult[OriginVisit]
    
    Related to T645

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

Build is green

Patch application report for D3629 (id=12813)

Could not rebase; Attempt merge onto f543bd53ee...

Updating f543bd53..21b77304
Fast-forward
 requirements-swh.txt                  |   2 +-
 swh/storage/api/serializers.py        |  21 ++++-
 swh/storage/cassandra/cql.py          |   9 +--
 swh/storage/cassandra/storage.py      |  37 +++++++--
 swh/storage/db.py                     |  38 ++++++++-
 swh/storage/in_memory.py              |  59 ++++++++------
 swh/storage/interface.py              |  40 +++++++---
 swh/storage/storage.py                |  52 ++++++++++---
 swh/storage/tests/test_retry.py       |  11 ++-
 swh/storage/tests/test_serializers.py |  41 ++++++++++
 swh/storage/tests/test_storage.py     | 140 +++++++++++++++++++++-------------
 11 files changed, 326 insertions(+), 124 deletions(-)
 create mode 100644 swh/storage/tests/test_serializers.py
Changes applied before test
commit 21b77304a0444601230e72c2959aa1fd5d96492c
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 27 22:17:59 2020 +0200

    storage*: use an enum to explicit the order in origin_visit_get
    
    Related to T645

commit 643ebc6e7eb9148558d1c692332785f529ffcb0e
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 27 22:17:59 2020 +0200

    storage*: origin_visit_get(...) -> PagedResult[OriginVisit]
    
    Related to T645

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