Page MenuHomeSoftware Heritage

Open `swh deposit list` cli to allow user to list their deposits
ClosedPublic

Authored by ardumont on May 24 2021, 5:26 PM.

Details

Summary

This does not provide any filters yet though. The result is paginated and "next" link
will be displayed in the result. It's up to clients to make the subsequent calls to the
cli to list the next deposits through the --page and --page-size flags.

$ swh deposit list --help
Usage: swh deposit list [OPTIONS]

  Deposit metadata only upload



Options:
  --url TEXT                      (Optional) Deposit server api endpoint. By
                                  default,
                                  https://deposit.softwareheritage.org/1

  --username TEXT                 (Mandatory) User's name  [required]
  --password TEXT                 (Mandatory) User's associated password
                                  [required]

  -f, --format [logging|yaml|json]
                                  Output format results.
  --page INTEGER                  Page number when requesting more information
  --page-size INTEGER             Page number when requesting more information
  -h, --help                      Show this message and exit.

Related to T2996
Depends on D5769

Test Plan

tox

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

ardumont planned changes to this revision.
ardumont edited the summary of this revision. (Show Details)
ardumont edited the summary of this revision. (Show Details)

Build is green

Patch application report for D5770 (id=20634)

Could not rebase; Attempt merge onto 63c1bc3e0d...

Updating 63c1bc3e..0eb4a460
Fast-forward
 swh/deposit/api/collection_list.py                 |   3 +-
 swh/deposit/cli/client.py                          |  28 ++++-
 swh/deposit/client.py                              | 109 ++++++++++++++++---
 swh/deposit/tests/cli/test_client.py               |  75 +++++++++++++
 .../tests/data/atom/entry-list-deposits-page1.xml  |  20 ++++
 .../tests/data/atom/entry-list-deposits-page2.xml  |  18 ++++
 .../tests/data/atom/entry-list-deposits.xml        |  30 ++++++
 .../data/https_deposit.test.list/1_servicedocument |  26 +++++
 .../1_test_list,page=1,page_size=10                |  30 ++++++
 swh/deposit/tests/test_client_module.py            | 119 +++++++++++++++++++++
 swh/deposit/utils.py                               |  13 +++
 11 files changed, 455 insertions(+), 16 deletions(-)
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits-page1.xml
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits-page2.xml
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits.xml
 create mode 100644 swh/deposit/tests/data/https_deposit.test.list/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.list/1_test_list,page=1,page_size=10
Changes applied before test
commit 0eb4a4608f06836f9cf01743dbfcb5f91ddf8171
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon May 24 17:14:08 2021 +0200

    cli: Open `swh deposit list` cli
    
    This allows to list from the cli the user's deposits (no filter).
    
    Related to T2996

commit fdae25cdd6d9673424c2bc3ea2b6b057c10856b9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon May 24 15:55:05 2021 +0200

    client: Open a paginated list user deposits endpoint
    
    Related to T2996

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

ardumont retitled this revision from cli: Open `swh deposit list` cli to Open `swh deposit list` cli to allow user to list their deposits.May 24 2021, 5:32 PM
ardumont edited the summary of this revision. (Show Details)
ardumont edited the summary of this revision. (Show Details)

reword commit message and diff description

Build is green

Patch application report for D5770 (id=20635)

Could not rebase; Attempt merge onto 63c1bc3e0d...

Updating 63c1bc3e..3116ee26
Fast-forward
 swh/deposit/api/collection_list.py                 |   3 +-
 swh/deposit/cli/client.py                          |  28 ++++-
 swh/deposit/client.py                              | 109 ++++++++++++++++---
 swh/deposit/tests/cli/test_client.py               |  75 +++++++++++++
 .../tests/data/atom/entry-list-deposits-page1.xml  |  20 ++++
 .../tests/data/atom/entry-list-deposits-page2.xml  |  18 ++++
 .../tests/data/atom/entry-list-deposits.xml        |  30 ++++++
 .../data/https_deposit.test.list/1_servicedocument |  26 +++++
 .../1_test_list,page=1,page_size=10                |  30 ++++++
 swh/deposit/tests/test_client_module.py            | 119 +++++++++++++++++++++
 swh/deposit/utils.py                               |  13 +++
 11 files changed, 455 insertions(+), 16 deletions(-)
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits-page1.xml
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits-page2.xml
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits.xml
 create mode 100644 swh/deposit/tests/data/https_deposit.test.list/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.list/1_test_list,page=1,page_size=10
Changes applied before test
commit 3116ee2623fca1a33b092a2a1dcf333d0eaa7702
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon May 24 17:14:08 2021 +0200

    Open `swh deposit list` cli to allow user to list their deposits
    
    This does not provide any filters yet though. The result is paginated and "next" link
    will be displayed in the result. It's up to clients to make the subsequent calls to the
    cli to list the next deposits through the --page and --page-size flags.
$ swh deposit list --help
Usage: swh deposit list [OPTIONS]

  Deposit metadata only upload

Options:
  --url TEXT                      (Optional) Deposit server api endpoint. By
                                  default,
                                  https://deposit.softwareheritage.org/1

  --username TEXT                 (Mandatory) User's name  [required]
  --password TEXT                 (Mandatory) User's associated password
                                  [required]

  -f, --format [logging|yaml|json]
                                  Output format results.
  --page INTEGER                  Page number when requesting more information
  --page-size INTEGER             Page number when requesting more information
  -h, --help                      Show this message and exit.
```

This allows to list from the cli the user's deposits (no filter).

Related to T2996

commit fdae25cdd6d9673424c2bc3ea2b6b057c10856b9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Mon May 24 15:55:05 2021 +0200

client: Open a paginated list user deposits endpoint

Related to T2996
See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/660/ for more details.
vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/deposit/tests/cli/test_client.py
972

s/callable_fn/parse_fn/

This revision is now accepted and ready to land.May 25 2021, 10:21 AM
  • Adapt according to suggestion
  • rebase

Build is green

Patch application report for D5770 (id=20641)

Could not rebase; Attempt merge onto 63c1bc3e0d...

Updating 63c1bc3e..aa850c89
Fast-forward
 swh/deposit/api/collection_list.py                 |   3 +-
 swh/deposit/cli/client.py                          |  28 ++++-
 swh/deposit/client.py                              | 123 ++++++++++++++++++---
 swh/deposit/tests/cli/test_client.py               |  81 +++++++++++++-
 .../tests/data/atom/entry-list-deposits-page1.xml  |  20 ++++
 .../tests/data/atom/entry-list-deposits-page2.xml  |  18 +++
 .../tests/data/atom/entry-list-deposits.xml        |  30 +++++
 .../data/https_deposit.test.list/1_servicedocument |  26 +++++
 .../1_test_list,page=1,page_size=10                |  30 +++++
 swh/deposit/tests/test_client_module.py            | 119 ++++++++++++++++++++
 swh/deposit/utils.py                               |  13 +++
 11 files changed, 472 insertions(+), 19 deletions(-)
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits-page1.xml
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits-page2.xml
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits.xml
 create mode 100644 swh/deposit/tests/data/https_deposit.test.list/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.list/1_test_list,page=1,page_size=10
Changes applied before test
commit aa850c896751c38ae4d1540953149f58b5278a02
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon May 24 17:14:08 2021 +0200

    Open `swh deposit list` cli to allow user to list their deposits
    
    This does not provide any filters yet though. The result is paginated and "next" link
    will be displayed in the result. It's up to clients to make the subsequent calls to the
    cli to list the next deposits through the --page and --page-size flags.
$ swh deposit list --help
Usage: swh deposit list [OPTIONS]

  Deposit metadata only upload

Options:
  --url TEXT                      (Optional) Deposit server api endpoint. By
                                  default,
                                  https://deposit.softwareheritage.org/1

  --username TEXT                 (Mandatory) User's name  [required]
  --password TEXT                 (Mandatory) User's associated password
                                  [required]

  -f, --format [logging|yaml|json]
                                  Output format results.
  --page INTEGER                  Page number when requesting more information
  --page-size INTEGER             Page number when requesting more information
  -h, --help                      Show this message and exit.
```

This allows to list from the cli the user's deposits (no filter).

Related to T2996

commit 2813abc24c34326709899276c8bae0077083e680
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Mon May 24 15:55:05 2021 +0200

client: Open a paginated list user deposits endpoint

Related to T2996
See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/662/ for more details.

Build is green

Patch application report for D5770 (id=20643)

Could not rebase; Attempt merge onto 63c1bc3e0d...

Updating 63c1bc3e..ca03bf03
Fast-forward
 swh/deposit/api/collection_list.py                 |   3 +-
 swh/deposit/cli/client.py                          |  28 ++++-
 swh/deposit/client.py                              | 121 ++++++++++++++++++---
 swh/deposit/tests/cli/test_client.py               |  81 +++++++++++++-
 .../tests/data/atom/entry-list-deposits-page1.xml  |  20 ++++
 .../tests/data/atom/entry-list-deposits-page2.xml  |  18 +++
 .../tests/data/atom/entry-list-deposits.xml        |  30 +++++
 .../data/https_deposit.test.list/1_servicedocument |  26 +++++
 .../1_test_list,page=1,page_size=10                |  30 +++++
 swh/deposit/tests/test_client_module.py            | 119 ++++++++++++++++++++
 swh/deposit/utils.py                               |  13 +++
 11 files changed, 470 insertions(+), 19 deletions(-)
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits-page1.xml
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits-page2.xml
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits.xml
 create mode 100644 swh/deposit/tests/data/https_deposit.test.list/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.list/1_test_list,page=1,page_size=10
Changes applied before test
commit ca03bf03c627674ea7fc620daafddc5b07084d06
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon May 24 17:14:08 2021 +0200

    Open `swh deposit list` cli to allow user to list their deposits
    
    This does not provide any filters yet though. The result is paginated and "next" link
    will be displayed in the result. It's up to clients to make the subsequent calls to the
    cli to list the next deposits through the --page and --page-size flags.
$ swh deposit list --help
Usage: swh deposit list [OPTIONS]

  Deposit metadata only upload

Options:
  --url TEXT                      (Optional) Deposit server api endpoint. By
                                  default,
                                  https://deposit.softwareheritage.org/1

  --username TEXT                 (Mandatory) User's name  [required]
  --password TEXT                 (Mandatory) User's associated password
                                  [required]

  -f, --format [logging|yaml|json]
                                  Output format results.
  --page INTEGER                  Page number when requesting more information
  --page-size INTEGER             Page number when requesting more information
  -h, --help                      Show this message and exit.
```

This allows to list from the cli the user's deposits (no filter).

Related to T2996

commit 88f4ffd13ed4f38a12ff3684f52a09a5d79a19f0
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Mon May 24 15:55:05 2021 +0200

client: Open a paginated list user deposits endpoint

Related to T2996
See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/664/ for more details.

Rebase and adapt according to latest changes

Build is green

Patch application report for D5770 (id=20664)

Could not rebase; Attempt merge onto 77c229331e...

Updating 77c22933..3a23a50c
Fast-forward
 swh/deposit/cli/client.py                          |  28 ++++-
 swh/deposit/client.py                              | 121 ++++++++++++++++++---
 swh/deposit/tests/cli/test_client.py               |  81 +++++++++++++-
 .../tests/data/atom/entry-list-deposits-page1.xml  |  18 +++
 .../tests/data/atom/entry-list-deposits-page2.xml  |  16 +++
 .../tests/data/atom/entry-list-deposits.xml        |  28 +++++
 .../data/https_deposit.test.list/1_servicedocument |  26 +++++
 .../1_test,page=1,page_size=10                     |  28 +++++
 swh/deposit/tests/test_client_module.py            | 119 ++++++++++++++++++++
 swh/deposit/utils.py                               |  13 +++
 10 files changed, 460 insertions(+), 18 deletions(-)
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits-page1.xml
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits-page2.xml
 create mode 100644 swh/deposit/tests/data/atom/entry-list-deposits.xml
 create mode 100644 swh/deposit/tests/data/https_deposit.test.list/1_servicedocument
 create mode 100644 swh/deposit/tests/data/https_deposit.test.list/1_test,page=1,page_size=10
Changes applied before test
commit 3a23a50c353a3754fb1e69c7cce0412995f76f86
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon May 24 17:14:08 2021 +0200

    Open `swh deposit list` cli to allow user to list their deposits
    
    This does not provide any filters yet though. The result is paginated and "next" link
    will be displayed in the result. It's up to clients to make the subsequent calls to the
    cli to list the next deposits through the --page and --page-size flags.
$ swh deposit list --help
Usage: swh deposit list [OPTIONS]

  Deposit metadata only upload

Options:
  --url TEXT                      (Optional) Deposit server api endpoint. By
                                  default,
                                  https://deposit.softwareheritage.org/1

  --username TEXT                 (Mandatory) User's name  [required]
  --password TEXT                 (Mandatory) User's associated password
                                  [required]

  -f, --format [logging|yaml|json]
                                  Output format results.
  --page INTEGER                  Page number when requesting more information
  --page-size INTEGER             Page number when requesting more information
  -h, --help                      Show this message and exit.
```

This allows to list from the cli the user's deposits (no filter).

Related to T2996

commit 104a4e379941b1e95a06e986bd3ca49b4c6cd429
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Mon May 24 15:55:05 2021 +0200

client: Open a paginated list user deposits endpoint

Related to T2996
See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/668/ for more details.