Page MenuHomeSoftware Heritage

model.model: Remove ctime entry when it's None
ClosedPublic

Authored by ardumont on Aug 7 2020, 1:41 AM.

Details

Summary

It helps for code not yet migrated to use model object

Test Plan

tox

Diff Detail

Repository
rDMOD Data model
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build has FAILED

Patch application report for D3736 (id=13144)

Rebasing onto 09dcc04a4c...

Current branch diff-target is up to date.
Changes applied before test
commit 3a8a394dc9538ab620266be5074bfcdc3235aeae
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Aug 7 01:41:13 2020 +0200

    model.model: Remove ctime entry when it's None
    
    It helps for code not yet migrated to use model object

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

Build is green

Patch application report for D3736 (id=13145)

Rebasing onto 09dcc04a4c...

Current branch diff-target is up to date.
Changes applied before test
commit 360bc923f6e8f5f0ee4750a96bf9f644d82f0352
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Aug 7 01:41:13 2020 +0200

    model.Content.to_dict: Remove ctime entry when it's None
    
    Same as for the field data, it helps for code not yet migrated to use model
    object.

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

vlorentz requested changes to this revision.Aug 7 2020, 9:40 AM
vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/model/tests/test_hypothesis_strategies.py
131–134

If we are removing None ctime keys for contents, we should do it for skipped_contents too.

This revision now requires changes to proceed.Aug 7 2020, 9:40 AM
swh/model/tests/test_hypothesis_strategies.py
131–134

i was wondering.
ack.

Adapt SkippedContent.to_dict() implementation to unify with Content

Build is green

Patch application report for D3736 (id=13150)

Could not rebase; Attempt merge onto 09dcc04a4c...

Updating 09dcc04..d1db7b9
Fast-forward
 swh/model/model.py                            |  5 +++++
 swh/model/tests/test_hypothesis_strategies.py | 16 ++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)
Changes applied before test
commit d1db7b9954b7ec85709dc4037adfdf0bf5be99ad
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Aug 7 01:41:13 2020 +0200

    model.Content.to_dict: Remove ctime entry when it's None
    
    Same as for the field data, it helps for code not yet migrated to use model
    object.

commit b1a16b168b5803eb855ddafb1b4a6d8cc2ca3bde
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Aug 7 09:46:40 2020 +0200

    model: Add Sha1 alias
    
    Related to T645

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

This revision is now accepted and ready to land.Aug 7 2020, 10:15 AM