Deprecate most of the /browse/origin/.* URLs
swh-web
historically declares and uses origin centric URLs but most of them are now totally redundant with other ones.
For instance, /browse/origin/directory/?origin_url=https://github.com/python/cpython&path=Include/internal is equivalent to /browse/directory/ded25a0c00d4b1be1af5cb8a585de51bf5fad3be/?origin_url=https://github.com/python/cpython&path=Include/internal.
We should rather use URLs targeting archive first class citizens (content, directory, release, revision, snapshot) instead of those origin centric ones, thus we should deprecate them and replace their implementation by HTTP redirections to equivalent ones.
The following origin centric URLs can be deprecated in favor of those declared in swh/web/browse/views/<object_type>.py
:
/browse/origin/directory/
/browse/origin/(?P<origin_url>.+)/visit/(?P<timestamp>.+)/directory/
/browse/origin/(?P<origin_url>.+)/visit/(?P<timestamp>.+)/directory/(?P<path>.+)/
/browse/origin/(?P<origin_url>.+)/directory/(?P<path>.+)/
/browse/origin/(?P<origin_url>.+)/directory/
/browse/origin/content/
/browse/origin/(?P<origin_url>.+)/visit/(?P<timestamp>.+)/content/(?P<path>.+)/
/browse/origin/(?P<origin_url>.+)/content/(?P<path>.+)/
/browse/origin/(?P<origin_url>.+)/content/
/browse/origin/log/
/browse/origin/(?P<origin_url>.+)/visit/(?P<timestamp>.+)/log/
/browse/origin/(?P<origin_url>.+)/log/
/browse/origin/branches/", view_name="browse-origin-branches
/browse/origin/(?P<origin_url>.+)/visit/(?P<timestamp>.+)/branches/
/browse/origin/(?P<origin_url>.+)/branches/
/browse/origin/releases/
/browse/origin/(?P<origin_url>.+)/visit/(?P<timestamp>.+)/releases/
/browse/origin/(?P<origin_url>.+)/releases/
When deprecating those URLs, we must ensure that all arguments can still be passed as query parameters to the redirection URLs.
Migrated from T3608 (view on Phabricator)