Page MenuHomeSoftware Heritage

browse: Improve display of 404 errors for content and directory
ClosedPublic

Authored by anlambert on Dec 1 2020, 5:32 PM.

Details

Summary

When trying to browse a content or a directory in another object context
(snapshot, revision, directory), if the targetted object can not be found
(for instance after changing the current branch in a snapshot) display a
404 error while keeping display of context related UI to ease the navigation.

Also improve the displayed error message when a directory entry with a
given path can not be found from a root directory.

To better understand the introduced changes, below are some illustrative screenshots.

Previously when an object could not be found when changing context (for instance when
changing the current branch of a snapshot), a plain 404 error page was displayed and
the current browsing context UI was not displayed anymore.

With the changes in that diff, the 404 error will now be rendered while keeping the
browsing context UI to continue navigation without having to use the browser history.

The previous examples was related to snapshot context browsing but the same behavior
has also been implemented for revision and directory context.

Closes 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

Build has FAILED

Patch application report for D4639 (id=16464)

Rebasing onto 8492a4c688...

Current branch diff-target is up to date.
Changes applied before test
commit b7789b791c7eeac6b72923df47033419eff10f81
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue Dec 1 17:29:17 2020 +0100

    browse/snapshot_context: Improve display of 404 errors

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

Update: Rebase and fix cypress tests

Build is green

Patch application report for D4639 (id=16500)

Rebasing onto 8822b6aa63...

Current branch diff-target is up to date.
Changes applied before test
commit 4f8ea17d201ba70f5d86dabfd8a9b27245d3bc9c
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue Dec 1 17:29:17 2020 +0100

    browse/snapshot_context: Improve display of 404 errors
    
    When browsing a content or a directory in a snapshot context and the
    current branch is changed through the dedicated top left widget,
    if the content or the directory can not be found in that new branch
    display the 404 error while keeping snapshot related UI to ease
    the navigation.
    
    Closes T2353

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

Update: Improve displayed error message when a directory entry is not found

Build is green

Patch application report for D4639 (id=16501)

Rebasing onto 8822b6aa63...

Current branch diff-target is up to date.
Changes applied before test
commit 1f9ed5c08047a2bff3df10c1dc5142f07d765cff
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue Dec 1 17:29:17 2020 +0100

    browse/snapshot_context: Improve display of 404 errors
    
    When browsing a content or a directory in a snapshot context and the
    current branch is changed through the dedicated top left widget,
    if the content or the directory can not be found in that new branch
    display the 404 error while keeping snapshot related UI to ease
    the navigation.
    
    Closes T2353

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

Update: Also improve 404 error display when trying to browse a subdirectory in a root directory context and add tests to increase coverage

Build is green

Patch application report for D4639 (id=16526)

Rebasing onto ff0cc3631a...

Current branch diff-target is up to date.
Changes applied before test
commit ececc29101e3b7fd1f038adec6d7129a5aa3d7ba
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue Dec 1 17:29:17 2020 +0100

    browse: Improve display of 404 errors for content and directory
    
    When trying to browse a content or a directory in another object context
    (snapshot, revision, directory), if the targetted object can not be found
    (for instance after changing the current branch in a snapshot) display a
    404 error while keeping display of context related UI to ease the navigation.
    
    Also improve the displayed error message when a directory entry with a
    given path can not be found from a root directory.
    
    Closes T2353

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

anlambert retitled this revision from [WIP] browse/snapshot_context: Improve display of 404 errors to browse: Improve display of 404 errors for content and directory.Dec 3 2020, 5:44 PM
anlambert edited the summary of this revision. (Show Details)
vlorentz added a subscriber: vlorentz.

Cool! And it looks like it will reduce the errors reported to Sentry as well

This revision is now accepted and ready to land.Dec 4 2020, 11:28 AM

Cool! And it looks like it will reduce the errors reported to Sentry as well

Right, now these common NotFoundExc errors will not be processed by the Django exception handling middleware that send reports to sentry.