feat!: Remove block_structure.raise_error_when_not_found waffle flag.

Per this DEPR: https://github.com/openedx/public-engineering/issues/34

This was a temporary waffle and is no longer needed.

BREAKING_CHANGE: Setting the
`block_structure.raise_error_when_not_found` waffle switch via
django-waffle will be ignored.

Note for Operators: If you have this waffle swicth in your systems, it
should be removed.
This commit is contained in:
Feanil Patel
2023-01-20 13:09:24 -05:00
parent 0c4efc6ef2
commit e46bfcd252
3 changed files with 1 additions and 28 deletions

View File

@@ -48,24 +48,6 @@ STORAGE_BACKING_FOR_CACHE = WaffleSwitch(
"block_structure.storage_backing_for_cache", __name__
)
# .. toggle_name: block_structure.raise_error_when_not_found
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: Raises an error if the requested block structure does not exist in block
# structure store, or if it is outdated. Block structure store refers to both cache and storage,
# if enabled.
# .. toggle_warning: This switch will likely be deprecated and removed.
# The annotation will be updated with the DEPR ticket once that process has started.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2017-02-23
# .. toggle_target_removal_date: 2017-05-23
# .. toggle_tickets: https://github.com/openedx/edx-platform/pull/14512,
# https://github.com/openedx/edx-platform/pull/14770,
# https://openedx.atlassian.net/browse/DEPR-143
RAISE_ERROR_WHEN_NOT_FOUND = WaffleSwitch(
"block_structure.raise_error_when_not_found", __name__
)
def enable_storage_backing_for_cache_in_request():
"""

View File

@@ -6,7 +6,6 @@ BlockStructures.
from contextlib import contextmanager
from . import config
from .exceptions import BlockStructureNotFound, TransformerDataIncompatible, UsageKeyNotInBlockStructure
from .factory import BlockStructureFactory
from .store import BlockStructureStore
@@ -100,8 +99,6 @@ class BlockStructureManager:
BlockStructureTransformers.verify_versions(block_structure)
except (BlockStructureNotFound, TransformerDataIncompatible):
if config.RAISE_ERROR_WHEN_NOT_FOUND.is_enabled():
raise
block_structure = self._update_collected()
return block_structure

View File

@@ -8,7 +8,7 @@ from django.test import TestCase
from edx_toggles.toggles.testutils import override_waffle_switch
from ..block_structure import BlockStructureBlockData
from ..config import RAISE_ERROR_WHEN_NOT_FOUND, STORAGE_BACKING_FOR_CACHE
from ..config import STORAGE_BACKING_FOR_CACHE
from ..exceptions import BlockStructureNotFound, UsageKeyNotInBlockStructure
from ..manager import BlockStructureManager
from ..transformers import BlockStructureTransformers
@@ -177,12 +177,6 @@ class TestBlockStructureManager(UsageKeyFactoryMixin, ChildrenMapTestMixin, Test
self.collect_and_verify(expect_modulestore_called=False, expect_cache_updated=False)
assert TestTransformer1.collect_call_count == 1
def test_get_collected_error_raised(self):
with override_waffle_switch(RAISE_ERROR_WHEN_NOT_FOUND, active=True):
with mock_registered_transformers(self.registered_transformers):
with pytest.raises(BlockStructureNotFound):
self.bs_manager.get_collected()
@ddt.data(True, False)
def test_update_collected_if_needed(self, with_storage_backing):
with override_waffle_switch(STORAGE_BACKING_FOR_CACHE, active=with_storage_backing):