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
F13479000: D18934.diff
Fri, Jul 19, 4:25 AM
F13461261: D18934.diff
Mon, Jul 15, 12:12 PM
F13430573: D18934.diff
Wed, Jul 10, 6:06 AM
F13378304: D18934.diff
Sat, Jun 29, 4:43 AM
F13347073: D18934.id.diff
Sat, Jun 22, 2:52 AM
F13337765: D18934.id45406.diff
Jun 19 2024, 9:59 AM
F13311528: D18934.diff
Jun 11 2024, 5:09 AM
F13311339: D18934.id45407.diff
Jun 11 2024, 3:41 AM
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.