Bug 7318 - Managed mode must use sessions to remember user search/orderby preferences
Summary: Managed mode must use sessions to remember user search/orderby preferences
Status: VERIFIED OBSOLETE
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Low normal
Target Milestone: 2.1
Assignee: Michael Wood
QA Contact: Bogdan Alexandru Voiculescu
URL:
Whiteboard:
Depends on: 8279
Blocks:
  Show dependency tree
 
Reported: 2015-02-13 11:30 UTC by Belen Barros Pena
Modified: 2015-11-17 10:20 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Belen Barros Pena 2015-02-13 11:30:13 UTC
This is somehow a corner case, since you probably won't encounter it unless you are switching between Toaster modes. It is a bug nonetheless, so there it goes. 

Steps to reproduce:

1. Start toaster in build (managed) mode and visit the all builds page
2. Stop toaster
3. Source the environment script
4. Start Toaster in analysis (interactive) mode 
5. If you are redirected to the no builds state, type this url in your browser

localhost:8000/toastergui/builds

The page fails to load. This is the trace:

Environment:

Request Method: GET
Request URL:
http://127.0.0.1:8000/toastergui/builds/?count=10&orderby=updated%3A-&page=
1

Django Version: 1.6
Python Version: 2.7.6
Installed Applications:
('django.contrib.staticfiles',
'django.contrib.humanize',
'orm',
'toastermain',
'south',
'bldviewer',
'toastergui',
'bldcontrol')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py"
in get_response
  114.                     response = wrapped_callback(request,
*callback_args, **callback_kwargs)
File "/home/yocto/master/bitbake/lib/toaster/toastergui/views.py" in builds
  3139.         (filter_string, search_term, ordering_string) =
_search_tuple(request, Build)
File "/home/yocto/master/bitbake/lib/toaster/toastergui/views.py" in
_search_tuple
  216.         raise BaseException("Invalid ordering model:" +
str(model) + str(invalid))

Exception Type: BaseException at /toastergui/builds/
Exception Value: Invalid ordering model:<class
'orm.models.Build'>(u'updated', ['bitbake_version', 'build_name',
'buildartifact', 'buildrequest', 'completed_on', 'cooker_log_path',
'distro', 'distro_version', 'errors_no', 'helptext_build', u'id',
'layer_version_build', 'logmessage', 'machine', 'outcome', 'package',
'project', 'started_on', 'target', 'task_build', 'timespent',
'variable_build', 'warnings_no'])
Comment 1 Alexandru Damian 2015-03-12 11:05:32 UTC
This is a side-effect of using cookies to store the page state.

Since in managed mode we have server-side session support, we need to switch the implementation to use session to remember user search/orderby preferences.

This is doable after we split the applications for managed mode and analysis mode in 1.9.

Deferring bug to 1.9, after the build and analysis mode applications are split.
Comment 2 Alexandru Damian 2015-04-28 14:15:48 UTC
Moved to Michael, to be included in the UI frontend refactoring.
Comment 3 Bogdan Alexandru Voiculescu 2015-08-27 15:19:22 UTC
Since 7449 was not implemented, please confirm this bug is obsolete too.
Comment 4 Stephen K Jolley 2015-10-07 15:31:11 UTC
Please recheck this during 2.1
Comment 5 Michael Wood 2015-11-12 12:15:53 UTC
This should be fixed by the work that has been done to consolidate the two modes and re-use a proper project for analysis mode/command line builds.
Comment 6 Bogdan Alexandru Voiculescu 2015-11-17 10:20:00 UTC
obsolete.