Page MenuHomeSoftware Heritage

badges: Use QualifiedSWHID instead of the old SWHID class.
ClosedPublic

Authored by vlorentz on Mar 1 2021, 12:16 PM.

Details

Summary

Also drops support for swh:1:ori: badges, because we shouldn't
support them anyway.

Diff Detail

Repository
rDWAPPS Web applications
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 D5168 (id=18482)

Could not rebase; Attempt merge onto 8c7829a8a4...

Merge made by the 'recursive' strategy.
 swh/web/api/views/graph.py        |  14 ++---
 swh/web/misc/badges.py            |  71 +++++++++++--------------
 swh/web/tests/misc/test_badges.py | 109 ++++++++++++++++----------------------
 3 files changed, 84 insertions(+), 110 deletions(-)
Changes applied before test
commit 48370279c693f03766e3b4615c7dca2e5191a1d6
Merge: 8c7829a8 8694a779
Author: Jenkins user <jenkins@localhost>
Date:   Mon Mar 1 11:17:58 2021 +0000

    Merge branch 'diff-target' into HEAD

commit 8694a779a485dc2cc37ac90cbdd8b099972a3949
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Mar 1 12:11:44 2021 +0100

    badges: Use QualifiedSWHID instead of the old SWHID class.
    
    Also drops support for swh:1:ori: badges, because we shouldn't
    support them anyway.

commit 0b974c8923f53d63cb69a8cb89f672540526a00a
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Mar 1 12:07:04 2021 +0100

    graph: Use ExtendedSWHID instead of the old SWHID class.

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

Build is green

Patch application report for D5168 (id=18485)

Rebasing onto 3b1ee65790...

Current branch diff-target is up to date.
Changes applied before test
commit a9298c4193bf43008501f52c734586b1dce44ebc
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Mar 1 12:11:44 2021 +0100

    badges: Use QualifiedSWHID instead of the old SWHID class.
    
    Also drops support for swh:1:ori: badges, because we shouldn't
    support them anyway.

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

anlambert added a subscriber: anlambert.
anlambert added inline comments.
swh/web/misc/badges.py
30–36

I would rather use ObjectType.<type> as keys of that dict.

This revision is now accepted and ready to land.Mar 1 2021, 2:35 PM
swh/web/misc/badges.py
30–36

I tried it, didn't end well.

I'm trying to do this incrementally; when I tried to do it all at once I had to restart from scratch because it was too hard to debug

I just realized I misunderstood the code, and we didn't actually use swh:1:ori: for badges, we just masqueraded {"object_id": ORIGIN, "url": "https://..."} as a SWHID, so I need to fix that

This revision is now accepted and ready to land.Mar 1 2021, 2:53 PM

Build is green

Patch application report for D5168 (id=18493)

Rebasing onto 3b1ee65790...

Current branch diff-target is up to date.
Changes applied before test
commit fc8ac013e9970772e46017506a67c17c56de01b6
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Mar 1 12:11:44 2021 +0100

    badges: Use QualifiedSWHID instead of the old SWHID class.
    
    Also drops support for swh:1:ori: badges, because we shouldn't
    support them anyway.

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