Page MenuHomeSoftware Heritage

Update the revision metadata field as an immutable dict
ClosedPublic

Authored by ardumont on Jul 8 2020, 6:12 PM.

Details

Summary

If that makes sense.

Either that or we need to push down the original_artifact part into the
different package loader implementations.

Fix build [1]

[1] https://jenkins.softwareheritage.org/job/DLDBASE/job/tests/919/console

Test Plan

tox

Diff Detail

Repository
rDLDBASE Generic VCS/Package Loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont created this revision.Jul 8 2020, 6:12 PM
ardumont edited the summary of this revision. (Show Details)Jul 8 2020, 6:12 PM

Build is green

Patch application report for D3471 (id=12273)

Rebasing onto 488b515a1c...

Current branch diff-target is up to date.
Changes applied before test
commit 8762b61d6a3c06058a2fc3e1b8b8279ffe79556a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Jul 8 18:10:00 2020 +0200

    Update the revision metadata field as an immutable dict
    
    Fix build [1]
    
    [1] https://jenkins.softwareheritage.org/job/DLDBASE/job/tests/919/console

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

vlorentz added inline comments.
swh/loader/package/loader.py
431–433

Replace these three lines with:

full_metadata = list(revision.metadata.items()) + [extra_metadata]

it's shorter and spares a copy

vlorentz accepted this revision.Jul 8 2020, 6:22 PM
This revision is now accepted and ready to land.Jul 8 2020, 6:22 PM
ardumont added inline comments.Jul 8 2020, 6:23 PM
swh/loader/package/loader.py
431–433

+1 ;)

ardumont updated this revision to Diff 12277.Jul 8 2020, 6:25 PM

Simplify as proposed ;)

Build is green

Patch application report for D3471 (id=12277)

Rebasing onto 488b515a1c...

Current branch diff-target is up to date.
Changes applied before test
commit 6dc3da1580d9d35cc9e7478f134b5246e058dc78
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Jul 8 18:10:00 2020 +0200

    Update the revision metadata field as an immutable dict
    
    Fix build [1]
    
    [1] https://jenkins.softwareheritage.org/job/DLDBASE/job/tests/919/console

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