Page MenuHomeSoftware Heritage

Split SE-IRI and Edit-IRI.
ClosedPublic

Authored by vlorentz on Nov 18 2020, 12:13 PM.

Details

Summary

SWORD doesn't require them to be the same, and IMO it is clearer
if we keep them separate.

Depends on D4500.

Diff Detail

Repository
rDDEP Push deposit
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

There are two test failures in test_deposit_list.py, because PRIVATE_LIST_DEPOSITS is returning a 405. But I didn't touch the private API. Any idea why?

Build has FAILED

Patch application report for D4501 (id=15966)

Could not rebase; Attempt merge onto a67ed6b06b...

Updating a67ed6b0..4b21b11f
Fast-forward
 swh/deposit/api/{deposit.py => collection.py}      |   8 +-
 swh/deposit/api/common.py                          |   7 +-
 swh/deposit/api/{deposit_content.py => content.py} |  10 +-
 swh/deposit/api/{deposit_update.py => edit.py}     | 143 +--------------------
 swh/deposit/api/edit_media.py                      |  87 +++++++++++++
 swh/deposit/api/service_document.py                |   2 +-
 swh/deposit/api/{deposit_status.py => state.py}    |   4 +-
 swh/deposit/api/sword_edit.py                      |  82 ++++++++++++
 swh/deposit/api/urls.py                            |  44 ++++---
 swh/deposit/config.py                              |   3 +-
 swh/deposit/templates/deposit/deposit_receipt.xml  |   4 +-
 swh/deposit/tests/api/collection/__init__.py       |   0
 .../test_collection.py}                            |   4 +-
 .../test_multipart.py}                             |   2 +
 .../test_post_atom.py}                             |  11 +-
 .../test_post_binary.py}                           |  17 ++-
 .../test_post_metadata.py}                         |   2 +
 .../api/{test_deposit_delete.py => test_delete.py} |   8 +-
 .../api/test_deposit_private_read_metadata.py      |   4 +-
 swh/deposit/tests/api/test_deposit_update.py       |  43 +++----
 .../{test_deposit_content.py => test_get_file.py}  |   2 +
 swh/deposit/tests/conftest.py                      |   4 +-
 22 files changed, 278 insertions(+), 213 deletions(-)
 rename swh/deposit/api/{deposit.py => collection.py} (94%)
 rename swh/deposit/api/{deposit_content.py => content.py} (88%)
 rename swh/deposit/api/{deposit_update.py => edit.py} (51%)
 create mode 100644 swh/deposit/api/edit_media.py
 rename swh/deposit/api/{deposit_status.py => state.py} (95%)
 create mode 100644 swh/deposit/api/sword_edit.py
 create mode 100644 swh/deposit/tests/api/collection/__init__.py
 rename swh/deposit/tests/api/{test_deposit.py => collection/test_collection.py} (98%)
 rename swh/deposit/tests/api/{test_deposit_multipart.py => collection/test_multipart.py} (99%)
 rename swh/deposit/tests/api/{test_deposit_atom.py => collection/test_post_atom.py} (97%)
 rename swh/deposit/tests/api/{test_deposit_binary.py => collection/test_post_binary.py} (97%)
 rename swh/deposit/tests/api/{test_deposit_metadata.py => collection/test_post_metadata.py} (99%)
 rename swh/deposit/tests/api/{test_deposit_delete.py => test_delete.py} (94%)
 rename swh/deposit/tests/api/{test_deposit_content.py => test_get_file.py} (98%)
Changes applied before test
commit 4b21b11f29a5737f36378b12b7ed36b3e5614bb1
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Nov 18 11:48:40 2020 +0100

    Split SE-IRI and Edit-IRI.
    
    SWORD doesn't require them to be the same, and IMO it is clearer
    if we keep them separate.

commit 845c8d46748a6454ff4ff8012fa8b68ae42d086f
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Nov 18 11:48:35 2020 +0100

    remove assumption that Edit-IRI and SE-IRI are the same from test_post_deposit_atom_entry_multiple_steps.
    
    Currently they are, but a future commit will make them different.

commit d7f5a6f60ecff310675775c58be34a87d9b691a5
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Nov 18 11:10:49 2020 +0100

    Rename files and classes in swh/deposit/api/deposit_* to be consistent with SWORD terminology.

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

Build has FAILED

Patch application report for D4501 (id=15971)

Could not rebase; Attempt merge onto a67ed6b06b...

Updating a67ed6b0..b69f60ff
Fast-forward
 swh/deposit/api/{deposit.py => collection.py}      |   8 +-
 swh/deposit/api/common.py                          |   7 +-
 swh/deposit/api/{deposit_content.py => content.py} |  10 +-
 swh/deposit/api/{deposit_update.py => edit.py}     | 143 +--------------------
 swh/deposit/api/edit_media.py                      |  87 +++++++++++++
 swh/deposit/api/service_document.py                |   2 +-
 swh/deposit/api/{deposit_status.py => state.py}    |   4 +-
 swh/deposit/api/sword_edit.py                      |  82 ++++++++++++
 swh/deposit/api/urls.py                            |  44 ++++---
 swh/deposit/config.py                              |   3 +-
 swh/deposit/templates/deposit/deposit_receipt.xml  |   4 +-
 .../api/{test_deposit.py => test_collection.py}    |   4 +-
 ...eposit_atom.py => test_collection_post_atom.py} |  11 +-
 ...it_binary.py => test_collection_post_binary.py} |  17 ++-
 ...etadata.py => test_collection_post_metadata.py} |   2 +
 ...tipart.py => test_collection_post_multipart.py} |   2 +
 .../api/{test_deposit_delete.py => test_delete.py} |   8 +-
 .../api/test_deposit_private_read_metadata.py      |   4 +-
 swh/deposit/tests/api/test_deposit_update.py       |  43 +++----
 .../{test_deposit_content.py => test_get_file.py}  |   2 +
 swh/deposit/tests/conftest.py                      |   4 +-
 21 files changed, 278 insertions(+), 213 deletions(-)
 rename swh/deposit/api/{deposit.py => collection.py} (94%)
 rename swh/deposit/api/{deposit_content.py => content.py} (88%)
 rename swh/deposit/api/{deposit_update.py => edit.py} (51%)
 create mode 100644 swh/deposit/api/edit_media.py
 rename swh/deposit/api/{deposit_status.py => state.py} (95%)
 create mode 100644 swh/deposit/api/sword_edit.py
 rename swh/deposit/tests/api/{test_deposit.py => test_collection.py} (98%)
 rename swh/deposit/tests/api/{test_deposit_atom.py => test_collection_post_atom.py} (97%)
 rename swh/deposit/tests/api/{test_deposit_binary.py => test_collection_post_binary.py} (97%)
 rename swh/deposit/tests/api/{test_deposit_metadata.py => test_collection_post_metadata.py} (99%)
 rename swh/deposit/tests/api/{test_deposit_multipart.py => test_collection_post_multipart.py} (99%)
 rename swh/deposit/tests/api/{test_deposit_delete.py => test_delete.py} (94%)
 rename swh/deposit/tests/api/{test_deposit_content.py => test_get_file.py} (98%)
Changes applied before test
commit b69f60ffab65596fd01ca2b2adbeeaf25bda38f9
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Nov 18 11:48:40 2020 +0100

    Split SE-IRI and Edit-IRI.
    
    SWORD doesn't require them to be the same, and IMO it is clearer
    if we keep them separate.

commit 64371a3dc2133a977244e884a191ad7f0162557c
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Nov 18 11:48:35 2020 +0100

    remove assumption that Edit-IRI and SE-IRI are the same from test_post_deposit_atom_entry_multiple_steps.
    
    Currently they are, but a future commit will make them different.

commit 329a2a3785ad8431fa7ec73fee31e86dbee36911
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Nov 18 11:10:49 2020 +0100

    Rename files and classes in swh/deposit/api/deposit_* to be consistent with SWORD terminology.

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

Build is green

Patch application report for D4501 (id=15979)

Could not rebase; Attempt merge onto a67ed6b06b...

Updating a67ed6b0..01cb24d3
Fast-forward
 swh/deposit/api/{deposit.py => collection.py}      |   8 +-
 swh/deposit/api/common.py                          |   7 +-
 swh/deposit/api/{deposit_content.py => content.py} |  10 +-
 swh/deposit/api/{deposit_update.py => edit.py}     | 143 +--------------------
 swh/deposit/api/edit_media.py                      |  87 +++++++++++++
 swh/deposit/api/service_document.py                |   2 +-
 swh/deposit/api/{deposit_status.py => state.py}    |   4 +-
 swh/deposit/api/sword_edit.py                      |  82 ++++++++++++
 swh/deposit/api/urls.py                            |  44 ++++---
 swh/deposit/config.py                              |   3 +-
 swh/deposit/templates/deposit/deposit_receipt.xml  |   4 +-
 .../api/{test_deposit.py => test_collection.py}    |   4 +-
 ...eposit_atom.py => test_collection_post_atom.py} |  11 +-
 ...it_binary.py => test_collection_post_binary.py} |  17 ++-
 ...etadata.py => test_collection_post_metadata.py} |   2 +
 ...tipart.py => test_collection_post_multipart.py} |   2 +
 .../api/{test_deposit_delete.py => test_delete.py} |   8 +-
 .../api/test_deposit_private_read_metadata.py      |   4 +-
 swh/deposit/tests/api/test_deposit_update.py       |  43 +++----
 .../{test_deposit_content.py => test_get_file.py}  |   2 +
 swh/deposit/tests/conftest.py                      |   4 +-
 21 files changed, 278 insertions(+), 213 deletions(-)
 rename swh/deposit/api/{deposit.py => collection.py} (94%)
 rename swh/deposit/api/{deposit_content.py => content.py} (88%)
 rename swh/deposit/api/{deposit_update.py => edit.py} (51%)
 create mode 100644 swh/deposit/api/edit_media.py
 rename swh/deposit/api/{deposit_status.py => state.py} (95%)
 create mode 100644 swh/deposit/api/sword_edit.py
 rename swh/deposit/tests/api/{test_deposit.py => test_collection.py} (98%)
 rename swh/deposit/tests/api/{test_deposit_atom.py => test_collection_post_atom.py} (97%)
 rename swh/deposit/tests/api/{test_deposit_binary.py => test_collection_post_binary.py} (97%)
 rename swh/deposit/tests/api/{test_deposit_metadata.py => test_collection_post_metadata.py} (99%)
 rename swh/deposit/tests/api/{test_deposit_multipart.py => test_collection_post_multipart.py} (99%)
 rename swh/deposit/tests/api/{test_deposit_delete.py => test_delete.py} (94%)
 rename swh/deposit/tests/api/{test_deposit_content.py => test_get_file.py} (98%)
Changes applied before test
commit 01cb24d3c44059839d0a1daa9c1947426171c019
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Nov 18 11:48:40 2020 +0100

    Split SE-IRI and Edit-IRI.
    
    SWORD doesn't require them to be the same, and IMO it is clearer
    if we keep them separate.

commit 64371a3dc2133a977244e884a191ad7f0162557c
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Nov 18 11:48:35 2020 +0100

    remove assumption that Edit-IRI and SE-IRI are the same from test_post_deposit_atom_entry_multiple_steps.
    
    Currently they are, but a future commit will make them different.

commit 329a2a3785ad8431fa7ec73fee31e86dbee36911
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Nov 18 11:10:49 2020 +0100

    Rename files and classes in swh/deposit/api/deposit_* to be consistent with SWORD terminology.

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

SWORD doesn't require them to be the same, and IMO it is clearer
if we keep them separate.

i recall those 2 were never clearly distincts to me ¯\_(ツ)_/¯
So I simplified to them being identical under the umbrella name of "update" the deposit.

I'm still unclear as to what those changes entail.

Well, looks ok...

I can't help but think that now we are back in the sword nightmare of
determining what IRI we want to touch to update stuff "Edit_IRI, wait no SE_IRI
oh wait no but 'of course' Edit_Media_IRI" ¯\_(ツ)_/¯...

This revision is now accepted and ready to land.Nov 18 2020, 2:44 PM

I'm still unclear as to what those changes entail.

it will break clients that build URLs themselves. But they shouldn't do it, because they are implementation details.

This revision was automatically updated to reflect the committed changes.