guardian/frontend — pull request #2991 by janua (2014-02-03 17:32:28+00:00)
Title: Front Press

This is the initial work for the front-press architecture.

#### Facia Tool
This part of the code presses JSON on each new update to a collection in the tool. It works on a path context, and in the future will work in a more granular collection ID context. It takes a collection ID and figures out what paths use this collection ID, and then presses the whole path ID to `S3`.

There is also new but unused code in here in the form of `FrontPressJob.run()`, which is the very initial code for pulling off IDs off `SQS` and pressing them. Currently the only method in `FrontPressJob` being used should be `pressByCollectionIds`.

In `FrontPress` we are using a new `ExecutionContext` for pressing, as to not clog up the `defaultContext` that the app is serving requests out of. This will be used in the future inside `ParseCollection`.

Since we need new information we already store in `S3` (in `collection.json`) available to us when pressing, we have added `lastUpdated`, `updatedBy` and `updatedEmail` to the `Collection` case class.

#### Facia
There is a new endpoint in the form of `/pressed/*path`, that will return via a blocking call what exists in S3. It uses new methods on the `Content` object: `fromPressedJson`.

#### Other various stuff:
- Front press success and failure metrics
- Front press switch for facia tool
- `ParseCollection` now a part of `common`.

#### Other Notes
I have decided to go for a very explicit JSON parsing approach, instead of using case classes paired with implicit `Read` instances (Which just turn into sort of the same thing anyway). This makes it easier to develop with and a bit clearer.
There is still a lot of work left to do, and this initial request is to just get the massive code change out of the way.
Mainly:
- Reducing the size of the JSON files (By filtering out the elements)
- Mitigating any race conditions in writing (Timestamps and writing in the more granular collection.json context)
- Full refreshes of the front via a queue of some sort.