Page MenuHomeSoftware Heritage

Remove metadata_dict from the API
ClosedPublic

Authored by vlorentz on Feb 23 2022, 1:44 PM.

Details

Summary

No one uses that, and it's redundant, as we provide the original XML

Diff Detail

Repository
rDDEP Push deposit
Branch
drop-xmltodict
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 27077
Build 42344: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 42343: arc lint + arc unit

Unit TestsFailed

TimeTest
1,238 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_collection_add_to_origin::test_add_deposit_add_to_origin_conflict
authenticated_client = <rest_framework.test.APIClient object at 0x7f304a3ca048> deposit_collection = <DepositCollection: {'id': 11, 'name': 'test'}> deposit_another_collection = <DepositCollection: {'id': 12, 'name': 'another-collection'}>
1,381 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_collection_add_to_origin::test_add_deposit_add_to_wrong_origin
authenticated_client = <rest_framework.test.APIClient object at 0x7f304a309ac8> deposit_collection = <DepositCollection: {'id': 13, 'name': 'test'}> atom_dataset = {'codemeta-sample': '<?xml version="1.0"?>\n <entry xmlns="http://www.w3.org/2005/Atom"\n xmlns:d...ntry>\n', 'entry-data-empty-body': '<?xml version="1.0"?>\n<entry xmlns="http://www.w3.org/2005/Atom"></entry>\n', ...}
1,391 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_collection_add_to_origin::test_add_deposit_with_add_to_origin
raw_content = b'<entry xmlns="http://www.w3.org/2005/Atom"\n xmlns:sword="http://purl.org/net/sword/terms/"\n xmlns:dcte...1/test/1/status/" />\n\n <sword:packaging>http://purl.org/net/sword/package/SimpleZip</sword:packaging>\n</entry>\n' def parse_xml(raw_content):
1,378 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_collection_add_to_origin::test_add_deposit_with_add_to_origin_and_external_identifier
raw_content = b'<entry xmlns="http://www.w3.org/2005/Atom"\n xmlns:sword="http://purl.org/net/sword/terms/"\n xmlns:dcte...1/test/3/status/" />\n\n <sword:packaging>http://purl.org/net/sword/package/SimpleZip</sword:packaging>\n</entry>\n' def parse_xml(raw_content):
1,508 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_collection_add_to_origin::test_post_deposit_atom_403_add_to_wrong_origin_url_prefix
authenticated_client = <rest_framework.test.APIClient object at 0x7f304a1f1e10> deposit_collection = <DepositCollection: {'id': 15, 'name': 'test'}> atom_dataset = {'codemeta-sample': '<?xml version="1.0"?>\n <entry xmlns="http://www.w3.org/2005/Atom"\n xmlns:d...ntry>\n', 'entry-data-empty-body': '<?xml version="1.0"?>\n<entry xmlns="http://www.w3.org/2005/Atom"></entry>\n', ...}
View Full Test Results (157 Failed · 128 Passed)

Event Timeline

Build has FAILED

Patch application report for D7230 (id=26204)

Could not rebase; Attempt merge onto 5a7d59cb2c...

Merge made by the 'recursive' strategy.
 swh/deposit/api/private/deposit_read.py                     | 2 --
 swh/deposit/tests/api/test_deposit_private_read_metadata.py | 7 -------
 swh/deposit/tests/conftest.py                               | 3 +--
 3 files changed, 1 insertion(+), 11 deletions(-)
Changes applied before test
commit e6e19fc1e91264eb9fff8eabf0bab47118981d7c
Merge: 5a7d59cb 68eb441c
Author: Jenkins user <jenkins@localhost>
Date:   Wed Feb 23 12:44:26 2022 +0000

    Merge branch 'diff-target' into HEAD

commit 68eb441cb90edbab5b1fadb1b411c106a6c9c70e
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Feb 23 13:44:07 2022 +0100

    Remove metadata_dict from the API
    
    No one uses that, and it's redundant, as we provide the original XML

commit 189ba2f7cc9c5b35891b23adf19872b8f230b7e8
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Feb 23 13:43:33 2022 +0100

    Remove unnecessary use of BytesIO

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

Harbormaster returned this revision to the author for changes because remote builds failed.Feb 23 2022, 1:52 PM
Harbormaster failed remote builds in B27077: Diff 26204!
ardumont added a subscriber: ardumont.

No one uses that, and it's redundant, as we provide the original XML

It's not entirely true though, it's used in the loader [1].
We'll need a change in the loader-core to drop that entry as well.

[1] https://forge.softwareheritage.org/source/swh-loader-core/browse/master/swh/loader/package/deposit/loader.py$75

This revision is now accepted and ready to land.Feb 23 2022, 6:43 PM

Build has FAILED

Patch application report for D7230 (id=26221)

Could not rebase; Attempt merge onto 5a7d59cb2c...

Updating 5a7d59cb..5998e196
Fast-forward
 swh/deposit/api/private/deposit_read.py                     | 2 --
 swh/deposit/tests/api/test_deposit_private_read_metadata.py | 7 -------
 swh/deposit/tests/conftest.py                               | 3 +--
 3 files changed, 1 insertion(+), 11 deletions(-)
Changes applied before test
commit 5998e19648f4a987dc024935f20d7e0adae31dc8
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Feb 23 13:44:07 2022 +0100

    Remove metadata_dict from the API
    
    No one uses that, and it's redundant, as we provide the original XML

commit 79be8e1c74e15607d4ced35fc2f2de1359c02ecb
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Feb 23 13:43:33 2022 +0100

    Remove unnecessary use of BytesIO

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

This revision was landed with ongoing or failed builds.Feb 24 2022, 10:02 AM
This revision was automatically updated to reflect the committed changes.