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

feat!: remove code owner optional prefix paths #867

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions edx_arch_experiments/datadog_monitoring/code_owner/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Utilities for monitoring code_owner_2
"""
import logging
import re

from django.conf import settings
from edx_django_utils.monitoring import set_custom_attribute
Expand Down Expand Up @@ -95,11 +94,6 @@ def get_code_owner_mappings():
path_list = code_owner_mappings[code_owner]
for path in path_list:
path_to_code_owner_mapping[path] = code_owner
optional_module_prefix_match = _OPTIONAL_MODULE_PREFIX_PATTERN.match(path)
# if path has an optional prefix, also add the module name without the prefix
if optional_module_prefix_match:
path_without_prefix = path[optional_module_prefix_match.end():]
path_to_code_owner_mapping[path_without_prefix] = code_owner
except TypeError as e:
log.exception(
'Error processing CODE_OWNER_MAPPINGS. {}'.format(e) # pylint: disable=logging-format-interpolation
Expand Down Expand Up @@ -157,12 +151,6 @@ def clear_cached_mappings():
_CODE_OWNER_TO_THEME_AND_SQUAD_MAPPINGS = None


# TODO: Retire this once edx-platform import_shims is no longer used.
# Note: This should be ready for removal because import_shims has been removed.
# See https://github.com/openedx/edx-platform/tree/854502b560bda74ef898501bb2a95ce238cf794c/import_shims
_OPTIONAL_MODULE_PREFIX_PATTERN = re.compile(r'^(lms|common|openedx\.core)\.djangoapps\.')


# Cached lookup table for code owner theme and squad given a code owner.
# - Although code owner is "theme-squad", a hyphen may also be in the theme or squad name, so this ensures we get both
# correctly from config.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ def setUp(self):
@ddt.data(
('xbl', None),
('xblock_2', None),
('xblock', 'team-red'),
('openedx.core.djangoapps', None),
('openedx.core.djangoapps.xblock', 'team-red'),
('openedx.core.djangoapps.xblock.views', 'team-red'),
('grades', 'team-red'),
('lms.djangoapps.grades', 'team-red'),
('xblock_django', 'team-blue'),
('common.djangoapps.xblock_django', 'team-blue'),
)
@ddt.unpack
Expand Down
Loading