Skip to content

Commit

Permalink
[Threads] Remove Threads tab from Administrator Server Tab (#3815)
Browse files Browse the repository at this point in the history
* Basic frontend file found

* [Threads]Remove Threads tab from Admin Pages

* Removing the frontend file

* Removing the desktop.views.threads test

* Removing the COLLECT_THREADS instance from hue_collect_data.sh file

* Removing the hue_collect_data.sh file

* Adding test function back

* Passing the errors on GitHub

* Fixes based on runruff linting

* nit

* Fixes based on review comments

* Final changes based on review comments
  • Loading branch information
ananya-agarwal authored Sep 5, 2024
1 parent bc62813 commit 5ec331d
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 608 deletions.
9 changes: 0 additions & 9 deletions desktop/core/src/desktop/js/onePageViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,15 +533,6 @@ class OnePageViewModel {
}
},
{ url: '/desktop/dump_config', app: 'dump_config' },
{
url: '/desktop/debug/threads',
app: function () {
self.loadApp('threads');
self.getActiveAppViewModel(viewModel => {
viewModel.fetchThreads();
});
}
},
{
url: '/gist',
app: function () {
Expand Down
3 changes: 0 additions & 3 deletions desktop/core/src/desktop/templates/about_layout.mako
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ def is_selected(section, matcher):
<li class="${is_selected(section, 'log_view')}">
<a href="${ url('desktop.views.log_view') }">${_('Server Logs')}</a>
</li>
<li class="${is_selected(section, 'threads')}">
<a href="${ url('desktop.views.threads') }">${_('Threads')}</a>
</li>
% if METRICS.ENABLE_WEB_METRICS.get():
<li class="${is_selected(section, 'metrics')}">
<a href="${ url('desktop.lib.metrics.views.index') }">${_('Metrics')}</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
admin_wizard: { url: '/about/admin_wizard', title: '${_('Admin Wizard')}' },
logs: { url: '/logs', title: '${_('Logs')}' },
dump_config: { url: '/desktop/dump_config', title: '${_('Dump Configuration')}' },
threads: { url: '/desktop/debug/threads', title: '${_('Threads')}' },
metrics: { url: '/desktop/metrics', title: '${_('Metrics')}' },
taskserver: { url: '/task_server', title: '${_('Task Server')}' },
connectors: { url: '/desktop/connectors', title: '${_('Connectors')}' },
Expand Down
61 changes: 0 additions & 61 deletions desktop/core/src/desktop/templates/threads.mako

This file was deleted.

11 changes: 2 additions & 9 deletions desktop/core/src/desktop/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,6 @@ def assert_page(page, data, start, end):
assert_page(pgn.page(2), list(range(20, 25)), 21, 25)


@pytest.mark.django_db
def test_thread_dump():
c = make_logged_in_client()
response = c.get("/desktop/debug/threads", HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert b"test_thread_dump" in response.content


def test_truncating_model():
class TinyModel(TruncatingModel):
short_field = CharField(max_length=10)
Expand Down Expand Up @@ -674,7 +667,7 @@ def check_app(status_code, app_name):
@pytest.mark.django_db
def test_error_handling_failure():
# Change rewrite_user to call has_hue_permission
# Try to get filebrowser page
# Try to get logs page
# test for default 500 page
# Restore rewrite_user
import desktop.auth.backend
Expand All @@ -698,7 +691,7 @@ def rewrite_user(user):
# Make sure we are showing default 500.html page.
# See django.test.client#L246
with pytest.raises(AttributeError):
c.get(reverse('desktop.views.threads'))
c.get(reverse('desktop.views.log_view'))
finally:
# Restore the world
restore_django_debug()
Expand Down
1 change: 0 additions & 1 deletion desktop/core/src/desktop/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
re_path(r'^desktop/status_bar/?$', desktop_views.status_bar),
re_path(r'^desktop/debug/is_alive$', desktop_views.is_alive),
re_path(r'^desktop/debug/is_idle$', desktop_views.is_idle),
re_path(r'^desktop/debug/threads$', desktop_views.threads, name="desktop.views.threads"),
re_path(r'^desktop/debug/memory$', desktop_views.memory),
re_path(r'^desktop/debug/check_config$', desktop_views.check_config, name="desktop.views.check_config"),
re_path(r'^desktop/debug/check_config_ajax$', desktop_views.check_config_ajax),
Expand Down
Loading

0 comments on commit 5ec331d

Please sign in to comment.