don't throw BadMethodCallException on diffs that add images

Summary:
I don't know if there is something more sinister going on
under the covers, but we have a couple of diffs that trigger:

Unhandled Exception ("BadMethodCallException")
Call to a member function getMetadata() on a non-object

when the diff page is handling its async render calls.  One diff
in particular has multiple image adds and thus has a stack of of these
error dialogs to close.

This isn't a new regression, we just haven't gotten around to debugging
it until now (reported on 6/12)

One revision that triggers it has two diffs.  If I show Base -> Diff 1
I don't hit the error.  When I select Base -> Diff 2, or Diff 1 -> Diff
2, the error triggers.

I don't understand what this means, but this diff avoids the null object
reference that causes the exception.

Test Plan:
Load the offending diff, don't hit the error. The diff loads
the images that were added

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6851
Allow MetaMTA adapters to indicate that a mail is permanently undeliverable

Summary: Currently, adapters can only fail mail temporarily. Allow them to indicate a permanent failure by throwing a special exception.

Test Plan: Added and ran unit tests.

Reviewers: wez, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D6847
Compose and display method information in Diviner

Summary:
Ref T988. As mentioned elsewhere, one broad goal of this iteration is to reduce the amount of boilerplate documentation we need to write. For example:

  - I want to set `@group` by default in most cases.
  - I want to inherit things like `@param` and `@return` by default.
  - I want to inherit method documentation by default.
  - I want to inherit `@task` information.

This implements most of the method inheritance stuff.

This //looks// super gross, but I believe we now compose all of the information of interest at display time and can work on rendering it sensibly in the near future.

Test Plan: {F56790}

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran, sascha-egerer

Maniphest Tasks: T988

Differential Revision: https://secure.phabricator.com/D6849
In Diviner, parse "abstract" and "final" in PHP classes, interfaces and methods

Summary: Ref T988. Adds support for the "abstract" and "final" keywords in the atomizer.

Test Plan: Looked at abstract/final stuff.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T988

Differential Revision: https://secure.phabricator.com/D6850
Restore white background to Paste

Summary: I think we lost this recently (maybe with the line highlighting change), but it's more readable if we put these on a white background.

Test Plan: Looked at a Paste (like `/P123`), saw white background.

Reviewers: chad, btrahan, asherkin

Reviewed By: asherkin

CC: aran

Differential Revision: https://secure.phabricator.com/D6852
Add Base Grey set of colors

Summary: This adds a set of standard grey colors for use in shading objects and importance. I'll follow up and start implementing in another diff.

Test Plan: Color UI Examples, Adobe Kuler

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6853
Add "Authored" as a default filter to Differential

Summary: Fixes T3786. Not 100% sold on this (I don't want to restore all of the original filters, since users can and should just build the weird ones if they use them), but this is almost certainly the most useful of the defaults which ApplicationSearch removed.

Test Plan: Viewed `/differential/`, executed the query.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T3786

Differential Revision: https://secure.phabricator.com/D6860
Move #666 to $greytext in UIColor

Summary: Split some of these up for safe regexes.

Test Plan: reload celerity

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6858
UIColor Blues and common color integration

Summary: This adds standard 'blues' and start integration of standard colors for text, backgrounds, and borders.

Test Plan: sb

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6857
Move #888 and #999 to $lightgreytext

Summary: Moves lighter grey text to a common color.

Test Plan: sandbox, review diff

Reviewers: epriestley, btrahan, mutech.aka

Reviewed By: mutech.aka

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6859
Allow Diviner groups to be configured in `.book` files

Summary:
Ref T988. Currently, every class/function needs to be annotated with `@group`, but 99% of this data can be inferred from file structure, at least in this project. Allow group specifications like:

  "paste" : {
    "name" : "Paste",
    "include" : "(^src/applications/paste/)"
  }

..to automatically put everything defined there in the "paste" group. A list of regexps is also supported. Depends on D6855.

Test Plan: Regenerated documentation with `bin/diviner generate --book src/docs/book/phabricator.book --clean`, observed all Paste stuff go in the paste group.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T988

Differential Revision: https://secure.phabricator.com/D6856
Fix spacing, color in Conpherence Pontificate button

Summary: Spacing got broken during forms update.

Test Plan: View Conpherence

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6863
User preference for time format

Summary: Also, don't try to load prefs for non-users.

Test Plan: toggle, save, look at something with a time. arc unit.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6796
Maniphest - fix fatal in custom query for users with no projects

Summary: See https://github.com/facebook/phabricator/issues/380 for report.

Test Plan: Maniphest -> Custom Query -> Put user with no project in "Any User Projects" field -> Search : observe no fatal

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6862
More grey text updates

Summary: More grey tweaks, breaking these up so I can test and tweak each as needed.

Test Plan: Review pages.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6866
Add Twitter as an authentication provider

Summary: Ref T3687. Depends on D6864. Implements the `OAuth1` provider in Phabricator (which is mostly similar to the OAuth2 provider, but doesn't share quite enough code to actually extend a common base class, I think) and Twitter as a concrete subclass.

Test Plan:
Created a Twitter provider. Registered, logged in, linked, refreshed account link.

{F57054}

{F57056}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3687

Differential Revision: https://secure.phabricator.com/D6865
Add JIRA as an authentication provider

Summary:
Ref T3687. Depends on D6867. This allows login/registration through JIRA.

The notable difference between this and other providers is that we need to do configuration in two stages, since we need to generate and save a public/private keypair before we can give the user configuration instructions, which takes several seconds and can't change once we've told them to do it.

To this effect, the edit form renders two separate stages, a "setup" stage and a "configure" stage. In the setup stage the user identifies the install and provides the URL. They hit save, we generate a keypair, and take them to the configure stage. In the configure stage, they're walked through setting up all the keys. This ends up feeling a touch rough, but overall pretty reasonable, and we haven't lost much generality.

Test Plan: {F57059}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3687

Differential Revision: https://secure.phabricator.com/D6868
Replace all "attach first..." exceptions with `assertAttached()`

Summary:
Ref T3599
Go through everything, grep a bit, replace some bits.

Test Plan: Navigate around a bit

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Maniphest Tasks: T3599

Differential Revision: https://secure.phabricator.com/D6871
Color tweaks for action list, headers

Summary: Starting to roll out the standard colors and spacing to action list, headers, and property views. Also softened the grey borders a hex.

Test Plan: Review Maniphest and Differential on desktop and mobile. Felt the flow of standardization waft over me.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6869
Tighten up ObjectItemList icons

Summary: Pulls the icon flush right in the objectlistview.

Test Plan: Review my stale diffs, and UIExamples page.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6875