Page MenuHomePhabricator

Add a basic, general-purpose export workflow for all objects with SearchEngine support
ClosedPublic

Authored by epriestley on Jan 23 2018, 6:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 9:49 AM
Unknown Object (File)
Sat, Dec 7, 3:25 PM
Unknown Object (File)
Fri, Dec 6, 4:13 PM
Unknown Object (File)
Nov 14 2024, 6:51 PM
Unknown Object (File)
Nov 10 2024, 2:38 AM
Unknown Object (File)
Nov 6 2024, 12:10 AM
Unknown Object (File)
Nov 6 2024, 12:10 AM
Unknown Object (File)
Nov 6 2024, 12:10 AM
Subscribers
None

Details

Summary

Depends on D18918. Ref T13046. Ref T5954. Pull logs can currently be browsed in the web UI, but this isn't very powerful, especially if you have thousands of them.

Allow SearchEngine implementations to define exportable fields so that users can "Use Results > Export Data" on any query. In particular, they can use this workflow to download a file with pull logs.

In the future, this can replace the existing "Export to Excel" feature in Maniphest.

For now, we hard-code JSON as the only supported datatype and don't actually make any effort to format the data properly, but this leaves room to add more exporters (CSV, Excel) and data type awareness (integer casting, date formatting, etc) in the future.

For sufficiently large result sets, this will probably time out. At some point, I'll make this use the job queue (like bulk editing) when the export is "large" (affects more than 1K rows?).

Test Plan

Downloaded pull logs in JSON format.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I'm just defining a separate set of fields here rather than trying to piggyback on something like the Conduit fields since I think the fields that make sense for "Export to Excel" and the fields that make sense for API results are probably often very different.

A concrete example is something like "puller" here or "assignee" in Maniphest. It never makes sense to return a username like "alice" over Conduit since a Conduit client can look it up and likely doesn't care anyway, but returning that in an Excel sheet is useful since a less sophisticated user probably can't look it up easily.

This revision is now accepted and ready to land.Jan 23 2018, 9:14 PM
This revision was automatically updated to reflect the committed changes.