Page MenuHomeSoftware Heritage

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

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

Details

Diff Detail

Repository
rDSTO Storage manager
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.Tue, Jul 28, 1:14 PM

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
33

docstring

swh/storage/storage.py
902

could you pass the enum instance directly?

ardumont added inline comments.Tue, Jul 28, 2:10 PM
swh/storage/interface.py
33

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.

ardumont added inline comments.Tue, Jul 28, 2:20 PM
swh/storage/interface.py
33

in the docstring i mean.

vlorentz accepted this revision.Wed, Jul 29, 9:18 AM
vlorentz added inline comments.
swh/storage/interface.py
33

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

This revision is now accepted and ready to land.Wed, Jul 29, 9:18 AM
ardumont marked 2 inline comments as done.Wed, Jul 29, 11:53 AM
ardumont added inline comments.
swh/storage/storage.py
902

doing it ;)

ardumont updated this revision to Diff 12804.Wed, Jul 29, 12:12 PM

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.

ardumont added inline comments.Wed, Jul 29, 12:20 PM
swh/storage/storage.py
902

It's worth the effort.
Thanks ;)

vlorentz accepted this revision.Wed, Jul 29, 12:26 PM
vlorentz added inline comments.
swh/storage/storage.py
892–894

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

ardumont updated this revision to Diff 12810.Wed, Jul 29, 1:35 PM

Rebase again

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.