ICIJ / prophecies

An ICIJ app to conduct data validation and cleaning.
https://icij.gitbook.io/prophecies
GNU Affero General Public License v3.0
19 stars 4 forks source link

bug? self-hosted ui reports version 0.0.0 #202

Open gabriel-v opened 6 months ago

gabriel-v commented 6 months ago

In profile dropdown

Screenshot from 2024-03-20 18-40-24

But when I get into the container and check the python self-reported version, it works

poetry run python manage.py shell
Python 3.10.13 (main, Mar 12 2024, 12:16:25) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import pkg_resources; pkg_resources.get_distribution('prophecies').version
'0.5.14'
>>> import prophecies
>>> prophecies.VERSION
'0.5.14'
>>> 

I see some js here https://github.com/ICIJ/prophecies/blob/27a581f9cfd6a4cdbf927393693662060e53e532/prophecies/apps/frontend/src/components/AppVersion.vue#L6

Do I need to rebuild some js for version # to take effect?

pirhoo commented 6 months ago

The version is imported from this endpoint:

https://icij.github.io/prophecies/api.html#/operations/List%20Settings

Can you confirm you're not seen it in /api/v1/settings/?

gabriel-v commented 6 months ago

Ah, the dynamic settings from the admin. Yes I do not see version, only the stuff from the admin form.

I don't see it here either https://github.com/ICIJ/prophecies/blob/27a581f9cfd6a4cdbf927393693662060e53e532/prophecies/settings/base.py#L433

But I do see it if I vandalize that table

        (              
        cat <<EOPY    

        import os     
        # on Constance update to v3, import will change to constance.models or something    
        from constance.backends.database.models import Constance                            
        import prophecies                                                                   
        for key in ['appName', 'avatarUrlTemplate', 'loginAccountButton', 'orgName', 'logoutUrl', 'version']:    
            c, _ = Constance.objects.get_or_create(key=key)                                                      
            c.value = prophecies.VERSION if key == 'version' else os.getenv(key)                                 
            c.save()                                                                
            print(c, key, 'setting was set to', os.getenv(key))                     

        EOPY                                                       
        ) | make shell