Page MenuHomePhabricator

Prepare TransactionCommentQuery for extension
ClosedPublic

Authored by epriestley on Mar 9 2015, 7:18 PM.

Details

Summary

Ref T2009. Ref T1460. The way Diffusion and Differential load inlines is horrible garbage right now:

  • Differential does an ad-hoc query to get the PHIDs, then does a real load to policy check.
  • Diffusion completely fakes things. In practice this is not a policy violation, but it's dangerous.

Make TransactionCommentQuery extensible so we can subclass it and get the query building correctly in the right Query layer.

Specifically, the Diffusion and Differential subclasses of this Query will add appropriate withX() methods to let us express the query in SQL.

Test Plan

Loaded, previewed, edited, and submitted inlines in Differential and Diffusion

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley updated this revision to Diff 28949.Mar 9 2015, 7:18 PM
epriestley retitled this revision from to Prepare TransactionCommentQuery for extension.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
epriestley added inline comments.Mar 9 2015, 7:21 PM
src/applications/transactions/query/PhabricatorApplicationTransactionTemplatedCommentQuery.php
4–5

I split out this concrete subclass because I didn't want nonsense like this to work:

$differential_query = new DifferentialCommentQuery();
$differential_query->setTemplate(new ManiphestTransactionComment());
$differential_query->execute(); // What kind of object does this load?
btrahan accepted this revision.Mar 9 2015, 8:42 PM
btrahan edited edge metadata.
This revision is now accepted and ready to land.Mar 9 2015, 8:42 PM
This revision was automatically updated to reflect the committed changes.