Page MenuHomePhabricator

Make Herald rule execution order explicitly defined
Closed, ResolvedPublic

Description

Currently, Herald rules don't have a defined execution order (in practice, it's probably highest ID to lowest ID).

While this usually doesn't cause issues, we will run into rule collisions sooner or later. Making this order well-defined solves an issue for Wikimedia, and seems reasonable, even though it's a sort of unintuitive/buried feature that will be hard to discover. That seems OK since the vast majority of users will never care.

Rules should execute in this order:

  • Personal rules, lowest ID to highest ID.
  • Object rules, lowest ID to highest ID.
  • Global rules, lowest ID to highest ID.

This grouping allows global rules (which are the most powerful) to win over personal rules. Executing the lowest IDs first makes state more predictable when adding new rules, because the new rules will execute last and not interact with following rules.