Clone placements when instantiating an action.

Review Request #14703 — Created Nov. 24, 2025 and updated

Information

Review Board
release-7.1.x

Reviewers

When instantiating an action, the placements configured on the class
were used directly, with state stored on them. That failed when
subclassing an action or when reusing an action across tests.

Placements are now cloned when instantiating the action, avoiding this
scenario. It's now safe to have multiple actions share a placement or
list of placements for their definitions.

Unit tests pass.

Verified this fixed unit test issues with in-progress changes.

Summary ID
Clone placements when instantiating an action.
When instantiating an action, the placements configured on the class were used directly, with state stored on them. That failed when subclassing an action or when reusing an action across tests. Placements are now cloned when instantiating the action, avoiding this scenario. It's now safe to have multiple actions share a placement or list of placements for their definitions.
cd12f0df9172cec7f3813d6352ed81ea47a4204d
Description From Last Updated

Should we import final from typing_extensions in order to get the 3.11 behavior?

daviddavid
david
  1. 
      
  2. reviewboard/actions/base.py (Diff revision 1)
     
     
    Show all issues

    Should we import final from typing_extensions in order to get the 3.11 behavior?

  3. 
      
chipx86
Review request changed
Change Summary:

Switched to the modern version of final from typing_extensions.

Commits:
Summary ID
Clone placements when instantiating an action.
When instantiating an action, the placements configured on the class were used directly, with state stored on them. That failed when subclassing an action or when reusing an action across tests. Placements are now cloned when instantiating the action, avoiding this scenario. It's now safe to have multiple actions share a placement or list of placements for their definitions.
c4eab462cc50942a7ab4b6a3f0b45f29a2703c32
Clone placements when instantiating an action.
When instantiating an action, the placements configured on the class were used directly, with state stored on them. That failed when subclassing an action or when reusing an action across tests. Placements are now cloned when instantiating the action, avoiding this scenario. It's now safe to have multiple actions share a placement or list of placements for their definitions.
cd12f0df9172cec7f3813d6352ed81ea47a4204d

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. Ship It!
  2.