Page MenuHomeSoftware Heritage

utils/urlsindex: Modify UrlsIndex class to simplify API URLs management
ClosedPublic

Authored by anlambert on Nov 3 2022, 1:54 PM.

Details

Summary

Make that class instantiable in order for each swh django application to
manage its related Web API URLs independently from the swh.web.api django
application.

It also simplifies initialization of applications as their ordering does
not matter anymore but also improves tests related to URLs registration
of an application.

Also add typing to UrlsIndex class.

Diff Detail

Repository
rDWAPPS Web applications
Branch
urlsindex-update
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 32685
Build 51204: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 51203: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D8804 (id=31731)

Rebasing onto 93696b9cc7...

Current branch diff-target is up to date.
Changes applied before test
commit 1e3c1acf7b8695bc3282351488c45f02beb68e32
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Nov 3 13:44:39 2022 +0100

    utils/urlsindex: Modify UrlsIndex class to simplify API URLs management
    
    Make that class instantiable in order for each swh django application to
    manage its related Web API URLs independently from the swh.web.api django
    application.
    
    It also simplifies initialization of applications as their ordering does
    not matter anymore but also improves tests related to URLs registration
    of an application.
    
    Also add typing to UrlsIndex class.

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

vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/web/vault/urls.py
26–30

looks better IMO, but it works fine either way

This revision is now accepted and ready to land.Nov 3 2022, 2:21 PM
swh/web/vault/urls.py
26–30

more Pythonic indeed, will update every urls.py files with such construct

Use more Pythonic way to concatenate lists

Build is green

Patch application report for D8804 (id=31734)

Rebasing onto 93696b9cc7...

Current branch diff-target is up to date.
Changes applied before test
commit d055e08d8bbcce777e31bb9befdb96cce37f85aa
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Nov 3 13:44:39 2022 +0100

    utils/urlsindex: Modify UrlsIndex class to simplify API URLs management
    
    Make that class instantiable in order for each swh django application to
    manage its related Web API URLs independently from the swh.web.api django
    application.
    
    It also simplifies initialization of applications as their ordering does
    not matter anymore but also improves tests related to URLs registration
    of an application.
    
    Also add typing to UrlsIndex class.

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