Page MenuHomeSoftware Heritage

common/utils: Add function to get origin visit types dynamically
ClosedPublic

Authored by anlambert on Sep 8 2021, 5:42 PM.

Details

Summary

Instead of hardcoding the list of visit types that can be used in
search queries, retrieve it dynamically using swh-search.

Also remove visit_types from global template context processor
and move it to seach related views only to avoid sending a
request to elasticsearch on every page load.

Related to T3441

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 is green

Patch application report for D6219 (id=22499)

Rebasing onto e2b48563ac...

Current branch diff-target is up to date.
Changes applied before test
commit 3d6abb9ae1ae4fda752bfc58b9fffcfc4f0d985f
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Sep 8 16:43:58 2021 +0200

    common/utils: Add function to get origin visit types dynamically
    
    Instead of hardcoding the list of visit types that can be used in
    search queries, retrieve it dynamically using swh-search.
    
    Also remove visit_types from global template context processor
    and move it to seach related views only to avoid sending a
    request to elasticsearch on every page load.
    
    Related to T3441

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

This revision is now accepted and ready to land.Sep 9 2021, 10:13 AM