Page MenuHomePhabricator

Differential - add ability to setup "create" addresses for revisions
ClosedPublic

Authored by btrahan on Jan 29 2015, 11:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 6:17 AM
Unknown Object (File)
Mon, May 6, 8:52 AM
Unknown Object (File)
Fri, May 3, 3:59 AM
Unknown Object (File)
Mon, Apr 29, 4:10 PM
Unknown Object (File)
Wed, Apr 24, 11:56 PM
Unknown Object (File)
Sat, Apr 20, 11:16 PM
Unknown Object (File)
Mon, Apr 15, 5:28 AM
Unknown Object (File)
Apr 11 2024, 8:12 AM
Tokens
"Love" token, awarded by johnny-bit."Love" token, awarded by epriestley.

Details

Reviewers
epriestley
Maniphest Tasks
Restricted Maniphest Task
Commits
Restricted Diffusion Commit
rP2fc43598b5a3: Differential - add ability to setup "create" addresses for revisions
Summary

Fixes T1476. The body of the email should be just the output of some diff command.

Test Plan

git diff master > text.txt; ./bin/mail receive-test --to <configured-diff-create-address> < text.txt; a diff was successfully created...! email generated had a working link to the diff.

./bin/mail receive-test --to <configured-diff-create-address> < README.md; a diff was not created as expected...! email generated had a sensical error message, telling me that the mail body should have been generated via a diff command

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

btrahan added a task: Restricted Maniphest Task.
btrahan retitled this revision from to Differential - add ability to setup "create" addresses for revisions.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.
src/applications/differential/application/PhabricatorDifferentialApplication.php
171–172

this doesn't render right at the moment where its used. what's the fancy command for svn users? also, its just hg diff right? I think I've got the git diff right at least.

epriestley edited edge metadata.
  • Feels a little weird to actually create a revision with no info -- maybe just create a diff, and let the user use the web link to turn it into a revision?
  • Users might try to email diffs -- I could imagine possibly doing something like this, maaaybe:
$diff = null;

foreach ($mail->getAttachments() as $attachment) {
   try {
     $diff = create from attachment;
   } catch ignore {}
}

if (!$diff) {
  $diff = create from mail body;
}
  • Does this work OK if you send it bogus junk? I think we sorted that out but maybe worth double checking if you didn't.
This revision is now accepted and ready to land.Jan 29 2015, 11:37 PM
src/applications/differential/application/PhabricatorDifferentialApplication.php
171–172

I think this text is fine as written, all of git diff ,hg diff and svn diff do something meaningful/relevant.

On the attachment logic, my theory is that users might send one actual attachment, but sometimes mail program send random signature files and company logos and stuff.

On the attachment logic, my theory is that users might send one actual attachment, but sometimes mail program send random signature files and company logos and stuff.

You're spot-on with this assumptions. I work with mail servers daily and I can tell You that with attachments 90% of time even if user didn't attach anything, something's there. It might be VCard (contact data), MCS (Mandatory Company Signature), Attachments with pictures that go into signature, antivirus/antimalware scan report ("Ima antivirus and i say dis mail is gut"), public key for signing... Loads of random stuff that nobody is aware that they even exist, but when You try to parse it... It's nightmare.

btrahan edited edge metadata.
  • change the algorithm to
    • filter attachments down to just text/plain, giving an error for any filtered files
    • make a diff for each file, giving an error if any file fails to make a diff
    • make a diff for the mail body, giving an error if the mail body doesn't parse
  • re-jigger the email formatting
    • go for the fancy HTML stuff
    • show a list of filename: diff_uri with (if made) Mail Body: diff_uri at the bottom
    • make the errors show up at the bottom of the email

update AppEmailBlurb to accuracy re: attachments

This revision was automatically updated to reflect the committed changes.