Page MenuHomeSoftware Heritage

common/converters: Filter out id field when converting Origin model
ClosedPublic

Authored by anlambert on Sep 29 2021, 11:01 AM.

Details

Summary

The Origin model from swh-model now includes the origin id leading to
errors when serializing to JSON.

So filter out that field from the conversion to remove thsoe errors
plus it should not be leaked to end users in Web API responses.

See https://jenkins.softwareheritage.org/job/DENV/job/tests/1602/artifact/swh-web.log

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 D6371 (id=23162)

Rebasing onto 14a3caeadc...

Current branch diff-target is up to date.
Changes applied before test
commit ed98e5f8b5ff16eb2d053b7cf6b0f8b9332012c7
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Sep 29 10:54:23 2021 +0200

    common/converters: Filter out id field when converting Origin model
    
    The Origin model from swh-model now includes the origin id leading to
    errors when serializing to JSON.
    
    So filter out that field from the conversion to remove thsoe errors
    plus it should not be leaked to end users in Web API responses.

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

This revision is now accepted and ready to land.Sep 29 2021, 12:25 PM