Page MenuHomeSoftware Heritage

Improve typing of the buffering interface
ClosedPublic

Authored by tenma on Sep 24 2020, 4:35 PM.

Details

Summary
  • use more generic collection types, so that parametrized types can be

made stricter (e.g. str, in the next revision)

  • remove Optionals that are not needed and provide better defaults

Depends on D4032
Related to D4018

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

Build was aborted

Patch application report for D4033 (id=14234)

Could not rebase; Attempt merge onto 829118a63f...

Merge made by the 'recursive' strategy.
 swh/storage/buffer.py                | 31 +++++++++++--------------------
 swh/storage/cassandra/storage.py     | 17 ++++++++++++++---
 swh/storage/cli.py                   |  3 ++-
 swh/storage/interface.py             |  6 +++---
 swh/storage/postgresql/storage.py    |  6 +++---
 swh/storage/retry.py                 | 11 +----------
 swh/storage/tests/test_postgresql.py |  4 ++--
 7 files changed, 36 insertions(+), 42 deletions(-)
Changes applied before test
commit d2cc528918b8ac9974e66a23f08495c6c38ef752
Merge: 829118a6 836f7543
Author: Jenkins user <jenkins@localhost>
Date:   Thu Sep 24 14:37:10 2020 +0000

    Merge branch 'diff-target' into HEAD

commit 836f75431b49aec710c5641859941707e10f67ad
Author: tenma <tenma+swh@mailbox.org>
Date:   Thu Sep 24 15:48:41 2020 +0200

    Improve typing of the buffering interface
    
    - use more generic collection types, so that parametrized types can be
    made stricter (e.g. str, in the next revision)
    - remove Optionals that are not needed and provide better defaults

commit dc02bb95f8eca7b85ea592057265cacf2ecb9404
Author: tenma <tenma+swh@mailbox.org>
Date:   Thu Sep 24 14:29:15 2020 +0200

    Fix default value handling in constructor
    
    Use a more simple default value and do not identity check against it.

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

Build is green

Patch application report for D4033 (id=14234)

Could not rebase; Attempt merge onto 829118a63f...

Merge made by the 'recursive' strategy.
 swh/storage/buffer.py                | 31 +++++++++++--------------------
 swh/storage/cassandra/storage.py     | 17 ++++++++++++++---
 swh/storage/cli.py                   |  3 ++-
 swh/storage/interface.py             |  6 +++---
 swh/storage/postgresql/storage.py    |  6 +++---
 swh/storage/retry.py                 | 11 +----------
 swh/storage/tests/test_postgresql.py |  4 ++--
 7 files changed, 36 insertions(+), 42 deletions(-)
Changes applied before test
commit 62cf5c4241ed27ea287748aeffa2f89d6185dc69
Merge: 829118a6 836f7543
Author: Jenkins user <jenkins@localhost>
Date:   Thu Sep 24 15:07:00 2020 +0000

    Merge branch 'diff-target' into HEAD

commit 836f75431b49aec710c5641859941707e10f67ad
Author: tenma <tenma+swh@mailbox.org>
Date:   Thu Sep 24 15:48:41 2020 +0200

    Improve typing of the buffering interface
    
    - use more generic collection types, so that parametrized types can be
    made stricter (e.g. str, in the next revision)
    - remove Optionals that are not needed and provide better defaults

commit dc02bb95f8eca7b85ea592057265cacf2ecb9404
Author: tenma <tenma+swh@mailbox.org>
Date:   Thu Sep 24 14:29:15 2020 +0200

    Fix default value handling in constructor
    
    Use a more simple default value and do not identity check against it.

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

vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/storage/tests/test_postgresql.py
251–257

I don't think these changes are needed

This revision is now accepted and ready to land.Sep 25 2020, 10:31 AM

Build is green

Patch application report for D4033 (id=14288)

Rebasing onto e8f1136ff7...

Current branch diff-target is up to date.
Changes applied before test
commit a75c5caf9df0470fad869b695ecbcacda3040978
Author: tenma <tenma+swh@mailbox.org>
Date:   Thu Sep 24 15:48:41 2020 +0200

    Improve typing of the buffering interface
    
    - use more generic collection types, so that parametrized types can be
    made stricter (e.g. str, in the next revision)
    - remove Optionals that are not needed and provide better defaults

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

This revision was automatically updated to reflect the committed changes.