Deprecate and forward convenience imports in reviewboard.integrations.

Review Request #10513 — Created April 4, 2019 and submitted

Information

Review Board
release-4.0.x

Reviewers

reviewboard.integrations provided convenience imports for
get_integration_manager() and the base Integration class. These
ended up being a bad idea, because the imports needed for these ended up
interfering with Django app initialization.

Now, both of these forward on to the versions in
reviewboard.integrations.base, showing a deprecation warning on use.
This will remain for Review Board 4.0, and are planned to be removed in
5.0.

To handle the deprecation of the Integration class, we use a metaclass
that will handle the construction of any subclasses. It will reassign
the parent to reviewboard.integrations.base.Integration. This
shouldn't break any subclasses, but could cause problems if anything is
trying to directly compare against the version in
reviewboard.integrations. As this is unlikely, and fixing this would
complicate things quite a bit, we won't be addressing it unless a
problem comes up somewhere.

Unit tests pass on Django 1.6 and 1.11 (with other in-progress changes).

Verified that older integrations were loading correctly on both versions
of Django.

Summary ID
Deprecate and forward convenience imports in reviewboard.integrations.
`reviewboard.integrations` provided convenience imports for `get_integration_manager()` and the base `Integration` class. These ended up being a bad idea, because the imports needed for these ended up interfering with Django app initialization. Now, both of these forward on to the versions in `reviewboard.integrations.base`, showing a deprecation warning on use. This will remain for Review Board 4.0, and are planned to be removed in 5.0. To handle the deprecation of the `Integration` class, we use a metaclass that will handle the construction of any subclasses. It will reassign the parent to `reviewboard.integrations.base.Integration`. This shouldn't break any subclasses, but could cause problems if anything is trying to directly compare against the version in `reviewboard.integrations`. As this is unlikely, and fixing this would complicate things quite a bit, we won't be addressing it unless a problem comes up somewhere.
54b13993ff75e2f36052220710640a29f057ba9f
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (45fac32)