Commit Graph

1041 Commits

Author SHA1 Message Date
Piotr Sarnacki
1cd460e020 Experimental implementation of travis-cmd 2015-11-20 19:09:34 +01:00
Lisa P
59c9fce76c add osx_image to keys-map 2015-11-20 14:47:10 +01:00
Piotr Sarnacki
4a73c17d4c Model#typeKey -> Model#modelName 2015-11-18 17:15:08 +01:00
Piotr Sarnacki
fbe384d5ae Fix key for repo relationship for V3 API 2015-11-18 17:05:32 +01:00
Piotr Sarnacki
e60d16209d Fix loading record by slug
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.
2015-11-18 17:01:59 +01:00
Piotr Sarnacki
bd3b62c264 Fix handling branches
This commit fixes handling of branches when using both V3 and V2. The
changes include:

  * proper definition of relationships that reflect V3 structure, so for
    example build belongs to a branch
  * setting up inverse records for some of the relationships. without
    doing that Ember Data can handle relationships in a surprising way,
    for example if the same record is referenced in 2 places in a
    belongsTo relationship, Ember Data will remove one of the references
    without proper inverse definitions
  * we need to add id when extracting branch as a relationship. Ember
    Data expects all of the relationships to have an id
  * lastly, we need to mimic the structure of the V3 API in V2 payloads,
    so for a build payload I'm now creating a branch record
2015-11-18 17:00:34 +01:00
Piotr Sarnacki
9a9708df31 Fix references in V3 payloads
V3 API doesn't return any of the records more than 2 times. If a record
is already included in the response any other occurences will be
represented as a reference, ie. a hash with just an @href. Ember Data
doesn't play nice with such references as it needs an id to identify a
record.

The code in this commit traverses payloads from V3 API and adds an id to
each of the references that are present.

For example a following payload:

    {
      "@href": "/build/1",
      "@type": "build"
      "id": 1,
      "state": "passed",
      "branch": {
        "@href": "/repo/1/branch/master",
        "name": "master",
        "lastBuild": {
          "@href": "/build/1"
        }
      }
    }

Will be changed to:

    {
      "@href": "/build/1",
      "@type": "build"
      "id": 1,
      "state": "passed",
      "branch": {
        "@href": "/repo/1/branch/master",
        "name": "master",
        "lastBuild": {
          "@href": "/build/1",
          "id": 1
        }
      }
    }

In this case an "id" field was added to "branch.lastBuild" field.
2015-11-18 16:48:21 +01:00
Piotr Sarnacki
df0f883ad0 app/serializers/repo.coffee -> app/serializers/repo.js 2015-11-18 11:48:59 +01:00
Piotr Sarnacki
4e1976d30c Simplify pusher handling in store 2015-11-17 11:48:29 +01:00
Piotr Sarnacki
9222276f87 Remove console.log 2015-11-12 16:13:45 +01:00
Piotr Sarnacki
2267babac0 Fix pusher to work with new ember-data
This commit just fixes things to the point where pusher updates are
applied to the store properly. This still lacks a business logic fixes,
so for example we won't update lastBuild's field, because there's no
such information from pusher.
2015-11-12 16:02:53 +01:00
Piotr Sarnacki
b4ad8a54b7 Disable dashboard test for now 2015-11-12 12:25:55 +01:00
Piotr Sarnacki
d1b9bddfe0 Fix sidebar repos list
We need this list to update with pusher, so filtering is better than
using store.query.
2015-11-11 17:38:59 +01:00
Piotr Sarnacki
8956dedeaf Attribute mappings in serializers should use underscore notation 2015-11-11 16:24:23 +01:00
Piotr Sarnacki
c072738d58 Use job_ids as a key for jobs relationship for build 2015-11-11 15:37:55 +01:00
Piotr Sarnacki
0ceb677aed Don't add commit data to included array in build serializer
We already do it in an abstracted way (ie. for all relationships) in v2
fallback serializer.
2015-11-11 15:17:04 +01:00
Piotr Sarnacki
cf1e5d6ad3 No need to add repo to the list of attributes now 2015-11-11 15:15:36 +01:00
Piotr Sarnacki
3f6ad9cf1a Fix handling relationships for V2 API
* we should look for both embedded relationship and relationship key,
  so in cases like for commit, when there's a full commit data on
  "commit" property, and only id at "commit_id", we will use commit data
* we can't add @type to V2 fallback, because in other places we chack
  for @type to distinguish V2 and V3 payloads
* there's no need to include a record in "included" if there's only a
  type and an id there
2015-11-11 15:15:36 +01:00
Piotr Sarnacki
c6bac57047 Fix job route's use of job.build relationship
build is an async relationship now, so job.get('build') returns a
promise.
2015-11-11 14:50:45 +01:00
Piotr Sarnacki
4a62d4ac9c Fix including to-many relationships for V3 payloads 2015-11-11 12:38:44 +01:00
Piotr Sarnacki
5a2c86697b Properly include relationships for V2 payloads 2015-11-11 12:38:22 +01:00
Piotr Sarnacki
f09742abe1 Convert build serializer to javascript 2015-11-11 11:52:29 +01:00
Piotr Sarnacki
b83e70c324 Update serializers to work with jobs endpoint response 2015-11-10 17:54:43 +01:00
Piotr Sarnacki
5c5c433363 Include repositoryId as an attribute on build
For some reason (probably some problem with one of the serializers) we
sometimes lack an id attribute for a promise that we get for a repo
relationship on build. Because of that doing `build.get('repo.id')` may
sometimes return undefined. A temporary workaround is to make sure that
we always can access the `repository_id` property.
2015-11-10 17:52:32 +01:00
Piotr Sarnacki
264d780931 Use V2FallbackSerializer for jobs 2015-11-10 09:58:59 +01:00
Piotr Sarnacki
1efdcf1290 Don't throw error if broadcastArray is undefined 2015-11-10 09:58:37 +01:00
Piotr Sarnacki
3d7833d64b Use storage service instead of Travis.storage 2015-11-09 14:06:42 +01:00
Piotr Sarnacki
18838acd27 Remove unused settings/index controller 2015-11-09 13:48:31 +01:00
Piotr Sarnacki
bc4b666d9e Observe repos.firstObject on reposController
Since we change repos property on reposController, we can't set observer
on repos, because as soon as it's changed, we loose the observer.
Instead, we should observe only on reposController, which is not going
to change.
2015-11-09 13:48:25 +01:00
Piotr Sarnacki
310627cc55 Sort repos in repos-list component, not in controller 2015-11-09 13:46:55 +01:00
Piotr Sarnacki
2a2b3f018b Use lastBuild from defaultBranch on repository
One thing that is not standard here is a serializer for branch, which
uses @href as id. At this point branches don't have ids and ember-data
needs one, so using @href is the easiest way.
2015-11-09 13:46:54 +01:00
Piotr Sarnacki
6992a79a93 Create adapters and serializers working with v3 and v2 APIs
This commit adds adapters and serializers for v3, but also a fallback
serializer for v2, which allows to handle v2 and v3 payloads at the same
time. This is needed, because when we use v3 endpoint for one of the
models (in this case repo), we can also get embedded records of other
types (like branch or build).
2015-11-09 13:46:54 +01:00
Piotr Sarnacki
22d4f59ce9 Move ajax and auth into services 2015-11-09 13:46:54 +01:00
Piotr Sarnacki
b9de261388 Remove some more deprecations 2015-11-09 13:43:56 +01:00
Lisa P
7d1dce76ee fix z-index of jobs:hover 2015-11-04 11:34:27 +01:00
Lisa P
0f6230fddc fix link-to in branches template 2015-10-29 17:56:29 +01:00
Lisa P
72879709f0 fix broadcasts overlay by removing z-index on the wrong state 2015-10-28 13:35:08 +01:00
Lisa P
fbd7305252 fix branches sorting order 2015-10-28 13:21:23 +01:00
Lisa P
e80f399e83 add icon for pinned tabs in Safari 2015-10-27 14:46:21 +01:00
Lisa P
625e23228a put eye svg into component 2015-10-26 15:22:13 +01:00
Lisa P
512450b7ce tweak icon iris and toolip 2015-10-26 13:48:34 +01:00
Lisa P
8c911fcc2c add eye icon and tooltip to profile token toggle 2015-10-26 12:34:57 +01:00
Lisa P
5f00526700 add toggle functionality to profile token 2015-10-23 17:52:15 +02:00
Lisa P
def57c603b provide fallback for owner page is payload is empty 2015-10-23 17:15:22 +02:00
Lisa P
64a580f299 rewrite icon template logic 2015-10-23 12:17:26 +02:00
Lisa P
68cee22a76 refactor logic change 2015-10-23 11:53:57 +02:00
Lisa P
e1f5086877 also apply new logic to update method 2015-10-22 21:41:29 +02:00
Hiro Asari
52cbf7a130 Merge pull request #404 from HPI-BP2015H/smalltalk
Smalltalk support
2015-10-22 11:30:18 -04:00
Lisa P
d1f3ee2c6f Merge pull request #401 from travis-ci/lp-broadcasts
Broadcasts
2015-10-22 17:29:29 +02:00
Lisa P
aad5530d2e change tower icon color logic 2015-10-22 17:06:12 +02:00