Page MenuHomePhabricator

Herald rules H295 and H301 broken as their conditions list custom "date" fields somehow not supported by Herald
Closed, ResolvedPublicBUG REPORT

Description

(Found this due to running SELECT c.* FROM phabricator_herald.herald_action c JOIN phabricator_herald.herald_rule r ON r.id = c.ruleID WHERE r.isDisabled = 0 AND action = "maniphest.subtype"; after looking at libext/misc/src/herald/SetSubtypeHeraldAction.php)

Trying to edit them creates an Unhandled Exception ("Exception")

Event Timeline

Aklapper renamed this task from Herald rules H295 and H301 never trigger as their conditions list unknown fields to Herald rules H295 and H301 broken as their conditions list custom "date" fields somehow not supported by Herald.Jun 18 2024, 1:35 PM
Aklapper closed this task as Resolved.
Aklapper claimed this task.
Aklapper triaged this task as Low priority.
Aklapper moved this task from To Triage to Herald rules on the Phabricator board.

Seems to happen for custom fields of "type": "date" defined in /config/edit/maniphest.custom-field-definitions/.

Upstream code does not let me set such a custom field as a condition in Herald.
Should probably support an exists check though?

Anyway, I've disabled these Herald rules for now. May welcome further investigation to fix buggy functionality in upstream but I do not have the time right now.

mysql:phstats@m3-slave.eqiad.wmnet [phabricator_maniphest]> SELECT CONCAT("https://phabricator.wikimedia.org/H", c.ruleID), c.fieldName, c.fieldCondition FROM phabricator_herald.herald_condition c JOIN phabricator_herald.herald_rule r ON r.id = c.ruleID WHERE r.isDisabled = 0 AND (c.ruleID = 295 OR c.ruleID = 301);
+---------------------------------------------------------+---------------------------------------------+----------------+
| CONCAT("https://phabricator.wikimedia.org/H", c.ruleID) | fieldName                                   | fieldCondition |
+---------------------------------------------------------+---------------------------------------------+----------------+
| https://phabricator.wikimedia.org/H295                  | maniphest.task.subtype                      | isany          |
| https://phabricator.wikimedia.org/H295                  | herald.custom/std:maniphest:deadline.due    | !exists        |
| https://phabricator.wikimedia.org/H301                  | maniphest.task.subtype                      | isany          |
| https://phabricator.wikimedia.org/H301                  | herald.custom/std:maniphest:release.date    | is             |
| https://phabricator.wikimedia.org/H301                  | herald.custom/std:maniphest:release.version | is             |
+---------------------------------------------------------+---------------------------------------------+----------------+
5 rows in set (0.001 sec)