Page MenuHomeSoftware Heritage

common/origin_visits: Improve get_origin_visit performance
ClosedPublic

Authored by anlambert on Mar 24 2022, 5:28 PM.

Details

Summary

Use dedicated functions in archive module to get an origin visit by id
or by date.

Only get all visits as a fallback when one needs to get an origin visit
by snapshot.

Diff Detail

Repository
rDWAPPS Web applications
Branch
get-origin-visit-improvement
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 27791
Build 43501: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 43500: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D7425 (id=26874)

Rebasing onto 7c86b0e45c...

Current branch diff-target is up to date.
Changes applied before test
commit 93de845f5cb6833ccb20f70c0251eec76b2b7b70
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 24 17:19:15 2022 +0100

    common/origin_visits: Improve get_origin_visit performance
    
    Use dedicated functions in archive module to get an origin visit by id
    or by date.
    
    Only get all visits as a fallback when one needs to get an origin visit
    by snapshot.

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

ardumont added inline comments.
swh/web/browse/snapshot_context.py
731

same for equivalent below.

(it's shorter ;)

This revision is now accepted and ready to land.Mar 24 2022, 6:07 PM
swh/web/browse/snapshot_context.py
731

Right, thanks !

Update:

  • address @ardumont comment
  • update years in license headers

Remove added line break in test_origin_root_directory_view

Build is green

Patch application report for D7425 (id=26877)

Rebasing onto 7c86b0e45c...

Current branch diff-target is up to date.
Changes applied before test
commit fe60a815db53a47082139806b5edb7095ae9d697
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 24 17:19:15 2022 +0100

    common/origin_visits: Improve get_origin_visit performance
    
    Use dedicated functions in archive module to get an origin visit by id
    or by date.
    
    Only get all visits as a fallback when one needs to get an origin visit
    by snapshot.

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

Build is green

Patch application report for D7425 (id=26878)

Rebasing onto 7c86b0e45c...

Current branch diff-target is up to date.
Changes applied before test
commit d5e3f98417d27b777b0afa8b1d9b7e18f89b5609
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 24 17:19:15 2022 +0100

    common/origin_visits: Improve get_origin_visit performance
    
    Use dedicated functions in archive module to get an origin visit by id
    or by date.
    
    Only get all visits as a fallback when one needs to get an origin visit
    by snapshot.

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