Change deferment during action registration to only defer placement.

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

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.
52a2a5409cfaa7fe2fe997b7805d26f881af9ebc
Description From Last Updated

typo: placemetn -> placement

daviddavid

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
Review request changed
Change Summary:
  • Improved logging.
  • Added information on the structure of _deferred_placements in the docs.
  • Added a missing trailing comma.
Commits:
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.
4b5851e8bd2ef8dddcadb7f819ff905126eacde1
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.
52a2a5409cfaa7fe2fe997b7805d26f881af9ebc

Checks run (2 succeeded)

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