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 15 commits into
base: master
Choose a base branch
from

Commits on Sep 23, 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 Sep 23, 2024
    Configuration menu
    Copy the full SHA
    cf4ac22 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 Sep 23, 2024
    Configuration menu
    Copy the full SHA
    150ecf1 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 Sep 23, 2024
    Configuration menu
    Copy the full SHA
    63af535 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 Sep 23, 2024
    Configuration menu
    Copy the full SHA
    cb065dc 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 Sep 23, 2024
    Configuration menu
    Copy the full SHA
    5c2a4af 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 Sep 23, 2024
    Configuration menu
    Copy the full SHA
    67fe92b 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 Sep 23, 2024
    Configuration menu
    Copy the full SHA
    a642781 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 Sep 23, 2024
    Configuration menu
    Copy the full SHA
    7f2f7b7 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 Sep 23, 2024
    Configuration menu
    Copy the full SHA
    290d6ee 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 Sep 23, 2024
    Configuration menu
    Copy the full SHA
    bf72f4e 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 Sep 23, 2024
    Configuration menu
    Copy the full SHA
    c489093 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    b0819dd View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    3d24b18 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    e900a5e View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    a64dad5 View commit details
    Browse the repository at this point in the history