Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor following RESTful API standards fix(#22, #23, #26) #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tonythomas01
Copy link
Collaborator

@tonythomas01 tonythomas01 commented Oct 14, 2018

Refactors:

  • Use filter params instead of kwargs for all query from Frontend to Backend. Eg: http://127.0.0.1:8000/dash/results?subtest=mytest&test=maintest is how it should be - and this is how it looks now. Previously http://127.0.0.1:8000/dash/results/checjcehck/ares6 .
  • Cut down loads of code duplication and bad logic in reports/views.py. Use inheritance whenever necessary
  • No more snake_case in APIs. It should be always normal-case.
  • The POST API from bots is untouched. So this should not break anything.

Further improvements:

  • version API and move all APIs to api/v1.0/ or something. But this will break bots sending data currently.

Fix: #23 #26 #22

@tonythomas01 tonythomas01 requested a review from clopez October 14, 2018 10:35
@tonythomas01 tonythomas01 changed the title Refactor following RESTful API standards Refactor following RESTful API standards [#22, #23, #26] Oct 14, 2018
@tonythomas01 tonythomas01 changed the title Refactor following RESTful API standards [#22, #23, #26] Refactor following RESTful API standards fix(#22, #23, #26) Oct 14, 2018
@tonythomas01
Copy link
Collaborator Author

Update: I removed the autopep8 changes from the PR as it became too big. We can have that later.

@clopez
Copy link
Collaborator

clopez commented Jul 4, 2019

I tested this on my development machine and it seems to work if you start from scratch with an empty DB.

But when I tried to apply it to a previous deployment it broke things. The table is empty and the graphs as well. I can see this on the debug.log

Exception while resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/base.py", line 172, in _get_response
    resolver_match = resolver.resolve(request.path_info)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/urls/resolvers.py", line 300, in resolve
    raise Resolver404({'tried': tried, 'path': new_path})
django.urls.exceptions.Resolver404: {'path': 'dash/bot_full_details_for_exist/all', 'tried': [[<RegexURLPattern home ^$>], [<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern graph_report ^graph/$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-report>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^gpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^cpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^platforms$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^browsers$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bots$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-full-details$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-paths>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-metrics/(?P<test>[-\w]+)/(?P<subtest>.+)$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^tests$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^results$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/improvements>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/regressions>]]}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 885, in _resolve_lookup
    current = current[bit]
TypeError: 'RegexURLResolver' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 893, in _resolve_lookup
    current = getattr(current, bit)
AttributeError: 'RegexURLResolver' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 900, in _resolve_lookup
    current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 907, in _resolve_lookup
    (bit, current))  # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [name] in '<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>'
Exception while resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/base.py", line 172, in _get_response
    resolver_match = resolver.resolve(request.path_info)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/urls/resolvers.py", line 300, in resolve
    raise Resolver404({'tried': tried, 'path': new_path})
django.urls.exceptions.Resolver404: {'path': 'dash/browser_results_exist', 'tried': [[<RegexURLPattern home ^$>], [<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern graph_report ^graph/$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-report>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^gpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^cpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^platforms$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^browsers$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bots$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-full-details$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-paths>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-metrics/(?P<test>[-\w]+)/(?P<subtest>.+)$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^tests$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^results$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/improvements>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/regressions>]]}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 885, in _resolve_lookup
    current = current[bit]
TypeError: 'RegexURLResolver' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 893, in _resolve_lookup
    current = getattr(current, bit)
AttributeError: 'RegexURLResolver' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 900, in _resolve_lookup
    current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 907, in _resolve_lookup
    (bit, current))  # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [name] in '<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>'
Not Found: /dash/bot_full_details_for_exist/all
Exception while resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/base.py", line 172, in _get_response
    resolver_match = resolver.resolve(request.path_info)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/urls/resolvers.py", line 300, in resolve
    raise Resolver404({'tried': tried, 'path': new_path})
django.urls.exceptions.Resolver404: {'path': 'dash/platform_results_exist', 'tried': [[<RegexURLPattern home ^$>], [<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern graph_report ^graph/$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-report>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^gpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^cpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^platforms$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^browsers$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bots$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-full-details$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-paths>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-metrics/(?P<test>[-\w]+)/(?P<subtest>.+)$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^tests$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^results$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/improvements>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/regressions>]]}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 885, in _resolve_lookup
    current = current[bit]
TypeError: 'RegexURLResolver' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 893, in _resolve_lookup
    current = getattr(current, bit)
AttributeError: 'RegexURLResolver' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 900, in _resolve_lookup
    current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 907, in _resolve_lookup
    (bit, current))  # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [name] in '<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>'
Exception while resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/base.py", line 172, in _get_response
    resolver_match = resolver.resolve(request.path_info)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/urls/resolvers.py", line 300, in resolve
    raise Resolver404({'tried': tried, 'path': new_path})
django.urls.exceptions.Resolver404: {'path': 'dash/cpu_results_exist', 'tried': [[<RegexURLPattern home ^$>], [<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern graph_report ^graph/$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-report>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^gpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^cpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^platforms$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^browsers$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bots$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-full-details$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-paths>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-metrics/(?P<test>[-\w]+)/(?P<subtest>.+)$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^tests$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^results$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/improvements>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/regressions>]]}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 885, in _resolve_lookup
    current = current[bit]
TypeError: 'RegexURLResolver' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 893, in _resolve_lookup
    current = getattr(current, bit)
AttributeError: 'RegexURLResolver' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 900, in _resolve_lookup
    current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 907, in _resolve_lookup
    (bit, current))  # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [name] in '<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>'
Not Found: /dash/browser_results_exist
Exception while resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/base.py", line 172, in _get_response
    resolver_match = resolver.resolve(request.path_info)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/urls/resolvers.py", line 300, in resolve
    raise Resolver404({'tried': tried, 'path': new_path})
django.urls.exceptions.Resolver404: {'path': 'dash/report/improvement/5/all/all/all/all/all/all/10', 'tried': [[<RegexURLPattern home ^$>], [<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern graph_report ^graph/$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-report>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^gpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^cpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^platforms$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^browsers$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bots$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-full-details$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-paths>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-metrics/(?P<test>[-\w]+)/(?P<subtest>.+)$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^tests$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^results$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/improvements>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/regressions>]]}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 885, in _resolve_lookup
    current = current[bit]
TypeError: 'RegexURLResolver' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 893, in _resolve_lookup
    current = getattr(current, bit)
AttributeError: 'RegexURLResolver' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 900, in _resolve_lookup
    current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 907, in _resolve_lookup
    (bit, current))  # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [name] in '<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>'
Exception while resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/base.py", line 172, in _get_response
    resolver_match = resolver.resolve(request.path_info)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/urls/resolvers.py", line 300, in resolve
    raise Resolver404({'tried': tried, 'path': new_path})
django.urls.exceptions.Resolver404: {'path': 'dash/gpu_results_exist', 'tried': [[<RegexURLPattern home ^$>], [<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern graph_report ^graph/$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-report>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^gpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^cpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^platforms$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^browsers$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bots$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-full-details$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-paths>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-metrics/(?P<test>[-\w]+)/(?P<subtest>.+)$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^tests$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^results$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/improvements>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/regressions>]]}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 885, in _resolve_lookup
    current = current[bit]
TypeError: 'RegexURLResolver' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 893, in _resolve_lookup
    current = getattr(current, bit)
AttributeError: 'RegexURLResolver' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 900, in _resolve_lookup
    current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 907, in _resolve_lookup
    (bit, current))  # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [name] in '<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>'
Not Found: /dash/platform_results_exist
Not Found: /dash/cpu_results_exist
Exception while resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/base.py", line 172, in _get_response
    resolver_match = resolver.resolve(request.path_info)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/urls/resolvers.py", line 300, in resolve
    raise Resolver404({'tried': tried, 'path': new_path})
django.urls.exceptions.Resolver404: {'path': 'dash/tests_for_browser_bot/all', 'tried': [[<RegexURLPattern home ^$>], [<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern graph_report ^graph/$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-report>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^gpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^cpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^platforms$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^browsers$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bots$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-full-details$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-paths>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-metrics/(?P<test>[-\w]+)/(?P<subtest>.+)$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^tests$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^results$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/improvements>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/regressions>]]}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 885, in _resolve_lookup
    current = current[bit]
TypeError: 'RegexURLResolver' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 893, in _resolve_lookup
    current = getattr(current, bit)
AttributeError: 'RegexURLResolver' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 900, in _resolve_lookup
    current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 907, in _resolve_lookup
    (bit, current))  # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [name] in '<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>'
Not Found: /dash/report/improvement/5/all/all/all/all/all/all/10
Exception while resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/core/handlers/base.py", line 172, in _get_response
    resolver_match = resolver.resolve(request.path_info)
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/urls/resolvers.py", line 300, in resolve
    raise Resolver404({'tried': tried, 'path': new_path})
django.urls.exceptions.Resolver404: {'path': 'dash/report/regression/5/all/all/all/all/all/all/10', 'tried': [[<RegexURLPattern home ^$>], [<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern graph_report ^graph/$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-report>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^gpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^cpus$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^platforms$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^browsers$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bots$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^bot-full-details$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-paths>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^test-metrics/(?P<test>[-\w]+)/(?P<subtest>.+)$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^tests$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^results$>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/improvements>], [<RegexURLResolver <module 'dashboard.urls' from '/srv/browserperfdash/dashboard/urls.py'> (None:None) ^dash/>, <RegexURLPattern None ^report/regressions>]]}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 885, in _resolve_lookup
    current = current[bit]
TypeError: 'RegexURLResolver' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 893, in _resolve_lookup
    current = getattr(current, bit)
AttributeError: 'RegexURLResolver' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 900, in _resolve_lookup
    current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/browserperfdash/venv/dashboard/lib/python3.5/site-packages/django/template/base.py", line 907, in _resolve_lookup
    (bit, current))  # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [name] in '<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>'
Not Found: /dash/gpu_results_exist
Not Found: /dash/tests_for_browser_bot/all
Not Found: /dash/report/regression/5/all/all/all/all/all/all/10

@tonythomas01
Copy link
Collaborator Author

I can only guess here, but I do not think the PR was totally applied. Like you can see requests to:

django.template.base.VariableDoesNotExist: Failed lookup for key [name] in '<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>'
Not Found: /dash/browser_results_exist

in the log. This API and anything that looks like this was removed in this PR. https://github.com/Igalia/browserperfdash/pull/31/files#diff-94073f44d775e0dd3f800f89e6110efeL25

Since we have frontend changes, I think force refresh of the frontend might be required.

@tonythomas01
Copy link
Collaborator Author

tonythomas01 commented Feb 22, 2020

Saw this still open after a couple of years. I still think the frontend somehow managed to query URLS that were removed in this PR. For example, look at this URL that was hit above:

Not Found: /dash/browser_results_exist
Not Found: /dash/gpu_results_exist
Not Found: /dash/tests_for_browser_bot/all
Not Found: /dash/report/regression/5/all/all/all/all/all/all/10

Screenshot 2020-02-22 at 10 50 38

Can we run a python manage.py collectstatic or something like that after the PR is applied ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup django modes, views
2 participants