Page MenuHomeSoftware Heritage

pgstorage: Drop unnecessary indirection from reading origin_visit
ClosedPublic

Authored by ardumont on Thu, Jul 23, 9:18 AM.

Details

Summary

It's a missing left-over from the "make the origin-visit immutable" migration.

Kudos to the previous diff [1] which made me raise an eyebrow and then realized
the equivalent method in the cassandra backend was dead code (and it is here as well)

[1] https://forge.softwareheritage.org/D3594?vs=12649&id=12665#toc

Test Plan

tox is still happy

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.Thu, Jul 23, 9:18 AM
ardumont edited the summary of this revision. (Show Details)Thu, Jul 23, 9:20 AM
ardumont edited the summary of this revision. (Show Details)

Build is green

Patch application report for D3598 (id=12666)

Could not rebase; Attempt merge onto ccbd2e9c21...

Updating ccbd2e9c..96638f4c
Fast-forward
 swh/storage/cassandra/converters.py | 16 +++++++++--
 swh/storage/cassandra/storage.py    | 34 +++++++++++-------------
 swh/storage/in_memory.py            | 31 ++++++++++++++++------
 swh/storage/interface.py            | 10 ++++---
 swh/storage/storage.py              | 53 ++++++++++++-------------------------
 swh/storage/tests/test_storage.py   |  9 ++++---
 6 files changed, 81 insertions(+), 72 deletions(-)
Changes applied before test
commit 96638f4c37e75ccbac7657ac53ef0ebf9261e621
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Jul 23 09:16:19 2020 +0200

    pgstorage: Drop unnecessary indirection from reading origin_visit
    
    It's a missing left-over from the migration to making the origin-visit
    immutable.

commit c84c76833dffaaf758481c556babe6b3d88e1c10
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Jul 22 14:22:45 2020 +0200

    storage*.origin_visit_get_random: Read model objects

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

vlorentz accepted this revision.Thu, Jul 23, 10:04 AM
This revision is now accepted and ready to land.Thu, Jul 23, 10:04 AM
ardumont updated this revision to Diff 12667.Thu, Jul 23, 10:17 AM

Add missing tests scenario

ardumont updated this revision to Diff 12669.Thu, Jul 23, 10:20 AM

Rebase and make it happen before to D3594

Build is green

Patch application report for D3598 (id=12667)

Rebasing onto c9b503ed08...

Current branch diff-target is up to date.
Changes applied before test
commit 9894b477f5a226b8256f8a2eb56c6695883fdf12
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Jul 22 15:18:37 2020 +0200

    npm.loader: Extract _author_str function + add types, tests

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

Build has FAILED

Patch application report for D3598 (id=12669)

Rebasing onto ccbd2e9c21...

Current branch diff-target is up to date.
Changes applied before test
commit a23cd301dbc8f6c7e6ac0a7e3dc94ae1543878e7
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Jul 23 09:16:19 2020 +0200

    pgstorage: Drop unnecessary indirection from reading origin_visit
    
    It's a missing left-over from the migration to making the origin-visit
    immutable.

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

ardumont updated this revision to Diff 12670.Thu, Jul 23, 10:28 AM

Fix missing part (since the commit passed before D3594, we needed to adapt
origin-get-random as well which i forgot ¯\_(ツ)_/¯)
-> Tests should go green

Build is green

Patch application report for D3598 (id=12670)

Rebasing onto ccbd2e9c21...

Current branch diff-target is up to date.
Changes applied before test
commit b2055f4c45585a77075c373281c980e2bb0e453a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Jul 23 09:16:19 2020 +0200

    pgstorage: Drop unnecessary indirection from reading origin_visit
    
    It's a missing left-over from the migration to making the origin-visit
    immutable.

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