Page MenuHomeSoftware Heritage

Allow privileged user to trigger save code now bundle visit type
ClosedPublic

Authored by ardumont on May 4 2021, 7:15 PM.

Details

Summary

This adapts the ui so an ambassador can actually schedule save code now requests of type
bundle [2]. This new bundle type is only reachable from a privileged user.

Other users sees their ui as before.

[1] D5676#inline-39724

[2]

Related to T3213

Depends on D5696

Test Plan

tox
cypress

Diff Detail

Repository
rDWAPPS Web applications
Branch
add-new-bundle
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 21261
Build 33015: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 33014: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
  • Rebase
  • Fix parsing date and serialization issue
  • successful run through docker

Still remains to add tests

Build has FAILED

Patch application report for D5676 (id=20283)

Rebasing onto f8c750b65a...

Current branch diff-target is up to date.
Changes applied before test
commit 0e8c84a4681a782a12323381a1e2dec727d9225f
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue May 4 14:45:36 2021 +0200

    wip: Add new bundle type
    
    This is preparatory work:
    - not yet tested
    - nor completely ok in terms of ui (e.g. some data is hard-coded to ease manual input,
      some input is not ok regarding css).
    
    Remains to:
    - add tests
    - make the bundle type only show up when a user is connected and and is an actual ambassador
    
    Related to T3213

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

Harbormaster returned this revision to the author for changes because remote builds failed.May 5 2021, 12:11 PM
Harbormaster failed remote builds in B21269: Diff 20283!

Build has FAILED

Patch application report for D5676 (id=20324)

Could not rebase; Attempt merge onto 934cb65cdf...

Updating 934cb65c..df802666
Fast-forward
 assets/src/bundles/save/index.js         |  50 ++++++++++++--
 assets/src/bundles/save/save.css         |  10 +++
 swh/web/api/views/origin_save.py         |  23 +++++--
 swh/web/auth/utils.py                    |  11 +++
 swh/web/common/origin_save.py            | 115 ++++++++++++++++++++++---------
 swh/web/common/swh_templatetags.py       |   7 +-
 swh/web/common/typing.py                 |   2 +-
 swh/web/misc/origin_save.py              |   8 ++-
 swh/web/templates/misc/origin-save.html  |  21 +++++-
 swh/web/tests/common/test_origin_save.py |  47 ++++++++++++-
 swh/web/tests/misc/test_origin_save.py   |  43 ++++++++++--
 11 files changed, 277 insertions(+), 60 deletions(-)
 create mode 100644 assets/src/bundles/save/save.css
Changes applied before test
commit df80266697c14701b4138c45ad887dbd93e9faf6
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:41:34 2021 +0200

    wip: Add new bundle type
    
    This is preparatory work:
    - not yet tested
    - nor completely ok in terms of ui (e.g. some data is hard-coded to ease manual input,
      some input is not ok regarding css).
    
    Remains to:
    - add tests
    - make the bundle type only show up when a user is connected and and is an actual ambassador
    
    Related to T3213

commit bba3c8cb1ec47367cea6ec7fa91ad4725957f6f0
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:25:33 2021 +0200

    Add new bundle type to list only when connected as privileged user
    
    This is only doing listing for now. It's in a dedicated commit so review is easier.
    
    Some more work is required ui and server side to actually schedule those new visit type.
    It will be done in a future commit.
    
    Related to T3213

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

Harbormaster returned this revision to the author for changes because remote builds failed.May 6 2021, 9:43 AM
Harbormaster failed remote builds in B21306: Diff 20324!
ardumont retitled this revision from wip: Add new bundle type to wip: Allow privileged user to trigger save code now bundle visit type.May 6 2021, 10:07 AM
ardumont edited the summary of this revision. (Show Details)

Start adding the frontend tests

Remains:

  • one last test to actually check the bundle submission is ok
  • fix the css rendering
ardumont edited the test plan for this revision. (Show Details)
swh/web/tests/common/test_origin_save.py
428 ↗(On Diff #20369)

should mentioned as comment that the date is not in a expected parsable format thus the None below.

Build is green

Patch application report for D5676 (id=20369)

Could not rebase; Attempt merge onto 43636f47d5...

Updating 43636f47..2e5924e2
Fast-forward
 assets/src/bundles/save/index.js         |  41 ++++++++--
 assets/src/bundles/save/save.css         |  10 +++
 cypress/integration/origin-save.spec.js  |  42 ++++++++++
 cypress/support/index.js                 |   4 +
 swh/web/api/views/origin_save.py         |  16 ++--
 swh/web/auth/utils.py                    |  11 +++
 swh/web/common/origin_save.py            | 130 +++++++++++++++++++++++--------
 swh/web/common/swh_templatetags.py       |   7 +-
 swh/web/common/typing.py                 |   2 +-
 swh/web/misc/origin_save.py              |   8 +-
 swh/web/templates/misc/origin-save.html  |  21 ++++-
 swh/web/tests/api/test_throttling.py     |  15 +---
 swh/web/tests/common/test_origin_save.py |  58 +++++++++++++-
 swh/web/tests/create_test_users.py       |  23 ++++--
 swh/web/tests/misc/test_origin_save.py   |  45 +++++++++--
 swh/web/tests/test_create_users.py       |  16 ++++
 swh/web/tests/utils.py                   |  24 +++++-
 17 files changed, 395 insertions(+), 78 deletions(-)
 create mode 100644 assets/src/bundles/save/save.css
 create mode 100644 swh/web/tests/test_create_users.py
Changes applied before test
commit 2e5924e2910dab3450559367b6bab644b11e2ec3
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:41:34 2021 +0200

    Allow privileged user to trigger save code now bundle visit type
    
    Related to T3213

commit c89d1c270d08fce71b008c0368e13c1337a43d69
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu May 6 14:05:15 2021 +0200

    tests: Add new ambassador user for frontend tests
    
    This refactor existing permission code to allow creation of user with some permissions.
    
    Related to T3213

commit 1a2c53716cbeaedf7492702324fbcfbfd6c9ae18
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:25:33 2021 +0200

    Add new bundle type to list only when connected as privileged user
    
    This is only doing listing for now. It's in a dedicated commit so review is easier.
    
    Some more work is required ui and server side to actually schedule those new visit type.
    It will be done in a future commit.
    
    Related to T3213

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

  • Add python test to cover the bundle type
  • Add frontend tests to ensure the ui behaves as expected.
ardumont retitled this revision from wip: Allow privileged user to trigger save code now bundle visit type to Allow privileged user to trigger save code now bundle visit type.
swh/web/templates/misc/origin-save.html
66

@anlambert That dom part does not display as i'd like (all aligned in one row), no idea what's wrong though.

I want them as ^ so the view would be unified with the initial input form.
But instead, each pair (label, input, ok together), are on a dedicated line like:

<artifact-url>
<artifact-filename>
<artifact-version>

Instead of being one inlined row like:

<artifact-url> <artifact-filename> <artifact-version>

Any idea what's wrong from the top of your head? I tried stuff to no avail (use span,
play with col-md-x, ...).

Build is green

Patch application report for D5676 (id=20381)

Could not rebase; Attempt merge onto 43636f47d5...

Updating 43636f47..bb7fd9e7
Fast-forward
 assets/src/bundles/save/index.js            |  41 +++++++--
 assets/src/bundles/save/save.css            |  10 +++
 cypress/integration/origin-save.spec.js     |  79 +++++++++++++++++
 cypress/support/index.js                    |   4 +
 swh/web/api/views/origin_save.py            |  16 ++--
 swh/web/auth/utils.py                       |  11 +++
 swh/web/common/origin_save.py               | 132 +++++++++++++++++++++-------
 swh/web/common/swh_templatetags.py          |   7 +-
 swh/web/common/typing.py                    |   2 +-
 swh/web/misc/origin_save.py                 |   8 +-
 swh/web/templates/misc/origin-save.html     |  21 ++++-
 swh/web/tests/api/test_throttling.py        |  15 +---
 swh/web/tests/api/views/test_origin_save.py |  72 ++++++++++++++-
 swh/web/tests/common/test_origin_save.py    |  61 ++++++++++++-
 swh/web/tests/create_test_users.py          |  23 +++--
 swh/web/tests/misc/test_origin_save.py      |  45 ++++++++--
 swh/web/tests/test_create_users.py          |  16 ++++
 swh/web/tests/utils.py                      |  24 ++++-
 18 files changed, 508 insertions(+), 79 deletions(-)
 create mode 100644 assets/src/bundles/save/save.css
 create mode 100644 swh/web/tests/test_create_users.py
Changes applied before test
commit bb7fd9e78a56644f1ea08ae818044ce459630919
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:41:34 2021 +0200

    Allow privileged user to trigger save code now bundle visit type
    
    Related to T3213

commit c89d1c270d08fce71b008c0368e13c1337a43d69
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu May 6 14:05:15 2021 +0200

    tests: Add new ambassador user for frontend tests
    
    This refactor existing permission code to allow creation of user with some permissions.
    
    Related to T3213

commit 1a2c53716cbeaedf7492702324fbcfbfd6c9ae18
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:25:33 2021 +0200

    Add new bundle type to list only when connected as privileged user
    
    This is only doing listing for now. It's in a dedicated commit so review is easier.
    
    Some more work is required ui and server side to actually schedule those new visit type.
    It will be done in a future commit.
    
    Related to T3213

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

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

Rebase

Build is green

Patch application report for D5676 (id=20405)

Could not rebase; Attempt merge onto fcf53f1ec3...

Updating fcf53f1e..9518d4bb
Fast-forward
 assets/src/bundles/save/index.js            |  41 +++++++--
 assets/src/bundles/save/save.css            |  10 +++
 cypress/integration/origin-save.spec.js     |  79 +++++++++++++++++
 cypress/support/index.js                    |   4 +
 swh/web/api/views/origin_save.py            |  16 ++--
 swh/web/auth/utils.py                       |  11 +++
 swh/web/common/origin_save.py               | 132 +++++++++++++++++++++-------
 swh/web/common/swh_templatetags.py          |   7 +-
 swh/web/common/typing.py                    |   2 +-
 swh/web/misc/origin_save.py                 |   8 +-
 swh/web/templates/misc/origin-save.html     |  21 ++++-
 swh/web/tests/api/test_throttling.py        |  15 +---
 swh/web/tests/api/views/test_origin_save.py |  72 ++++++++++++++-
 swh/web/tests/common/test_origin_save.py    |  61 ++++++++++++-
 swh/web/tests/create_test_users.py          |  23 +++--
 swh/web/tests/misc/test_origin_save.py      |  45 ++++++++--
 swh/web/tests/test_create_users.py          |  16 ++++
 swh/web/tests/utils.py                      |  24 ++++-
 18 files changed, 508 insertions(+), 79 deletions(-)
 create mode 100644 assets/src/bundles/save/save.css
 create mode 100644 swh/web/tests/test_create_users.py
Changes applied before test
commit 9518d4bb911b47eb9efff616147b0d0236d4b160
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:41:34 2021 +0200

    Allow privileged user to trigger save code now bundle visit type
    
    Related to T3213

commit 47a07f155d978b06b18cdbda6b6912005144ce28
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu May 6 14:05:15 2021 +0200

    tests: Add new ambassador user for frontend tests
    
    This refactor existing permission code to allow creation of user with some permissions.
    
    Related to T3213

commit 11d7c4ef5fedac657953e1e610eb5a7ccab7c9c4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:25:33 2021 +0200

    Add new bundle type to list only when connected as privileged user
    
    This is only doing listing for now. It's in a dedicated commit so review is easier.
    
    Some more work is required ui and server side to actually schedule those new visit type.
    It will be done in a future commit.
    
    Related to T3213

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

The new introduced UI elements should be explained when switching to the bundle visit type.

Do you plan to handle multiple artifacts in that diff or in another one ?

assets/src/bundles/save/index.js
53

you need to use flex instead of block here to match bootstrap layout and correctly align the inputs..

assets/src/bundles/save/save.css
8–10

you can directly add style="display: none;" in the HTML template instead.

swh/web/api/views/origin_save.py
15

not used it seems

swh/web/templates/misc/origin-save.html
52

you should add a paragraph above explaining how the bundle loader is working and why the fields below are required.

55–64

If you explain in the paragraph that each row corresponds to artifact info, you can drop the Artifact prefix in the labels.

This revision now requires changes to proceed.May 7 2021, 4:57 PM

Do you plan to handle multiple artifacts in that diff or in another one ?

My understanding of the plan was first to deal with one artifact so the one.

swh/web/api/views/origin_save.py
15

nope, it got there initially to see debug output.

ardumont added inline comments.
swh/web/templates/misc/origin-save.html
52

a plain html paragraph you mean, right?

My understanding of the plan was first to deal with one artifact so the one.

I did not understand it that way, we said that we should not try to automatically list tarballs from a remote HTTP server
but user should be able to add multiple artifacts to save under the same origin.

This should not be too complicated to implement now but this will require to add new buttons to insert / remove artifacts.
Also errors related to a given artifact should be mapped to its associated input elements if something went wrong
after a submission.

swh/web/templates/misc/origin-save.html
52

yes

Build is green

Patch application report for D5676 (id=20421)

Could not rebase; Attempt merge onto fcf53f1ec3...

Updating fcf53f1e..1e2ab523
Fast-forward
 assets/src/bundles/save/index.js            |  40 +++++++--
 assets/src/bundles/save/save.css            |  10 +++
 cypress/integration/origin-save.spec.js     |  79 +++++++++++++++++
 cypress/support/index.js                    |   4 +
 swh/web/api/views/origin_save.py            |  12 +--
 swh/web/auth/utils.py                       |  11 +++
 swh/web/common/origin_save.py               | 132 +++++++++++++++++++++-------
 swh/web/common/swh_templatetags.py          |   7 +-
 swh/web/common/typing.py                    |   2 +-
 swh/web/misc/origin_save.py                 |   8 +-
 swh/web/templates/misc/origin-save.html     |  22 ++++-
 swh/web/tests/api/test_throttling.py        |  15 +---
 swh/web/tests/api/views/test_origin_save.py |  72 ++++++++++++++-
 swh/web/tests/common/test_origin_save.py    |  61 ++++++++++++-
 swh/web/tests/create_test_users.py          |  23 +++--
 swh/web/tests/misc/test_origin_save.py      |  45 ++++++++--
 swh/web/tests/test_create_users.py          |  16 ++++
 swh/web/tests/utils.py                      |  24 ++++-
 18 files changed, 504 insertions(+), 79 deletions(-)
 create mode 100644 assets/src/bundles/save/save.css
 create mode 100644 swh/web/tests/test_create_users.py
Changes applied before test
commit 1e2ab52391e7079c82e53c23a9656dd4d94ba48e
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:41:34 2021 +0200

    Allow privileged user to trigger save code now bundle visit type
    
    Related to T3213

commit 47a07f155d978b06b18cdbda6b6912005144ce28
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu May 6 14:05:15 2021 +0200

    tests: Add new ambassador user for frontend tests
    
    This refactor existing permission code to allow creation of user with some permissions.
    
    Related to T3213

commit 11d7c4ef5fedac657953e1e610eb5a7ccab7c9c4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:25:33 2021 +0200

    Add new bundle type to list only when connected as privileged user
    
    This is only doing listing for now. It's in a dedicated commit so review is easier.
    
    Some more work is required ui and server side to actually schedule those new visit type.
    It will be done in a future commit.
    
    Related to T3213

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

assets/src/bundles/save/save.css
8–10

right, done.

(I just forgot to also drop the file)

swh/web/templates/misc/origin-save.html
66

the flex style mentioned early on fixed that ^.

I did not understand it that way, we said that we should not try to automatically list tarballs from a remote HTTP server
but user should be able to add multiple artifacts to save under the same origin.

(I initially missed that comment)

ok

I thought this was a second step. Thus my initial summary comment in the task [1]

I propose we do the multiple artifacts submission in a subsidiary diff then.

[1] T3213#64391

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

Drop no longer required save.css

Build is green

Patch application report for D5676 (id=20432)

Could not rebase; Attempt merge onto 72c6b95c6d...

Merge made by the 'recursive' strategy.
 assets/src/bundles/save/index.js            |  40 +++++++--
 cypress/integration/origin-save.spec.js     |  79 +++++++++++++++++
 cypress/support/index.js                    |   4 +
 swh/web/api/views/origin_save.py            |  12 +--
 swh/web/auth/utils.py                       |  11 +++
 swh/web/common/origin_save.py               | 132 +++++++++++++++++++++-------
 swh/web/common/swh_templatetags.py          |   7 +-
 swh/web/common/typing.py                    |   2 +-
 swh/web/misc/origin_save.py                 |   8 +-
 swh/web/templates/misc/origin-save.html     |  22 ++++-
 swh/web/tests/api/test_throttling.py        |  15 +---
 swh/web/tests/api/views/test_origin_save.py |  72 ++++++++++++++-
 swh/web/tests/common/test_origin_save.py    |  61 ++++++++++++-
 swh/web/tests/create_test_users.py          |  23 +++--
 swh/web/tests/misc/test_origin_save.py      |  45 ++++++++--
 swh/web/tests/test_create_users.py          |  16 ++++
 swh/web/tests/utils.py                      |  24 ++++-
 17 files changed, 494 insertions(+), 79 deletions(-)
 create mode 100644 swh/web/tests/test_create_users.py
Changes applied before test
commit 4f829975bd4a9ba6745fc55f644ab852c372baf1
Merge: 72c6b95c fc6d954f
Author: Jenkins user <jenkins@localhost>
Date:   Mon May 10 12:14:36 2021 +0000

    Merge branch 'diff-target' into HEAD

commit fc6d954f395175533ad2aaf7b39b1eeafb83f0ca
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:41:34 2021 +0200

    Allow privileged user to trigger save code now bundle visit type
    
    Related to T3213

commit 47a07f155d978b06b18cdbda6b6912005144ce28
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu May 6 14:05:15 2021 +0200

    tests: Add new ambassador user for frontend tests
    
    This refactor existing permission code to allow creation of user with some permissions.
    
    Related to T3213

commit 11d7c4ef5fedac657953e1e610eb5a7ccab7c9c4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:25:33 2021 +0200

    Add new bundle type to list only when connected as privileged user
    
    This is only doing listing for now. It's in a dedicated commit so review is easier.
    
    Some more work is required ui and server side to actually schedule those new visit type.
    It will be done in a future commit.
    
    Related to T3213

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

Build is green

Patch application report for D5676 (id=20441)

Could not rebase; Attempt merge onto 1e97586914...

Updating 1e975869..2577546a
Fast-forward
 Makefile.local                              |  12 +--
 assets/src/bundles/save/index.js            |  40 +++++++--
 cypress/integration/origin-save.spec.js     |  79 +++++++++++++++++
 cypress/support/index.js                    |   4 +
 swh/web/api/views/origin_save.py            |  12 +--
 swh/web/auth/utils.py                       |  11 +++
 swh/web/common/origin_save.py               | 132 +++++++++++++++++++++-------
 swh/web/common/swh_templatetags.py          |   7 +-
 swh/web/common/typing.py                    |   2 +-
 swh/web/misc/origin_save.py                 |   8 +-
 swh/web/templates/misc/origin-save.html     |  22 ++++-
 swh/web/tests/api/test_throttling.py        |  15 +---
 swh/web/tests/api/views/test_origin_save.py |  72 ++++++++++++++-
 swh/web/tests/common/test_origin_save.py    |  61 ++++++++++++-
 swh/web/tests/create_test_users.py          |  23 +++--
 swh/web/tests/misc/test_origin_save.py      |  45 ++++++++--
 swh/web/tests/test_create_users.py          |  16 ++++
 swh/web/tests/utils.py                      |  24 ++++-
 18 files changed, 501 insertions(+), 84 deletions(-)
 create mode 100644 swh/web/tests/test_create_users.py
Changes applied before test
commit 2577546a6086fef63390156a32b9351d9ebee3a4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:41:34 2021 +0200

    Allow privileged user to trigger save code now bundle visit type
    
    Related to T3213

commit d20f94c04f29ebc85f1eed608b3ed7c130b78d7b
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu May 6 14:05:15 2021 +0200

    tests: Add new ambassador user for frontend tests
    
    This refactor existing permission code to allow creation of user with some permissions.
    
    This reworks the Makefile.local to create the users accordingly in different targets.
    
    Related to T3213

commit 2a4f2e966a034e034a736e7e10b2b572ef32c89b
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:25:33 2021 +0200

    Add new bundle type to list only when connected as privileged user
    
    This is only doing listing for now. It's in a dedicated commit so review is easier.
    
    Some more work is required ui and server side to actually schedule those new visit type.
    It will be done in a future commit.
    
    Related to T3213

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

Build is green

Patch application report for D5676 (id=20445)

Could not rebase; Attempt merge onto 1e97586914...

Updating 1e975869..bd095c6a
Fast-forward
 Makefile.local                              |  18 ++--
 assets/src/bundles/save/index.js            |  40 +++++++--
 cypress/integration/origin-save.spec.js     |  79 +++++++++++++++++
 cypress/support/index.js                    |   4 +
 swh/web/api/views/origin_save.py            |  12 +--
 swh/web/auth/utils.py                       |  11 +++
 swh/web/common/origin_save.py               | 132 +++++++++++++++++++++-------
 swh/web/common/swh_templatetags.py          |   7 +-
 swh/web/common/typing.py                    |   2 +-
 swh/web/misc/origin_save.py                 |   8 +-
 swh/web/templates/misc/origin-save.html     |  22 ++++-
 swh/web/tests/api/test_throttling.py        |  15 +---
 swh/web/tests/api/views/test_origin_save.py |  72 ++++++++++++++-
 swh/web/tests/common/test_origin_save.py    |  61 ++++++++++++-
 swh/web/tests/create_test_users.py          |  23 +++--
 swh/web/tests/misc/test_origin_save.py      |  45 ++++++++--
 swh/web/tests/test_create_users.py          |  16 ++++
 swh/web/tests/utils.py                      |  24 ++++-
 18 files changed, 504 insertions(+), 87 deletions(-)
 create mode 100644 swh/web/tests/test_create_users.py
Changes applied before test
commit bd095c6a4b161576a9680847e92aebd9559e74c1
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:41:34 2021 +0200

    Allow privileged user to trigger save code now bundle visit type
    
    Related to T3213

commit 1c8708c1fdf393c36ad7179fbd7bc7596b64f6ee
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu May 6 14:05:15 2021 +0200

    tests: Add new ambassador user for frontend tests
    
    This refactor existing permission code to allow creation of user with some permissions.
    
    This reworks the Makefile.local to create the users accordingly in different targets.
    
    Related to T3213

commit 2a4f2e966a034e034a736e7e10b2b572ef32c89b
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:25:33 2021 +0200

    Add new bundle type to list only when connected as privileged user
    
    This is only doing listing for now. It's in a dedicated commit so review is easier.
    
    Some more work is required ui and server side to actually schedule those new visit type.
    It will be done in a future commit.
    
    Related to T3213

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

Build is green

Patch application report for D5676 (id=20451)

Could not rebase; Attempt merge onto 1e97586914...

Updating 1e975869..34bbf06e
Fast-forward
 assets/src/bundles/save/index.js            |  40 +++++++--
 cypress/integration/origin-save.spec.js     |  79 +++++++++++++++++
 cypress/support/index.js                    |   4 +
 swh/web/api/views/origin_save.py            |  12 +--
 swh/web/auth/utils.py                       |  11 +++
 swh/web/common/origin_save.py               | 132 +++++++++++++++++++++-------
 swh/web/common/swh_templatetags.py          |   7 +-
 swh/web/common/typing.py                    |   2 +-
 swh/web/misc/origin_save.py                 |   8 +-
 swh/web/templates/misc/origin-save.html     |  22 ++++-
 swh/web/tests/api/test_throttling.py        |  15 +---
 swh/web/tests/api/views/test_origin_save.py |  72 ++++++++++++++-
 swh/web/tests/common/test_origin_save.py    |  61 ++++++++++++-
 swh/web/tests/create_test_users.py          |  23 +++--
 swh/web/tests/misc/test_origin_save.py      |  45 ++++++++--
 swh/web/tests/test_create_users.py          |  16 ++++
 swh/web/tests/utils.py                      |  24 ++++-
 17 files changed, 494 insertions(+), 79 deletions(-)
 create mode 100644 swh/web/tests/test_create_users.py
Changes applied before test
commit 34bbf06e4e29c95d92c3c458b35c715432662e17
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:41:34 2021 +0200

    Allow privileged user to trigger save code now bundle visit type
    
    Related to T3213

commit ee8ece2e6b2c2820a2ee493f9f7f7ff987eaa6f4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu May 6 14:05:15 2021 +0200

    tests: Add new ambassador user for frontend tests
    
    This refactor existing permission code to allow creation of user with some permissions.
    
    This reworks the Makefile.local to create the users accordingly in different targets.
    
    Related to T3213

commit 2a4f2e966a034e034a736e7e10b2b572ef32c89b
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed May 5 15:25:33 2021 +0200

    Add new bundle type to list only when connected as privileged user
    
    This is only doing listing for now. It's in a dedicated commit so review is easier.
    
    Some more work is required ui and server side to actually schedule those new visit type.
    It will be done in a future commit.
    
    Related to T3213

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

From discussion with @anlambert:

  • Drop filename input as this can be derived by the loader already
  • Make apparent the mandatory inputs (version, ...) [1]
  • Add some help field for the new inputs [2]

@anlambert will take care to improve that ui to make the multiple artifacts submission possible.

[1] https://getbootstrap.com/docs/4.0/components/forms/#browser-defaults
[2] https://getbootstrap.com/docs/4.6/components/forms/#help-text

Looks good to me for that part. The save archives feature still needs some improvements before offering it to ambassadors but this will be handled in other diffs.

This revision is now accepted and ready to land.May 11 2021, 11:43 AM
  • Drop filename input as this can be derived by the loader already
  • Make apparent the mandatory inputs (version, ...) [1]
  • Add some help field for the new inputs [2]

@anlambert will take care to improve that ui to make the multiple artifacts submission possible.

[1] https://getbootstrap.com/docs/4.0/components/forms/#browser-defaults
[2] https://getbootstrap.com/docs/4.6/components/forms/#help-text

D5738 should take care of that part.