Page MenuHomeSoftware Heritage

browse/snapshot_context: Handle empty revisions history in log view
ClosedPublic

Authored by anlambert on Jan 10 2022, 3:45 PM.

Details

Summary

It now exists in the archive snapshot containing only releases targeting
directories (typically those generated by the package loaders).

Thus these snapshots do not contain any revisions, this was leading to a
server error when trying to browse their history view.

Now a 404 error will be returned when trying to browse the revisions
history of such snapshots.

Related to T3840

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

Would it make sense to hide the "history" button from the directory view?

Build is green

Patch application report for D6898 (id=25013)

Rebasing onto b68b37df41...

Current branch diff-target is up to date.
Changes applied before test
commit 4ddf1b5598dc07bb23f28b29b7f50b3979e906e9
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Jan 10 15:38:39 2022 +0100

    browse/snapshot_context: Handle empty revisions history in log view
    
    It now exists in the archive snapshot containing only releases targeting
    directories (typically those generated by the package loaders).
    
    Thus these snapshots do not contain any revisions, this was leading to a
    server error when trying to browse their history view.
    
    Now a 404 error will be returned when trying to browse the revisions
    history of such snapshots.
    
    Related to T3840

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

Would it make sense to hide the "history" button from the directory view?

Yes it would I think, the revision_id in the snapshot context is obtained either:

  • from the tip revision of a browsed branch
  • the targeted revision of a browsed release
  • from the revision query parameter of a browse view

If it is None, we are sure there is no revisions history in the current browsing context.

I will do it in another diff.

I will do it in another diff.

So it turns out the button should have been hidden but a variable was not set the right way, fixed in D6899.

This revision is now accepted and ready to land.Jan 10 2022, 4:42 PM