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)
Mon, Apr 15, 5:36 PM
Unknown Object (File)
Tue, Mar 26, 5:53 AM
Unknown Object (File)
Feb 23 2024, 1:31 AM
Unknown Object (File)
Feb 13 2024, 5:38 AM
Unknown Object (File)
Feb 10 2024, 6:39 AM
Unknown Object (File)
Feb 3 2024, 5:45 PM
Unknown Object (File)
Jan 19 2024, 4:51 PM
Unknown Object (File)
Jan 15 2024, 5:21 PM
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.