Page MenuHomeSoftware Heritage

storage: Make origin_get_latest_visit_status return OriginVisitStatus
ClosedPublic

Authored by ardumont on Jan 29 2021, 6:51 PM.

Details

Summary

This returned a Tuple[OriginVisit, OriginVisitStatus].

This was required to have the missing information "type" for visit-status. This is no
longer needed as now OriginVisitStatus holds such type information.

Impacts foreseen [1]:

[1]

$SWH_ENV_HOME/swh-indexer/swh/indexer/origin_head.py:from swh.storage.algos.origin import origin_get_latest_visit_status
$SWH_ENV_HOME/swh-indexer/swh/indexer/origin_head.py:        visit_and_status = origin_get_latest_visit_status(
$SWH_ENV_HOME/swh-loader-core/swh/loader/tests/__init__.py:from swh.storage.algos.origin import origin_get_latest_visit_status
$SWH_ENV_HOME/swh-loader-core/swh/loader/tests/__init__.py:    visit_and_status = origin_get_latest_visit_status(storage, url)
$SWH_ENV_HOME/swh-loader-core/swh/loader/tests/test_init.py:    mock_storage = mocker.patch("swh.loader.tests.origin_get_latest_visit_status")
$SWH_ENV_HOME/swh-loader-core/swh/loader/package/nixguix/tests/test_nixguix.py:from swh.storage.algos.origin import origin_get_latest_visit_status
$SWH_ENV_HOME/swh-loader-core/swh/loader/package/nixguix/tests/test_nixguix.py:    (_, visit_status) = origin_get_latest_visit_status(loader.storage, sources_url)
$SWH_ENV_HOME/swh-loader-git/swh/loader/git/from_disk.py:from swh.storage.algos.origin import origin_get_latest_visit_status
$SWH_ENV_HOME/swh-loader-git/swh/loader/git/from_disk.py:        visit_and_status = origin_get_latest_visit_status(
$SWH_ENV_HOME/swh-loader-mercurial/swh/loader/mercurial/loader.py:from swh.storage.algos.origin import origin_get_latest_visit_status
$SWH_ENV_HOME/swh-loader-mercurial/swh/loader/mercurial/loader.py:        visit_and_status = origin_get_latest_visit_status(
$SWH_ENV_HOME/swh-web/swh/web/common/archive.py:from swh.storage.algos.origin import origin_get_latest_visit_status
$SWH_ENV_HOME/swh-web/swh/web/common/archive.py:    visit_and_status = origin_get_latest_visit_status(
$SWH_ENV_HOME/swh-web/swh/web/tests/conftest.py:from swh.storage.algos.origin import origin_get_latest_visit_status
$SWH_ENV_HOME/swh-web/swh/web/tests/conftest.py:        visit_and_status = origin_get_latest_visit_status(

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 is green

Patch application report for D4976 (id=17763)

Could not rebase; Attempt merge onto 76de53cb26...

Auto-merging swh/storage/postgresql/storage.py
Merge made by the 'recursive' strategy.
 swh/storage/algos/origin.py            | 10 +++---
 swh/storage/algos/snapshot.py          |  6 ++--
 swh/storage/cassandra/storage.py       |  6 ++--
 swh/storage/interface.py               |  7 ++--
 swh/storage/postgresql/storage.py      | 10 ++----
 swh/storage/tests/algos/test_origin.py | 65 ++++++++++++++++------------------
 swh/storage/tests/storage_tests.py     | 10 +++---
 7 files changed, 49 insertions(+), 65 deletions(-)
Changes applied before test
commit e75d7d6ff0bbfe657dcac36a8e6f57c2785544a2
Merge: 76de53cb c6c7f0c8
Author: Jenkins user <jenkins@localhost>
Date:   Fri Jan 29 17:52:00 2021 +0000

    Merge branch 'diff-target' into HEAD

commit c6c7f0c8a0f58742db259d9658a42f4b61a0f1ce
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jan 29 18:50:04 2021 +0100

    storage: Make origin_get_latest_visit_status return OriginVisitStatus
    
    This returned a Tuple[OriginVisit, OriginVisitStatus].
    
    This was required to have the missing information "type" for visit-status. This is no
    longer needed as now OriginVisitStatus holds the type information.

commit f6acb12be3d70f46e53be697703029d2dd239e7a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jan 29 18:17:57 2021 +0100

    Change origin_visit_status_get_random interface to return visit_status
    
    This returned a Tuple[OriginVisit, OriginVisitStatus] which is no longer needed as now
    OriginVisitStatus held the type information now.

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

ardumont edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Feb 2 2021, 10:52 AM

Actually plan to (rebase and) land this when i'll be able to fix D4988.

ardumont edited the summary of this revision. (Show Details)

Actually plan to (rebase and) land this when i'll be able to fix D4988.

Fix is done (it was actually a hit and miss on git loader adaptations).

ardumont edited the summary of this revision. (Show Details)

Rebase

Build is green

Patch application report for D4976 (id=17852)

Could not rebase; Attempt merge onto f6ae8a062d...

Updating f6ae8a06..9a9f234e
Fast-forward
 swh/storage/algos/origin.py            | 10 +++---
 swh/storage/algos/snapshot.py          |  6 ++--
 swh/storage/cassandra/storage.py       |  6 ++--
 swh/storage/interface.py               |  7 ++--
 swh/storage/postgresql/storage.py      | 10 ++----
 swh/storage/tests/algos/test_origin.py | 65 ++++++++++++++++------------------
 swh/storage/tests/storage_tests.py     | 10 +++---
 7 files changed, 49 insertions(+), 65 deletions(-)
Changes applied before test
commit 9a9f234e0acd5dd2c5710e6ccb85409ba6221d44
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jan 29 18:50:04 2021 +0100

    storage: Make origin_get_latest_visit_status return OriginVisitStatus
    
    This returned a Tuple[OriginVisit, OriginVisitStatus].
    
    This was required to have the missing information "type" for visit-status. This is no
    longer needed as now OriginVisitStatus holds the type information.

commit 626b0bf8867b9ded52ac7524c17c972dc9214d70
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jan 29 18:17:57 2021 +0100

    Change origin_visit_status_get_random interface to return visit_status
    
    This returned a Tuple[OriginVisit, OriginVisitStatus] which is no longer needed as now
    OriginVisitStatus held the type information now.

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