Diffs have half-support for real transactions, but DifferentialDiffEditor is still not a proper transaction editor.
Support Impact This creates various inconsistencies in Differential.
Diffs have half-support for real transactions, but DifferentialDiffEditor is still not a proper transaction editor.
Support Impact This creates various inconsistencies in Differential.
Status | Assigned | Task | ||
---|---|---|---|---|
Resolved | btrahan | T6200 Inconsistency in revision history vs state | ||
Resolved | btrahan | T6152 Show explicit policy controls on web diff creation workflow | ||
Resolved | btrahan | T6237 Use ApplicationTransactions properly in Diff creation |
19:03:08 ~/Dropbox/code/phalanx/src (T6237) ~> grep -r DifferentialDiffEditor * __phutil_library_map__.php: 'DifferentialDiffEditor' => 'applications/differential/editor/DifferentialDiffEditor.php', __phutil_library_map__.php: 'DifferentialDiffEditor' => 'PhabricatorEditor', applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php: id(new DifferentialDiffEditor()) applications/differential/conduit/DifferentialCreateRawDiffConduitAPIMethod.php: id(new DifferentialDiffEditor()) applications/differential/editor/DifferentialDiffEditor.php:final class DifferentialDiffEditor extends PhabricatorEditor {
this is very good news... the problem is basically change those conduit endpoints to use the DifferentialTransactionEditor and then delete the DifferentialDiffEditor.
I was basically really far off with my optimistic assessment.
These two end points create diffs that are later added to revisions, or in other words there is no associated revision. The existing DifferentialTransactionEditor editor is revision based, though it does the PhabricatorLiskDAO thing typically so that's not a hard blocker.
I've been playing around with adding a new DifferentialTransaction::TYPE_DIFF and DifferentialTransaction::TYPE_RAW_DIFF that flows through the existing DifferentialTransactionEditor, mapping to each of these two end points. My architectural concerns here are
Thus, does this two new transaction approach sound right or am I approaching this wrong?
I haven't looked at the code recently, but I would expect the cleanest approach to be to turn DifferentialDiffEditor into a proper transaction editor, which operates on a DifferentialDiff instead of a DifferentialRevision -- not to merge it into DifferentialTransactionEditor.
The idea being that this page gets the Diff transactions at the bottom:
https://secure.phabricator.com/differential/diff/123/
...and this form gets some stuff like "Repository" and "Can View":
https://secure.phabricator.com/differential/diff/create/
...and when you submit just that form (but not the next one) you end up with a diff with some transactions on it, but no revision yet.
I wouldn't store the actual (source code) changes in transactions, because diffs themselves are immutable and I don't anticipate changing that.
Does that make sense?