For some reason API sends us pusher auth keys without a proper pusher
key, ie. instead of "{actual_pusher_key}:{signature}" it sends
"key:{signature}". For now I'm just fixing it on the client, but this
needs further investigation in the API.
It seems that phantomjs 2.0.0 has problems with running tessts built
with new ember-cli and sauce labs tests seem to work again. I'm
switching back to sauce labs on pushes for the time being.
New ember-data serializers send data without a model key in the payload
by default, so instead of what API expects:
{
"hook": {
"id": 1,
"active": true
}
}
it would send:
{ "id": 1, "active": true }
Because of that we need to change how hooks are serialized.
Furthermore, API V2 returns just "result: true" after a successful
request to change a hook, so we need to return something meaningful from
the adapter's updateRecord in order to make ember-data happy.
`lastBuild` is a synchronous relationship on a branch model, so we need to
have a build record present when we put a default branch from a repository
model into the store. We don't send lastBuild's payload in pusher, so
we need to get it using an ajax call, if it's not already in the store.
In the future we may decide to make the relationship async, but I don't
want to change the code at the moment
Removed code was checking if we should handle a pusher event, ie. if the
event is associated with the user, or if we already have a record
associated with the event. We don't need the check now, because we no
longer use the common channel.
In a repo route we need to find record by slug there is no easy way to
do it with a public finders API, so we need to use adapter and
serializers directly. The problem is that the old way of doing this
didn't use the normalizePayload function and also it didn't add included
records properly. New code properly normalizes response and adds all of
the embedded records that were extracted from the response.