Page MenuHomePhabricator

Support CSV, JSON, and tab-separated text as export formats
ClosedPublic

Authored by epriestley on Jan 26 2018, 1:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 9:20 PM
Unknown Object (File)
Wed, Apr 17, 1:14 PM
Unknown Object (File)
Wed, Apr 17, 12:48 PM
Unknown Object (File)
Mon, Apr 15, 5:29 PM
Unknown Object (File)
Mon, Apr 15, 11:18 AM
Unknown Object (File)
Sun, Apr 14, 12:14 PM
Unknown Object (File)
Fri, Apr 12, 1:43 AM
Unknown Object (File)
Thu, Apr 11, 10:27 PM
Subscribers
None

Details

Summary

Depends on D18919. Ref T13046. Adds some simple modular exporters.

Test Plan

Exported pull logs in each format.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

src/applications/search/engine/PhabricatorApplicationSearchEngine.php
1457–1459

This is just a placeholder for a future version of this function which might add a bunch more fields from extensions (subscribers, projects, etc).

src/infrastructure/export/PhabricatorTextExportFormat.php
27–38

This format is basically just "logfile", if you want to process it by piping grep to awk to perl or whatever.

32

(This quotes special characters and backslashes.)

  • Fix a couple of control flow bugs in the text exporter.
amckinley added inline comments.
src/infrastructure/export/PhabricatorIDExportField.php
4–10

Shouldn't this just extend PhabricatorIntExportField?

This revision is now accepted and ready to land.Jan 26 2018, 6:52 PM

Maaaaybe, but I'm hesitant to put non-abstract, non-final classes in the class tree. There's nothing inherently bad about it, but I think it makes compatibility/extensions a bit muddier since it's less clear to third parties what they can safely extend from (see T795 for some very old, mostly obsolete discussion).

We could fix that with an Int abstract base and then make ID and Count final subclasses of that or something.

One material difference between the two fields is that large int values might make sense to render as "1,234,567" -- or with whatever the user's locale settings are -- while this doesn't make sense for IDs. That wouldn't prevent ID from subclassing Int, though. But if we do that, this field shouldn't actually be Int, except that HTTP exception codes don't go up to 1,000. (We'd probably never actually render that in text, I guess, but could do things like "set the excel format flag for the cell to 'number with commas' vs 'number without any commas'").

Since a total of like 3 lines of code are at stake here I'm just going to leave it like this (i.e., simplest class tree) for now.

This revision was automatically updated to reflect the committed changes.