Page MenuHomeSoftware Heritage

assets/save: Improve links in save requests table
ClosedPublic

Authored by anlambert on Jun 8 2020, 4:12 PM.

Details

Summary

Make the main link in each row targets the origin copy in the archive
if it has been successfully loaded.

Add a link to each origin through an external link icon.

Closes T2405

Test Plan

A new cypress test has been added checking expected save requests table display.

Diff Detail

Repository
rDWAPPS Web applications
Branch
save-code-now-better-links
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 12702
Build 19314: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 19313: arc lint + arc unit

Unit TestsFailed

TimeTest
0 msJenkins > should display origin save info in the requests table::Tests / Cypress tests / Run cypress tests / Origin Save Tests should display origin save info in the requests table
AssertionError: expected '<a href="/browse/origin/?origin_url=https://gitlab.inria.fr/solverstack/maphys/maphys/%26timestamp%3D2020-03-25T16%3A23%3A15.309379%2B00%3A00">https://gitlab.inria.fr/solverstack/maphys/maphys/</a>&nbsp;<a href="https://gitlab.inria.fr/solverstack/maphys/maphys/"><i class="fa fa-external-link" aria-hidden="true"></i></a>' to equal '<a href="/browse/origin/?origin_url=https://gitlab.inria.fr/solverstack/maphys/maphys/&amp;timestamp=2020-03-25T16:23:15.309379+00:00">https://gitlab.inria.fr/solverstack/maphys/maphys/</a>&nbsp;<a href="https://gitlab.inria.fr/solverstack/maphys/maphys/"><i class="fa fa-external-link" aria-hidden="true"></i></a>' at Context.eval (http://localhost:5004/__cypress/tests?p=cypress/integration/origin-save.spec.js:166:20)
381 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.admin.test_origin_save::Tests / Python tests / test_accept_pending_save_request
1,539 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.admin.test_origin_save::Tests / Python tests / test_add_authorized_origin_url
188 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.admin.test_origin_save::Tests / Python tests / test_add_unauthorized_origin_url
210 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.admin.test_origin_save::Tests / Python tests / test_reject_pending_save_request
View Full Test Results (1 Failed · 517 Passed · 7 Skipped)

Event Timeline

Build has FAILED

Patch application report for D3243 (id=11497)

Rebasing onto 3e17ef162e...

Current branch diff-target is up to date.
Changes applied before test
commit 6b1506fbf43f7273ef2c1752074ef3008b94a952
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Mon Jun 8 16:10:53 2020 +0200

    assets/save: Improve links in save requests table
    
    Make the main link in each row targets the origin copy in the archive
    if it has been successfully loaded.
    
    Add a link to each origin through an external link icon.
    
    Closes T2405

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

Update: Fix origin browse urls and add same requests table updates to admin interface.

Build is green

Patch application report for D3243 (id=11498)

Rebasing onto 3e17ef162e...

Current branch diff-target is up to date.
Changes applied before test
commit 086efa0b58f1f92860fc8c0b27c3fa370069c3a4
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Mon Jun 8 16:10:53 2020 +0200

    assets/save: Improve links in save requests table
    
    Make the main link in each row targets the origin copy in the archive
    if it has been successfully loaded.
    
    Add a link to each origin through an external link icon.
    
    Closes T2405

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

ardumont added a subscriber: ardumont.

Thanks.

Got a couple of questions to improve myself ;)

Cheers,

cypress/integration/origin-save.spec.js
162

Interesting to have the data in a dedicated json file.

That would be an improvment for the deposit-admin related tests (which need some more iteration from a more knowledgeable person by the way /wink /wink ;)

What I don't see here is who does the join between the origin-save.json file and that originSaveJSON content?

169

do you use const to tell that's immutable (against say let here)?

This revision is now accepted and ready to land.Jun 9 2020, 10:33 AM
cypress/integration/origin-save.spec.js
162

What I don't see here is who does the join between the origin-save.json file and that originSaveJSON content?

Cypress magic ;-)

169

Exactly !

ack on your response, thanks ;)