Page MenuHomePhabricator

Replace the chart in Maniphest Reports with a chart driven by Facts
ClosedPublic

Authored by epriestley on Apr 30 2019, 3:42 PM.
Tags
None
Referenced Files
F13050775: D20486.id48992.diff
Fri, Apr 19, 3:11 AM
F13050774: D20486.id48868.diff
Fri, Apr 19, 3:11 AM
F13050773: D20486.id.diff
Fri, Apr 19, 3:11 AM
Unknown Object (File)
Thu, Apr 11, 10:37 AM
Unknown Object (File)
Thu, Apr 11, 4:18 AM
Unknown Object (File)
Sat, Apr 6, 10:22 PM
Unknown Object (File)
Fri, Mar 29, 5:55 PM
Unknown Object (File)
Fri, Mar 29, 3:24 PM
Subscribers

Details

Summary

Depends on D20485. Ref T13279. This removes the ad-hoc charting in Maniphest and replaces it with a Facts-based chart.

(To do this, we build a dashboard panel inline and render it.)

Test Plan

Screen Shot 2019-04-30 at 8.17.45 AM.png (573×1 px, 48 KB)

Diff Detail

Repository
rP Phabricator
Branch
chart15
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/applications/fact/chart/PhabricatorChartFunctionArgument.php:56XHP16TODO Comment
Unit
Tests Passed
Build Status
Buildable 22741
Build 31178: Run Core Tests
Build 31177: arc lint + arc unit

Event Timeline

src/applications/fact/chart/PhabricatorChartFunctionArgument.php
57

By this, I mean that the type should probably be "user" or "project" or whatever (not just "phid"), so we can accept @alice instead of PHID-USER-abcd. But I'm not yet sure how low-level the user-facing stuff is going to be.

src/applications/fact/fact/PhabricatorFact.php
45

This is a little crude for now. The x.y.z.project and x.y.z.owner facts are facts about tasks tagged with projects and assigned to users, and have an object dimension value for which project/owner was tagged/assigned.

For example, if a task is created with alice as an owner, we'll get a row like:

2019-04-30 11:23:45 • tasks.count.create.owner • PHID-TASK-abcd • PHID-USER-alice • +1

..meaning "one task, PHID-TASK-abcd, was created on April 30th with alice as the owner".

So this code is saying "when you chart an owner/project fact, you should specify the PHID of the owner/project you care about", and the rest of the changes here are adding the right WHERE clause for that.

src/applications/maniphest/controller/ManiphestReportController.php
402–403

We count two types of events for open tasks:

  • *.create is when a new task is created into an open status.
  • *.status is when a task is changed from a closed status into an open status (or a negative value, when an open task is closed).

To get the overall open task count for an install, we have to combine these. However, in other views, we might care about reopened tasks separately (e.g., how much of our timeline slippage is due to making mistakes and needing to rework things?), which is why they're tracked separately.

Likewise, above, we count three types of events for project tasks:

  • *.create is when a task is created with a project already tagged.
  • *.status is when a closed task is reopened (or closed).
  • *.assign is when a tag is added or removed.

To show an overall chart, we add these together. In other views, we might care about rework or new scope to help us understand timelines.

This revision is now accepted and ready to land.May 21 2019, 9:34 PM