Page MenuHomeSoftware Heritage

Remove remaining uses of the deprecated swhid() function.
ClosedPublic

Authored by vlorentz on Mar 1 2021, 2:11 PM.

Event Timeline

Build is green

Patch application report for D5171 (id=18492)

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

Updating 3b1ee657..ed7ba67a
Fast-forward
 swh/web/api/views/identifiers.py               |  20 ++-
 swh/web/browse/snapshot_context.py             |  15 ++-
 swh/web/browse/views/revision.py               |  14 ++-
 swh/web/common/identifiers.py                  | 164 ++++++++++++-------------
 swh/web/misc/badges.py                         |  71 +++++------
 swh/web/tests/api/views/test_graph.py          |  15 ++-
 swh/web/tests/browse/views/test_content.py     |  31 +++--
 swh/web/tests/browse/views/test_directory.py   |  27 ++--
 swh/web/tests/browse/views/test_identifiers.py |   2 +-
 swh/web/tests/common/test_identifiers.py       |  37 +++---
 swh/web/tests/misc/test_badges.py              | 109 +++++++---------
 11 files changed, 270 insertions(+), 235 deletions(-)
Changes applied before test
commit ed7ba67ab0bf2099e8955b7408173136219edd3d
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Mar 1 14:11:43 2021 +0100

    Remove remaining uses of the deprecated swhid() function.

commit 8e568525ea519ead517ba97504b28f51c6db81ee
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Mar 1 13:55:06 2021 +0100

    identifiers.get_swhid: return QualifiedSWHID instead of the deprecated SWHID class
    
    and update every caller.

commit 65fd22bb64cddae825c1b028cba9e39da702efad
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Mar 1 12:34:35 2021 +0100

    identifiers.gen_swhid: Use QualifiedSWHID instead of the deprecated swhid() function.
    
    Also fix tests using it with the wrong argument type (a dict with an
    "id" key, instead of just the object id).

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/599/ for more details.

This revision is now accepted and ready to land.Mar 1 2021, 2:36 PM
ardumont added a subscriber: ardumont.

lgtm

one question inline.

swh/web/tests/api/views/test_graph.py
180

why is it an extended swhid here?

rebase

swh/web/tests/api/views/test_graph.py
180

swh-graph uses swh:1:ori: to represent origins, and only ExtendedSWHID allows swh:1:ori:

Build is green

Patch application report for D5171 (id=18496)

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

Updating 3b1ee657..457f8f57
Fast-forward
 swh/web/api/views/identifiers.py               |  20 ++-
 swh/web/browse/snapshot_context.py             |  15 ++-
 swh/web/browse/views/revision.py               |  14 ++-
 swh/web/common/identifiers.py                  | 164 ++++++++++++-------------
 swh/web/misc/badges.py                         |  58 ++++-----
 swh/web/tests/api/views/test_graph.py          |  15 ++-
 swh/web/tests/browse/views/test_content.py     |  31 +++--
 swh/web/tests/browse/views/test_directory.py   |  27 ++--
 swh/web/tests/browse/views/test_identifiers.py |   2 +-
 swh/web/tests/common/test_identifiers.py       |  37 +++---
 swh/web/tests/misc/test_badges.py              |  86 +++++++------
 11 files changed, 265 insertions(+), 204 deletions(-)
Changes applied before test
commit 457f8f57c0af4fa2aedc3330ba64b9b38d05104d
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Mar 1 14:11:43 2021 +0100

    Remove remaining uses of the deprecated swhid() function.

commit 7a7f3e35704698755a23930cfdeb729b1cd9d52c
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Mar 1 13:55:06 2021 +0100

    identifiers.get_swhid: return QualifiedSWHID instead of the deprecated SWHID class
    
    and update every caller.

commit 777d7e6ad9d94b62b0978458e413f4381e91fac7
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Mar 1 12:34:35 2021 +0100

    identifiers.gen_swhid: Use QualifiedSWHID instead of the deprecated swhid() function.
    
    Also fix tests using it with the wrong argument type (a dict with an
    "id" key, instead of just the object id).

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/603/ for more details.