adagios icon indicating copy to clipboard operation
adagios copied to clipboard

Merging views engine

Open titilambert opened this issue 10 years ago • 12 comments

Hello ! I rebased PR #391. This PR doesn't include the possibility to use external commands (rescheduled, ask, ...). I will add this feature in other PR when this one will be merged.

@matthieucan could you confirm or not this ? In adagios/status/templates/custom_views/widgets/link_host.html The current line :

<a href="{% url "status.views.detail" %}?host_name={{ value }}&backend={{ line.backend }}">{{ line|hash:col_name }}</a>

Should be

<a href="{% url "status.views.detail" %}?host_name={{ line|hash:col_name }}&backend={{ line.backend }}">{{ line|hash:col_name }}</a>

Thanks !

titilambert avatar Oct 21 '14 01:10 titilambert

@matthieucan do you have any idea about the build failed ? It happens only with django < 1.5 ...

titilambert avatar Oct 21 '14 03:10 titilambert

For the changed line: yes, I confirm you're right, 'col_name' and 'line' are passed as arguments to the widgets.

For the build fail: definitely a feature somewhere in custom_*.py, which is not in Django 1.4. Are you able to reproduce the bug locally? It should point you to the correct line.

matthieucan avatar Oct 21 '14 10:10 matthieucan

I get this error :

UnpicklingError at /status/custom/edit
invalid load key, '{'.
Request Method: GET
Request URL:    http://127.0.0.1:8000/status/custom/edit?datasource=hosts
Django Version: 1.4.15
Exception Type: UnpicklingError
Exception Value:    
invalid load key, '{'.
Exception Location: /home/titilambert/projets_opensource/adagios/env/local/lib/python2.7/site-packages/django/contrib/sessions/backends/signed_cookies.py in loads, line 21
Python Executable:  /home/titilambert/projets_opensource/adagios/env/bin/python
Python Version: 2.7.8
Python Path:    
['/home/titilambert/projets_opensource/adagios/adagios/..',
 '/home/titilambert/projets_opensource/adagios/adagios',
 '/home/titilambert/projets_opensource/adagios/env/lib/python2.7',
 '/home/titilambert/projets_opensource/adagios/env/lib/python2.7/plat-x86_64-linux-gnu',
 '/home/titilambert/projets_opensource/adagios/env/lib/python2.7/lib-tk',
 '/home/titilambert/projets_opensource/adagios/env/lib/python2.7/lib-old',
 '/home/titilambert/projets_opensource/adagios/env/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/home/titilambert/projets_opensource/adagios/env/local/lib/python2.7/site-packages',
 '/home/titilambert/projets_opensource/adagios/env/lib/python2.7/site-packages']
Server time:    Tue, 21 Oct 2014 09:12:47 -0400

The error is here (env/lib/python2.7/site-packages/django/contrib/sessions/backends/signed_cookies.py):

    def loads(self, data):
        return pickle.loads(data)

With data => {"django_language":"en"} type(data) => <type 'str'>

titilambert avatar Oct 21 '14 13:10 titilambert

No idea... don't you have a stack trace?

matthieucan avatar Oct 21 '14 13:10 matthieucan

@titilambert we switched from using file backed session cookies to using Signed Cookies. You should remove any cookies when moving between pre-django16 and django16 based code.

tomas-edwardsson avatar Oct 21 '14 14:10 tomas-edwardsson

@matthieucan did this help you ?

titilambert avatar Oct 21 '14 14:10 titilambert

@titilambert Unless I'm mistaken, no cookies are used in the views engine. Can this be a problem within travis-ci?

matthieucan avatar Oct 21 '14 23:10 matthieucan

FIXED !!!! @matthieucan I fixed some javascript calls. Could you valid this ?

Thanks !

titilambert avatar Oct 22 '14 03:10 titilambert

@titilambert This looks good! I don't have any environment to test it right now, but if it works with you, that's perfect!

matthieucan avatar Oct 22 '14 08:10 matthieucan

@palli @tomas-edwardsson it is correct for you ? Thank !

titilambert avatar Nov 05 '14 14:11 titilambert

Any news about it ? thank

titilambert avatar Dec 03 '14 14:12 titilambert

So, I am seeing a few problems with this patch, which have made me hesitant to merge it in. I think maybe we should discuss this a little more on our meeting tomorrow. Here are a few comments from the top of my head:

  • It is still very big. Not a lot to be done about that now, but as a reminder for next time, maybe we should aim for getting a minimal working copy first, and then add on complexities
  • Can we do this without datatable and jquery-ui dependencies? (We already have datatables, and we moved from jquery-ui in version 1.0)
  • For me, applying the branch caused unhandled traceback on all adagios views because of unsafe code added to the context processors. Is it possible to do this without context processors ?
  • The custom views backend code, is about the same size as the status app.. Please make it is own django app, called 'custom views'.

Are you guys still using this extension and/or actively developing it ?

palli avatar Dec 03 '14 22:12 palli