Page MenuHomeSoftware Heritage

storage*: Type origin_search(...) -> PagedResult[Origin]
ClosedPublic

Authored by ardumont on Jul 30 2020, 4:10 PM.

Details

Summary

This unifies the how the pagination is now done, abstracting away how the
pagination is dealt with internally.

This does not touch the internal logic of limit/offset used within.

Impacts swh-web:

grep -r 'origin_search(' ../*/swh/** | grep -v "swh-storage" | grep -v "swh-search"
../swh-web/swh/web/api/views/origin.py:def api_origin_search(request, url_pattern):
../swh-web/swh/web/common/service.py:        results = search.origin_search(
../swh-web/swh/web/common/service.py:        origins_raw = storage.origin_search(
../swh-web/swh/web/assets/src/bundles/browse/origin-search.js:    baseSearchUrl = new URL(Urls.api_1_origin_search(searchQueryText), window.location);
../swh-web/swh/web/tests/api/views/test_origin.py:def test_api_origin_search(api_client, mocker, backend):

Related to T645

Test Plan

tox

Diff Detail

Repository
rDSTO Storage manager
Branch
open-snapshot-id
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14097
Build 21650: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 21649: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jul 30 2020, 4:14 PM

Build has FAILED

Patch application report for D3651 (id=12859)

Rebasing onto 4d52fc1d07...

Current branch diff-target is up to date.
Changes applied before test
commit 9bb6868cf4a6afd99d8944acf79c135c4195f79b
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Jul 30 16:07:53 2020 +0200

    storage*: Type origin_search(...) -> PagedResult[Origin]
    
    Related to T645

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

  • Fix missing type annotation on storage implementation
  • Fix in-memory origin-count implementation which reuses origin-search internally

Build was aborted

Patch application report for D3651 (id=12860)

Rebasing onto 4d52fc1d07...

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

    storage*: Type origin_search(...) -> PagedResult[Origin]
    
    Related to T645

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

Build is green

Patch application report for D3651 (id=12860)

Rebasing onto 4d52fc1d07...

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

    storage*: Type origin_search(...) -> PagedResult[Origin]
    
    Related to T645

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