• 
      

    Refactor the actions system

    Review Request #9131 — Created Aug. 11, 2017 and discarded — Latest diff uploaded

    Information

    Review Board
    release-3.0.x

    Reviewers

    This is a large patch that refactors the action registry system
    implemented by a past student to use a proper registry. Much refactoring
    has been done:

    • Action base classes now live in reviewboard.actions. This package
      also includes header dropdown actions.
    • Review request-specific action classes now live in
      reviewboard.reviews.actions.
    • ALL action hooks support new-style action classes and old-style
      dicts. Previously, there was a discrepancy betweeen which hooks
      supported which type of action.
    • ActionHook is now deprecated in favour of ReviewRequestActionHook.
      The behaviour was the previously the same, except ActionHook supported
      old-style dicts instead of classes. Now that the behaviour of all
      hooks has been unified, we no longer need this distinction.
    • The {% child_actions %} templatetag has been moved from reviewtags
      to a new actions template tag library. It now takes the action it
      should list the child actions of.
    • The _DictAction and _DictMenuAction classes have been turned into
      the DictActionMixin.
    • There are now two action registries: one for review request actions
      and one for header actions. This allows us to keep them seperate.
    • We now store instances of dict actions instead of the dicts
      themselves. This is because you cannot store a dict in a set (as
      it is unhashable) and therefore cannot be put into a Registry.
    • Generic action templates now live in templates/actions.
    • Ran unit tests.
    • Built the docs and looked through them.