Page MenuHomePhabricator

Allow Differential Mail to accept multiple comments for one mail
ClosedPublic

Authored by epriestley on Feb 11 2014, 9:22 PM.
Tags
None
Referenced Files
F14060704: D8199.diff
Mon, Nov 18, 3:08 AM
F14046023: D8199.diff
Wed, Nov 13, 5:21 PM
F14038493: D8199.id18553.diff
Sun, Nov 10, 11:54 PM
F14037298: D8199.diff
Sun, Nov 10, 2:58 PM
F14024194: D8199.id18550.diff
Thu, Nov 7, 6:59 AM
F14021047: D8199.diff
Wed, Nov 6, 4:56 AM
F14005597: D8199.id.diff
Sun, Oct 27, 4:31 PM
F14003837: D8199.id18553.diff
Sat, Oct 26, 11:22 AM
Subscribers

Details

Summary

Ref T2222. Currently, one DifferentialComment can do a lot of things (add ccs, reviewers, comments, inline comments, and perform state changes). In the future, each ApplicationTransaction does only one thing. This is the primary piece of complexity which makes the upcoming migration risky, because each comment needs to migrate into multiple transactions.

I want to mitigate this complexity as much as possible before the migration itself happens. One approach I'm going to use to do that is to start writing one comment per effect now, so the mapping is more direct when the migration itself happens and the write code can be straightforward (one row per save()) after the migration.

This tackles a small piece of that, which is the mail Differential sends. Currently, Differential mail acts on a single comment. Instead, allow it to act on a list of comments, but always give it one comment for now. In the future, we can hand it several comments instead and still get the expected behavior.

This change should have no impact on any application behaviors.

Test Plan
  • Commented;
  • commented with inline;
  • added reviewers;
  • added CCs;
  • added CCs via mentions;
  • updated revision;
  • looked at all the mail, all of which seemed sane.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

src/applications/differential/editor/DifferentialRevisionEditor.php
389โ€“391

There are no functional changes here, this is just a simplification. $comment is never used. The old code is the same as the new code.

src/applications/differential/mail/DifferentialReviewRequestMail.php
7โ€“18

This method meant (and continues to mean) "set the body text of the mail", and does not refer to comment objects.