Update action extension hooks and unit tests.
Review Request #12775 — Created Jan. 9, 2023 and submitted
This is the final change for the new actions framework, covering the
extension hooks and unit tests.I've repurposed the old
ActionHook
(which was just used as a generic
base class) to be the new entry point for actions. This simply takes a
list ofBaseAction
instances and handles registering and unregistering
as appropriate.The old legacy action hooks have been updated to translate the
dictionary definitions into BaseAction instances, which are then passed
upward to the ActionHook base class. These are all now treated as
deprecated, and will warn appropriately.This also fixes up a variety of issues discovered with the unit tests.
- Built an extension that used all of the hooks, both the modern and
legacy. Saw that everything worked appropriately. - Ran python unit tests.
- Ran js-tests.
- Built codebase and manual documentation and checked all related
pages for content and spelling.
Summary | |
---|---|
Description | From | Last Updated |
---|---|---|
This will only be emitted once per process per text, so if we could put in an identifier like the … |
|
|
Same as above. |
|
|
Same as above. |
|
|
Same as above. |
|
|
Same as above. |
|
|
Can the docs be updated here to show these are deprecated and will be removed? We should also just make … |
|
|
JS naming slipped it. This should be deprecation_message (or really, just message would be fine). Same below. |
|
|
Blank line between statements/blocks. |
|
|
Can this be alphabetized? |
|
Change Summary:
Add in some changes that were stuck in a different commit.
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+1318 -1100) |
Checks run (2 succeeded)
Change Summary:
Moved some code out of this commit.
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commits: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+1106 -1048) |
Checks run (2 succeeded)
-
-
reviewboard/extensions/hooks.py (Diff revision 3) This will only be emitted once per process per text, so if we could put in an identifier like the ID, that could do a lot to help people porting extensions.
-
-
-
-
-
reviewboard/extensions/templatetags/rb_extensions.py (Diff revision 3) Can the docs be updated here to show these are deprecated and will be removed? We should also just make these emit a warning (which will help us find and remove these later).
-
reviewboard/extensions/tests/test_action_hooks.py (Diff revision 3) JS naming slipped it. This should be
deprecation_message
(or really, justmessage
would be fine).Same below.
-
reviewboard/extensions/tests/test_action_hooks.py (Diff revision 3) Blank line between statements/blocks.
-
Change Summary:
- Move all extension-related changes into this commit.
- Made requested changes.
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+1894 -1246) |