Page MenuHomeSoftware Heritage

templates/directory-display: Display message when directory/revision is missing
ClosedPublic

Authored by anlambert on Apr 21 2020, 7:01 PM.

Details

Summary

That message can only be displayed when browsing a directory in a snapshot
context, for instance when browsing a branch whith a non resolvable revision.

I picked a quite generic error message, maybe it could be improved to mention
the revision is not resolvable ?

Related to T2353

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont added a subscriber: ardumont.

I picked a quite generic error message, maybe it could be improved to mention
the revision is not resolvable ?

Can we, at the moment, discriminate between an unresolvable revision and an unresolvable directory ?

If we can, adding the switch case here would make sense, thus we'd have the means to have different messages.

Otherwise, that's fine ;)

This revision is now accepted and ready to land.Apr 21 2020, 7:07 PM

Build is green

Patch application report for D3042 (id=10810)

Rebasing onto 40ac1374bc...

Current branch diff-target is up to date.
Changes applied before test
commit a0a74ddc95fd9ff63821b6a481ec51ebef210477
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue Apr 21 18:55:10 2020 +0200

    templates/directory-display: Display message when directory is missing
    
    That message can only be displayed when browsing a directory in a snapshot
    context, for instance when browsing a branch whith a non resolvable revision.
    
    Related to T2353

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

Update: Improve error message for missing revision

anlambert retitled this revision from templates/directory-display: Display message when directory is missing to templates/directory-display: Display message when directory/revision is missing.Apr 21 2020, 7:30 PM

I added an extra check for the revision if the directory is None in order to improve error message.

Build has FAILED

Patch application report for D3042 (id=10811)

Rebasing onto 40ac1374bc...

Current branch diff-target is up to date.
Changes applied before test
commit eb992431b1544a02e3dc1bf257aec0fa526c4595
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue Apr 21 18:55:10 2020 +0200

    templates/directory-display: Display message for missing directory/revision
    
    That message can only be displayed when browsing a directory in a snapshot
    context, for instance when browsing a branch whith a non resolvable revision.
    
    Related to T2353

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

Yes, even better now.

(we are missing the test case about revision ok, revision.directory not found though)

we are missing the test case about revision ok

This is already implemented in test_origin_*_directory_view test cases (checking browsing a directory in an origin context is OK).

revision.directory not found though)

I should be able to work something out for that one.

revision.directory not found though)

I should be able to work something out for that one.

Yes, i meant only the 1 test case ;)

I should be able to work something out for that one.

Actually, it is already tested in test_browse_origin_directory_not_found.

There is already a 404 error page displayed when a directory in an origin context could not be found in the archive.

So I will only scope that diff for the branch with non resolvable revision case.

The way the browsing errors are displayed in a snapshot context still need to be improved though.

Ack

heads up, i had to clean up the staging infra so don't worry if you don't find back the data there.

context is T2371#43636

Ack, I will land the diff and push a new swh-web tag.

I will get back on T2353 once I finished to implement T2342.

Yes, please.

And thanks again ;)

Update: Remove redundant error message in template and prevent django.template.base.VariableDoesNotExist exception

Build has FAILED

Patch application report for D3042 (id=10813)

Rebasing onto 40ac1374bc...

Current branch diff-target is up to date.
Changes applied before test
commit a150993fac873cc7faaf4100dd918605c02af32e
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue Apr 21 18:55:10 2020 +0200

    templates/directory-display: Display message for missing directory/revision
    
    That message can only be displayed when browsing a directory in a snapshot
    context, for instance when browsing a branch whith a non resolvable revision.
    
    Related to T2353

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

Update: Fix test syntax in django template (no line break allowed, sigh ...)

Build is green

Patch application report for D3042 (id=10814)

Rebasing onto 40ac1374bc...

Current branch diff-target is up to date.
Changes applied before test
commit 09e18940394e6b676b245017c2507f8b9b0638b3
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue Apr 21 18:55:10 2020 +0200

    templates/directory-display: Display message for missing directory/revision
    
    That message can only be displayed when browsing a directory in a snapshot
    context, for instance when browsing a branch whith a non resolvable revision.
    
    Related to T2353

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