1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 00:02:41 +01:00
phorge-phorge/src/applications/differential/conduit
epriestley 18938b5310 Migrate Differential comments to ApplicationTransactions
Summary:
Ref T2222. This is the big one.

This migrates each `DifferentialComment` to one or more ApplicationTransactions (action, cc, reviewers, update, comment, inlines), and makes `DifferentialComment` a double-reader for ApplicationTransactions.

The migration is pretty straightforward:

  - If a comment took an action not otherwise covered, it gets an "action" transaction. This is something like "epriestley abandoned this revision.".
  - If a comment updated the diff, it gets an "updated diff" transaction. Very old transactions of this type may not have a diff ID (probably only at Facebook).
  - If a comment added or removed reviewers, it gets a "changed reviewers" transaction.
  - If a comment added CCs, it gets a "subscribers" transaction.
  - If a comment added comment text, it gets a "comment" transaction.
  - For each inline attached to a comment, we generate an "inline" transaction.

Most comments generate a small number of transactions, but a few generate a significant number.

At HEAD, the code is basically already doing this, so comments in the last day or two already obey these rules, roughly, and will all generate only one transaction (except inlines).

Because we've already preallocated PHIDs in the comment text table, we only need to write to the transaction table.

NOTE: This significantly degrades Differential, making inline comments pretty much useless (they each get their own transaction, and don't show line numbers or files). The data is all fine, but the UI is garbage now. This needs to be fixed before we can deploy this to users, but it's easily separable since it's all just display code.

Specifically, they look like this:

{F112270}

Test Plan:
I've migrated locally and put things through their paces, but it's hard to catch sketchy stuff locally because most of my test data is nonsense and bad migrations wouldn't necessarily look out of place.
IMPORTANT: I'm planning to push this to a branch and then shift production over to the branch, and run it for a day or two before bringing it to master.

I generally feel good about this change: it's not that big since we were able to separate a lot of pieces out of it, and it's pretty straightforward. That said, it's still one of the most scary/dangerous changes we've ever made.

Reviewers: btrahan

CC: chad, aran

Maniphest Tasks: T2222

Differential Revision: https://secure.phabricator.com/D8210
2014-02-12 14:34:48 -08:00
..
ConduitAPI_differential_close_Method.php Use DifferentialRevisionQuery in conduit when reviewers are needed 2013-07-15 03:29:13 -07:00
ConduitAPI_differential_createcomment_Method.php Make most Differential reads policy-aware 2013-09-26 12:37:19 -07:00
ConduitAPI_differential_creatediff_Method.php Wrong method name. 2014-01-26 15:30:38 -08:00
ConduitAPI_differential_createinline_Method.php Make most Differential reads policy-aware 2013-09-26 12:37:19 -07:00
ConduitAPI_differential_createrawdiff_Method.php Move Conduit methods inside applications 2012-12-21 12:21:59 -08:00
ConduitAPI_differential_createrevision_Method.php Add DifferentialDiffQuery and change most callsites 2013-07-01 12:38:42 -07:00
ConduitAPI_differential_find_Method.php fix perf regression when using 'owned' query 2013-08-28 13:29:36 -07:00
ConduitAPI_differential_finishpostponedlinters_Method.php Add DifferentialDiffQuery and change most callsites 2013-07-01 12:38:42 -07:00
ConduitAPI_differential_getalldiffs_Method.php Add a differential.getdiffs method 2013-09-17 13:55:41 -07:00
ConduitAPI_differential_getcommitmessage_Method.php Add a "default view" policy to Differential 2013-10-09 13:58:00 -07:00
ConduitAPI_differential_getcommitpaths_Method.php Add DifferentialDiffQuery and change most callsites 2013-07-01 12:38:42 -07:00
ConduitAPI_differential_getdiff_Method.php Remove differential.anonymous-access 2013-11-11 16:05:19 -08:00
ConduitAPI_differential_getrawdiff_Method.php Add differential.getrawdiff to Conduit 2013-10-02 17:03:53 -07:00
ConduitAPI_differential_getrevision_Method.php Fix a missing setViewer() in differential.getrevision 2013-09-23 15:22:57 -07:00
ConduitAPI_differential_getrevisioncomments_Method.php Migrate Differential comments to ApplicationTransactions 2014-02-12 14:34:48 -08:00
ConduitAPI_differential_markcommitted_Method.php Use DifferentialRevisionQuery in conduit when reviewers are needed 2013-07-15 03:29:13 -07:00
ConduitAPI_differential_Method.php Uninstall Conduit calls when uninstalling applications 2013-03-13 07:09:05 -07:00
ConduitAPI_differential_parsecommitmessage_Method.php Split exceptionally huge revision titles into the summary 2013-10-29 21:19:51 -07:00
ConduitAPI_differential_query_Method.php Move Differential to proper subscriptions 2014-02-12 08:53:40 -08:00
ConduitAPI_differential_querydiffs_Method.php Fix a typo in differential.querydiffs 2013-09-30 17:49:23 -07:00
ConduitAPI_differential_setdiffproperty_Method.php Apply lint rules to Phabricator 2013-02-19 13:33:10 -08:00
ConduitAPI_differential_updaterevision_Method.php Add DifferentialDiffQuery and change most callsites 2013-07-01 12:38:42 -07:00
ConduitAPI_differential_updateunitresults_Method.php Add DifferentialDiffQuery and change most callsites 2013-07-01 12:38:42 -07:00