Page MenuHomeSoftware Heritage

identifiers: Add resolving of new SWHID contextual information
AcceptedPublic

Authored by anlambert on Fri, May 15, 4:55 PM.

Details

Summary

Update the built browse urls from new SWHID contextual info:

  • visit : the snapshot in which the object has been found
  • anchor: an ancestor of the object in the SWH graph defining browsing scope
  • path: path of the object from its root directory

Closes T2342
Closes T2408

Depends on D3156.

Diff Detail

Repository
rDWAPPS Web applications
Branch
swhid-resolver-update
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 12405
Build 18820: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 18819: arc lint + arc unit

Event Timeline

anlambert created this revision.Fri, May 15, 4:55 PM

Build is green

Patch application report for D3157 (id=11217)

Could not rebase; Attempt merge onto 3bbc62e227...

Updating 3bbc62e2..0549fa49
Fast-forward
 swh/web/browse/snapshot_context.py           |  44 ++---
 swh/web/browse/utils.py                      |  38 +++--
 swh/web/browse/views/content.py              |  30 ++--
 swh/web/browse/views/directory.py            |  45 +++--
 swh/web/browse/views/origin.py               |  33 +++-
 swh/web/browse/views/release.py              |  21 ++-
 swh/web/browse/views/revision.py             |  52 +++---
 swh/web/browse/views/snapshot.py             |   2 +-
 swh/web/common/identifiers.py                | 123 ++++++++++----
 swh/web/common/service.py                    |  35 ++++
 swh/web/tests/browse/views/test_directory.py |  17 +-
 swh/web/tests/browse/views/test_origin.py    | 136 ++++++++++++---
 swh/web/tests/browse/views/test_release.py   |  83 +++++----
 swh/web/tests/browse/views/test_revision.py  | 242 +++++++++++++++------------
 swh/web/tests/common/test_identifiers.py     | 151 ++++++++++++++++-
 swh/web/tests/common/test_service.py         |  21 +++
 16 files changed, 782 insertions(+), 291 deletions(-)
Changes applied before test
commit 0549fa4901f15e5fa4d6396f6cb696b8d3a36c56
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue May 12 19:02:51 2020 +0200

    identifiers: Add resolving of new SWHID contextual information
    
    Update the built browse urls from new SWHID contextual info:
    
      * visit : the snapshot in which the object has been found
    
      * anchor: an ancestor of the object in the SWH graph defining browsing scope
    
      * path: path of the object from its root directory
    
    Closes T2342
    Closes T2408

commit 88fde952d6f5cbe16766e3211654b65a723a850c
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Apr 3 19:40:04 2020 +0200

    browse: Add snapshot related query parameters in numerous object views
    
    It enables to browse archived objects scoped to a given origin visit, possibly
    on a given branch, release or revision.
    
    Closes T2359
    Related to T2342

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

ardumont accepted this revision.Fri, May 15, 5:51 PM
ardumont added a subscriber: ardumont.

Looks fine to me

a couple of remarks here and there ;)

swh/web/common/identifiers.py
77

Maybe add a docstring to explain what is its intended use.

swh/web/tests/common/test_identifiers.py
497

maybe explicit in its method name that this checks results ;)

568

lol, a lot of code for just the url assertions ;)
must have a hell lots of stuff in there now.

This revision is now accepted and ready to land.Fri, May 15, 5:51 PM