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
F14069362: D11574.diff
Wed, Nov 20, 5:58 AM
F14054259: D11574.diff
Fri, Nov 15, 11:40 PM
F14041605: D11574.diff
Mon, Nov 11, 7:58 PM
F14026789: D11574.diff
Fri, Nov 8, 2:23 AM
F14000598: D11574.id27852.diff
Thu, Oct 24, 11:11 PM
F13975034: D11574.id27861.diff
Oct 18 2024, 8:25 AM
Unknown Object (File)
Oct 12 2024, 1:24 AM
Unknown Object (File)
Oct 11 2024, 9:28 PM
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
Branch
T1476
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 4184
Build 4197: [Placeholder Plan] Wait for 30 Seconds

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.