Page MenuHomeSoftware Heritage

deposit.cli: Generate uuid as is
ClosedPublic

Authored by ardumont on Apr 15 2019, 3:43 PM.

Details

Summary

Expose optional external id in deposit status endpoint

As this is generated, this could be useful for client who wants to
deposit further new version

From docker-env (manually formatted):

INFO:swh.deposit.cli.deposit:{
'deposit_id': '3',
'deposit_status': 'done',
'deposit_status_detail': 'The deposit has been successfully loaded into the Software Heritage archive',
'deposit_swh_id': 'swh:1:dir:3b0919ddd42be1ba0405d33f383b6e0ee8dedcba',
'deposit_swh_id_context': 'swh:1:dir:3b0919ddd42be1ba0405d33f383b6e0ee8dedcba;origin=https://forge.softwareheritage.org/source/jesuisgpl/',
'deposit_swh_anchor_id': 'swh:1:rev:7336885eda39fb1f7265c0e8ea75b139cc1773d4',
'deposit_swh_anchor_id_context': 'swh:1:rev:7336885eda39fb1f7265c0e8ea75b139cc1773d4;origin=https://forge.softwareheritage.org/source/jesuisgpl/',
'deposit_external_id': '6a7ef0a1-e88d-4590-b153-2ae9dce3c7ee'  # <- HERE we go!
}
Test Plan

tox

Diff Detail

Repository
rDDEP Push deposit
Branch
adaptations
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5448
Build 7383: tox-on-jenkinsJenkins
Build 7382: arc lint + arc unit

Event Timeline

swh/deposit/api/deposit_status.py
43–51

Shouldn't this be the time to think about something like:

context = {
    'deposit_id': deposit.id,
    'status_detail': status_detail, 
}
keys = ('status', 'swh_id', 'swh_id_context', 'swh_anchor_id', 'swh_anchor_id_context', 'external_id')
for k in keys:
    context[k] = getattr(deposit, k, None)

?

swh/deposit/api/deposit_status.py
43–51

sure

  • deposit_status: Simplify the deposit status computation
This revision is now accepted and ready to land.Apr 16 2019, 11:30 AM
This revision was automatically updated to reflect the committed changes.