Page MenuHomeSoftware Heritage

api/serializers: Handle case where an exception can not be rebuilt
ClosedPublic

Authored by anlambert on Dec 11 2020, 6:26 PM.

Details

Summary

It exists cases where a custom exception type cannot be rebuilt from its
serialized form, see https://sentry.softwareheritage.org/organizations/swh/issues/4959/?query=is%3Aunresolved

As a fallback, build a base Exception with the message of the serialized exception.

Diff Detail

Repository
rDCORE Foundations and core functionalities
Branch
exception-serializer-fix
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17915
Build 27678: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 27677: arc lint + arc unit

Event Timeline

Build has FAILED

Patch application report for D4730 (id=16753)

Rebasing onto 777ea186fa...

First, rewinding head to replay your work on top of it...
Applying: api/serializers: Handle case where an exception can not be rebuilt
Using index info to reconstruct a base tree...
M	swh/core/api/serializers.py
M	swh/core/api/tests/test_serializers.py
Falling back to patching base and 3-way merge...
Auto-merging swh/core/api/tests/test_serializers.py
Auto-merging swh/core/api/serializers.py
Changes applied before test
commit 0e640296f0e6d5e1c6020e552f6f235df72abbe6
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Dec 11 18:20:59 2020 +0100

    api/serializers: Handle case where an exception can not be rebuilt
    
    It exists cases where a custom exception type cannot be rebuilt from its
    serialized form.
    
    As a fallback, build a base Exception with the message of the serialized
    exception.

Link to build: https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/179/
See console output for more information: https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/179/console

Build has FAILED

Patch application report for D4730 (id=16753)

Rebasing onto 777ea186fa...

First, rewinding head to replay your work on top of it...
Applying: api/serializers: Handle case where an exception can not be rebuilt
Using index info to reconstruct a base tree...
M	swh/core/api/serializers.py
M	swh/core/api/tests/test_serializers.py
Falling back to patching base and 3-way merge...
Auto-merging swh/core/api/tests/test_serializers.py
Auto-merging swh/core/api/serializers.py
Changes applied before test
commit 16a03eb82c4eecb9b6593019d817ade883872480
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Dec 11 18:20:59 2020 +0100

    api/serializers: Handle case where an exception can not be rebuilt
    
    It exists cases where a custom exception type cannot be rebuilt from its
    serialized form.
    
    As a fallback, build a base Exception with the message of the serialized
    exception.

Link to build: https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/180/
See console output for more information: https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/180/console

Build has FAILED

Patch application report for D4730 (id=16754)

Rebasing onto 777ea186fa...

Current branch diff-target is up to date.
Changes applied before test
commit ea80859ce7f0a1d098dd49d12b106e513d51a609
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Dec 11 18:20:59 2020 +0100

    api/serializers: Handle case where an exception can not be rebuilt
    
    It exists cases where a custom exception type cannot be rebuilt from its
    serialized form.
    
    As a fallback, build a base Exception with the message of the serialized
    exception.

Link to build: https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/181/
See console output for more information: https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/181/console

Use json_(loads|dumps) instead of json.(loads|dumps)

Build is green

Patch application report for D4730 (id=16755)

Rebasing onto 777ea186fa...

Current branch diff-target is up to date.
Changes applied before test
commit 40018f236ed23de5b43716d1ecdb84448a334f40
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Dec 11 18:20:59 2020 +0100

    api/serializers: Handle case where an exception can not be rebuilt
    
    It exists cases where a custom exception type cannot be rebuilt from its
    serialized form.
    
    As a fallback, build a base Exception with the message of the serialized
    exception.

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

This revision is now accepted and ready to land.Dec 17 2020, 11:40 AM