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!: Drop the block_structure.storage_backing_for_cache WaffleSwitch #35185

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

Commits on Nov 5, 2024

  1. feat: Turn ON the storage backing for cache by default.

    Any places where the storage backing cache for block structures was on
    conditionally previously it will be ON by default.
    feanil committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    16d440a View commit details
    Browse the repository at this point in the history
  2. test: Remove test variants that test without a cache.

    Since the cache is now always on, remove test cases that test the case
    when it's disabled.
    feanil committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    57cdbfa View commit details
    Browse the repository at this point in the history
  3. feat!: Drop an unnecessary function.

    Remove the `enable_storage_backing_for_cache_in_request` function and
    its uses in the platform.  The function is no longer needed because the
    storage backing for the block_structure cache will be ON by default
    moving forward.
    
    BREAKING CHANGE: This `enable_storage_backing_for_cache_in_request`
    function no longer exists and any calls to it should be removed.  The
    cache it enables is now always ON.
    feanil committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    261b498 View commit details
    Browse the repository at this point in the history
  4. feat!: Drop the block_structure.storage_backing_for_cache waffle switch.

    This work is part of DEPR openedx/public-engineering#32
    
    Now that we've removed all uses for this switch remove the decleration
    as well.
    
    BREAKING CHANGE: The `block_structure.storage_backing_for_cache` will no
    longer exist and its value will be ignored. If you have this switch set
    in your instance you can remove it. The backing cache is now always ON.
    feanil committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    fab0267 View commit details
    Browse the repository at this point in the history
  5. test: Update a BlockStructureFactory test mixin.

    Previously, we were not caching BlockStructures to the database when we
    were adding them to the store by default.  Now that we are doing that,
    the BlockStructureFactory test failed because it was taking a shortcut
    that would no longer work.  It was just creating a blockstructure that
    had relations but not any block information.
    
    Now that we're always persisting updates to the database, this broke
    because to persist the structure to the database, we have to look up the
    block information from the block_structure which now fails.
    
    This change updates the test mixin to add more data so that the content
    can be persisted to the database successfully as a part of this test.
    feanil committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    9164e92 View commit details
    Browse the repository at this point in the history
  6. test: Change call counts with model back as default.

    We don't call the modulestore or update the cache here now that we are
    backed by the database model.  Previously the cache would change because
    the `_encode_root_cache_key` function in `BlockStructureStore` class
    used the `BlockstoreBlockData.VERSION` as a part of the cache key when
    the data was not being cached in a DB model.
    feanil committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    e52253d View commit details
    Browse the repository at this point in the history
  7. feat: Remove the unused StubModel class.

    Now that the model backed cache is on by default, we don't need to keep
    the StubModel object around.
    feanil committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    e5f698a View commit details
    Browse the repository at this point in the history
  8. test: Update query counts.

    With the new block_structure model cache enabled by default, we're donig
    queries to it as a part of other tests.
    feanil committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    db266e2 View commit details
    Browse the repository at this point in the history
  9. test: Update the course in the cache after it's got new content.

    Because signals are disabled by default for performance reasons, this
    doesn't happen automatically.  So we manually refresh the course in the
    cache after all the changes have been made so that the course in the
    cache matches the latest version in the modulestore.
    feanil committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    cf37ca4 View commit details
    Browse the repository at this point in the history
  10. refactor: Make the test easier to debug in the future.

    This test had a redundant call to get the course data from the store
    because that already happens at the end of the setup function.  And also
    because expected call structure was being built inside the assert, it
    made it harder to inspect when debugging.  Make the code a little bit
    easire to debug in case we're back here in the future.
    feanil committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    f0f18f8 View commit details
    Browse the repository at this point in the history
  11. docs: Cross link to wiki docs related to block structures.

    Provide a link to more docs from the code in case we need more context
    in the future.
    feanil committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    8741417 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    80ed5ee View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    d58dea3 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    a6e5b81 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    398160c View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    4768568 View commit details
    Browse the repository at this point in the history