• 
      

    Switch out ConcurrencyManager for Manager.

    Review Request #14073 — Created Aug. 4, 2024 and submitted

    Information

    Review Board
    master

    Reviewers

    Early on in Django history, the built-in Manager.get_or_create method
    was racy, potentially raising IntegrityError. We had built a
    ConcurrencyManager to handle this case, and used it for many of our
    models where we encountered issues.

    As of quite some time ago, Django's built-in Manager does exactly the
    same thing as our ConcurrencyManager did, and we just didn't discover
    that because everything was working as expected. We've deprecated the
    ConcurrencyManager as a result. This change swaps out all our usage to
    just use the built-in Manager class.

    Ran unit tests.

    Summary ID
    Switch out ConcurrencyManager for Manager.
    Early on in Django history, the built-in `Manager.get_or_create` method was racy, potentially raising `IntegrityError`. We had built a `ConcurrencyManager` to handle this case, and used it for many of our models where we encountered issues. As of quite some time ago, Django's built-in `Manager` does exactly the same thing as our `ConcurrencyManager` did, and we just didn't discover that because everything was working as expected. We've deprecated the ConcurrencyManager as a result. This change swaps out all our usage to just use the built-in `Manager` class. Testing Done: Ran unit tests.
    e13897bb1c52d4a9ed5fc38727ad38ea4f6cbb4c
    Description From Last Updated

    'reviewboard.accounts.models.ReviewRequestVisit' imported but unused Column: 5 Error code: F401

    reviewbotreviewbot

    undefined name 'Optional' Column: 21 Error code: F821

    reviewbotreviewbot

    'reviewboard.reviews.models.BaseComment' imported but unused Column: 5 Error code: F401

    reviewbotreviewbot

    'reviewboard.accounts.models.ReviewRequestVisit' imported but unused Column: 5 Error code: F401

    reviewbotreviewbot

    'reviewboard.reviews.models.BaseComment' imported but unused Column: 5 Error code: F401

    reviewbotreviewbot
    Checks run (1 failed, 1 succeeded)
    flake8 failed.
    JSHint passed.

    flake8

    david
    Review request changed
    Commits:
    Summary ID
    Switch out ConcurrencyManager for Manager.
    Early on in Django history, the built-in `Manager.get_or_create` method was racy, potentially raising `IntegrityError`. We had built a `ConcurrencyManager` to handle this case, and used it for many of our models where we encountered issues. As of quite some time ago, Django's built-in `Manager` does exactly the same thing as our `ConcurrencyManager` did, and we just didn't discover that because everything was working as expected. We've deprecated the ConcurrencyManager as a result. This change swaps out all our usage to just use the built-in `Manager` class. Testing Done: Ran unit tests.
    29bc543a4a8a9a4380e4b979cbdfb92183b8bde2
    Switch out ConcurrencyManager for Manager.
    Early on in Django history, the built-in `Manager.get_or_create` method was racy, potentially raising `IntegrityError`. We had built a `ConcurrencyManager` to handle this case, and used it for many of our models where we encountered issues. As of quite some time ago, Django's built-in `Manager` does exactly the same thing as our `ConcurrencyManager` did, and we just didn't discover that because everything was working as expected. We've deprecated the ConcurrencyManager as a result. This change swaps out all our usage to just use the built-in `Manager` class. Testing Done: Ran unit tests.
    e13897bb1c52d4a9ed5fc38727ad38ea4f6cbb4c

    Checks run (1 failed, 1 succeeded)

    flake8 failed.
    JSHint passed.

    flake8

    maubin
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to master (4417e9d)