Page MenuHomePhabricator

Remove "Deadline" task subtype
Open, LowPublic

Description

We introduced task subtypes in T93499 / T224417.
I don't understand what some subtypes are good for, especially deadline. Deadline is not a task type.
Many task types can have a due date though.

Deadline is set/used by forms 37, 54 and 94.
Some tasks get created with the Deadline subtype and I have no idea why. They do not have any Due Dates. Examples: T332743, T334770, T197015.

Need to check though which edit forms allow setting/editing a Due Date on a task. Unfortunately Phab doesn't offer a simple way to check which form was used to create a task.

mysql:phstats@m3-slave.eqiad.wmnet [phabricator_maniphest]>  SELECT mt.subtype, COUNT(mt.id) FROM phabricator_maniphest.maniphest_task mt GROUP BY mt.subtype; 
+----------+--------------+
| subtype  | COUNT(mt.id) |
+----------+--------------+
| bug      |        11458 |
| deadline |         1116 |
| default  |       308486 |
| design   |           76 |
| error    |         3440 |
| feature  |         5981 |
| goal     |           36 |
| release  |          334 |
| request  |         1701 |
| security |         redacted |
| spike    |          608 |
+----------+--------------+
11 rows in set (0.145 sec)

mysql:phstats@m3-slave.eqiad.wmnet [phabricator_maniphest]>  SELECT mt.subtype, COUNT(mt.id) FROM phabricator_maniphest.maniphest_task mt WHERE (mt.status="open" OR mt.status="progress" OR mt.status="stalled") GROUP BY mt.subtype; 
+----------+--------------+
| subtype  | COUNT(mt.id) |
+----------+--------------+
| bug      |         3523 |
| deadline |           82 |
| default  |        44111 |
| design   |           23 |
| error    |          259 |
| feature  |         4789 |
| goal     |           12 |
| release  |           10 |
| request  |           75 |
| security |          redacted |
| spike    |          183 |
+----------+--------------+
11 rows in set (0.584 sec)

Related issues:

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Draft: Render task Due Dates independent of the Deadline task subtyperepos/phabricator/phabricator!88aklapperT335395part2wmf/stable
Draft: Render task Due Dates independent of the Deadline task subtyperepos/phabricator/extensions!54aklapperT335395part1wmf/stable
Draft: Render task Due Dates independent of the Deadline task subtyperepos/phabricator/phabricator!81aklapperT335395step1wmf/stable
Customize query in GitLab

Event Timeline

Aklapper triaged this task as Low priority.
Krinkle subscribed.

Sounds good to me. I'm not aware of a downside (happy to learn otherwise), and this seems likely to help make things feel less complex.

I realized the downside in T310188#8918485 - no "Due Date stamp" when removing this task subtype, due to DeadlineEditEngineSubtype not being called.

  1. Rewrite Due Date rendering implementation not to require a task subtype to render the Due Date in the UI instead of the subtype label, but render the Due Date like a non-default Space is already rendered: as a prefix of the task title.
    1. This requires custom CSS, plus changes in PHUIHeaderView for single task view, and PHUIObjectItemView for workboard and task query result list view.
    2. Ignore other implementations like hovercards.
    3. Obvious downside is adding custom code to three upstream files instead of having one self-contained file in our extensions repo.
  2. Remove current custom now superseded libext/src/customfields/DeadlineEditEngineSubtype.php (rendering due dates like subtypes because they were)
  3. Update existing Forms not to set the Deadline subtype
    1. Ideally understand which Forms expose certain fields and how this has been worked around by users - see the comment in T371025 which states "To set Estimated Story Points and Final Story Points, set the Task Subtype to Deadline"
  4. Mass-change / reset subtype of all existing tasks with Deadline subtype (batch editing supports Set Subtype)
  5. Update docs on https://www.mediawiki.org/wiki/Phabricator/Project_management#Tasks_that_have_a_deadline and https://www.mediawiki.org/wiki/Phabricator/Project_management#Estimated_VS_Final_Story_points
    1. Ideally, also check which Forms to expose/hide by default the Due Date field. This is a bit cumbersome.
  6. Remove subtype from https://phabricator.wikimedia.org/config/edit/maniphest.subtypes/ by patching maniphest.subtypes in https://gitlab.wikimedia.org/repos/phabricator/deployment/-/blob/wmf/stable/scap/templates/phabricator/conf/local/local.json.j2
  7. Sunset https://gitlab.wikimedia.org/repos/phabricator/extensions/-/blob/wmf/stable/src/customfields/DeadlineEditEngineSubtype.php to revert rPHEX4a51d0403c850e030288916a791eafd383668ba3

Bonus point: Deadlines would also get rendered in the user-assigned tasks list at https://phabricator.wikimedia.org/people/tasks/1/. Wasn't the case before.

aklapper closed https://gitlab.wikimedia.org/repos/phabricator/phabricator/-/merge_requests/81

Draft: Render task Due Dates independent of the Deadline task subtype

aklapper opened https://gitlab.wikimedia.org/repos/phabricator/phabricator/-/merge_requests/88

Draft: Render task Due Dates independent of the Deadline task subtype

The two patches above implement step 1 of T335395#10405118. It's ugly architecture though as I'm checking in generic PHUI classes for the task object type. Problem is that other objects can also have custom fields so things would explode when the DueDate custom field is not found on a non-task object. :-(