Change deferment during action registration to only defer placement.

Review Request #14707 — Created Nov. 24, 2025 and submitted

Information

Review Board
release-7.1.x

Reviewers

When registering actions, we've historically deferred them if they
depended on a parent that wasn't yet registered. With the new
multi-placement actions being introduced, it's possible an action would
be placed somewhere currently valid and somewhere that may never be
valid (such as a legacy attachment point or one defined by an
extension). When this happened, the action would never end up being
registered.

Actions are no longer ever deferred. Instead, placements depending on a
missing parent are now deferred.

When placing an action during registration or when resolving a deferred
placement later, any deferred placements depending on the newly-placed
action will be further resolved. This ensures that placements will
always resolve once all parents have been placed, no matter when that
occurs.

If an action is unregistered, any actions depending on it will move back
to a deferred state so they can be re-placed if the action comes back.
This is important for extensions.

Along with this, the registry has been updated to make use of
on_item_* hooks, instead of overriding register and unregister,
allowing the registry to manage when this logic occurs, taking advantage
of any locks.

All unit tests passed.

Verified this fixed issues with in-progress changes with actions
containing a placement that had a valid parent and a placement
that did not.

Summary ID
Change deferment during action registration to only defer placement.
When registering actions, we've historically deferred them if they depended on a parent that wasn't yet registered. With the new multi-placement actions being introduced, it's possible an action would be placed somewhere currently valid and somewhere that may never be valid (such as a legacy attachment point or one defined by an extension). When this happened, the action would never end up being registered. Actions are no longer ever deferred. Instead, placements depending on a missing parent are now deferred. When placing an action during registration or when resolving a deferred placement later, any deferred placements depending on the newly-placed action will be further resolved. This ensures that placements will always resolve once all parents have been placed, no matter when that occurs. If an action is unregistered, any actions depending on it will move back to a deferred state so they can be re-placed if the action comes back. This is important for extensions. Along with this, the registry has been updated to make use of `on_item_*` hooks, instead of overriding `register` and `unregister`, allowing the registry to manage when this logic occurs, taking advantage of any locks.
4212c0c66e2fc945aae384b8882152a6723cad9d
Description From Last Updated

This is missing from the Args docs.

maubinmaubin

typo: placemetn -> placement

daviddavid

This seems like leftover that was meant to be removed.

maubinmaubin

Can we add comments here to indicate that the tuple is (parent_id, attachment) and the dict is {action_id: action}?

daviddavid

Can we include the action_id, parent_id, and attachment point in this log entry?

daviddavid

Needs a trailing comma.

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

    typo: placemetn -> placement

  3. 
      
maubin
  1. Ship It!
  2. 
      
chipx86
david
  1. 
      
  2. reviewboard/actions/registry.py (Diff revision 2)
     
     
     
    Show all issues

    Can we add comments here to indicate that the tuple is (parent_id, attachment) and the dict is {action_id: action}?

  3. reviewboard/actions/registry.py (Diff revision 2)
     
     
     
     
     
    Show all issues

    Can we include the action_id, parent_id, and attachment point in this log entry?

  4. reviewboard/actions/registry.py (Diff revision 2)
     
     
    Show all issues

    Needs a trailing comma.

  5. 
      
chipx86
david
  1. Ship It!
  2. 
      
maubin
  1. 
      
  2. reviewboard/actions/registry.py (Diff revisions 1 - 3)
     
     
    Show all issues

    This is missing from the Args docs.

  3. reviewboard/actions/registry.py (Diff revisions 1 - 3)
     
     
    Show all issues

    This seems like leftover that was meant to be removed.

  4. 
      
chipx86
maubin
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-7.1.x (183dc26)