Skip to content

Commit

Permalink
refactor: remove deprecated middleware classes (#485)
Browse files Browse the repository at this point in the history
* refactor: remove deprecated middleware classes
* fix: update test cases with new middlewares
* fix: fix quality failures
  • Loading branch information
UsamaSadiq authored Feb 26, 2025
1 parent dc16df3 commit 1b3ff7f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 56 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ Change Log

.. There should always be an "Unreleased" section for changes pending release.
Unreleased
----------


7.2.0 - 2025-02-26
------------------
Removed
~~~~~~~
* Removed deprecated monitoring middleware Classes

7.1.0 - 2024-12-05
------------------
Added
Expand Down
2 changes: 1 addition & 1 deletion edx_django_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
EdX utilities for Django Application development..
"""

__version__ = "7.1.0"
__version__ = "7.2.0"

default_app_config = (
"edx_django_utils.apps.EdxDjangoUtilsConfig"
Expand Down
48 changes: 0 additions & 48 deletions edx_django_utils/monitoring/middleware.py

This file was deleted.

15 changes: 8 additions & 7 deletions edx_django_utils/monitoring/tests/test_monitoring_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@
from django.test import TestCase, override_settings

from edx_django_utils.cache import RequestCache
from edx_django_utils.monitoring import MonitoringSupportMiddleware, accumulate, increment
from edx_django_utils.monitoring import (
CachedCustomMonitoringMiddleware,
MonitoringSupportMiddleware,
accumulate,
increment
)
from edx_django_utils.monitoring.signals import (
monitoring_support_process_exception,
monitoring_support_process_request,
monitoring_support_process_response
)

from ..middleware import CachedCustomMonitoringMiddleware as DeprecatedCachedCustomMonitoringMiddleware
from ..middleware import MonitoringCustomMetricsMiddleware as DeprecatedMonitoringCustomMetricsMiddleware
from ..utils import accumulate as deprecated_accumulate
from ..utils import increment as deprecated_increment
from ..utils import set_custom_attribute as deprecated_set_custom_attribute
Expand All @@ -39,8 +42,7 @@ def setUp(self):
@ddt.data(
(MonitoringSupportMiddleware, False, 'process_response'),
(MonitoringSupportMiddleware, False, 'process_exception'),
(DeprecatedCachedCustomMonitoringMiddleware, True, 'process_response'),
(DeprecatedMonitoringCustomMetricsMiddleware, True, 'process_response'),
(CachedCustomMonitoringMiddleware, False, 'process_response'),
)
@ddt.unpack
def test_accumulate_and_increment(
Expand Down Expand Up @@ -83,8 +85,7 @@ def test_accumulate_and_increment(
@patch('newrelic.agent')
@ddt.data(
(MonitoringSupportMiddleware, False),
(DeprecatedCachedCustomMonitoringMiddleware, True),
(DeprecatedMonitoringCustomMetricsMiddleware, True),
(CachedCustomMonitoringMiddleware, False),
)
@ddt.unpack
def test_accumulate_with_illegal_value(
Expand Down

0 comments on commit 1b3ff7f

Please sign in to comment.