Commit Graph

58 Commits

Author SHA1 Message Date
Piotr Sarnacki
fc40190c29 Optimize log viewer
Till now, log viewer was rendered in handlebars, which was the simplest
solution, but it had a major drawback - every append to log caused it to
rerender which was not efficient and memory consuming.

The new approach is to make Travis.Log interpret the log and send lines
with instructions to the view, so for example if view should add a line,
it gets something like:

    { number: 1, content: '$ bundle install' }

Such approach is required to handle cases where data coming from pusher
is not actually a new line. For example output containing dots from
tests needs to be appended:

    $ rake
    ....

Such output could be sent to client in 2 chunks: "$ rake\n.." and "..".
In such situation we would need to send 3 instructions:

  { number: 1, content: '$ rake' }
  { number: 2, content: '..'     }
  { number: 2, content: '..', append: true }

The third instruction can come much later, because tests can take a
while to run, so we can't assume that each line will come in one piece.

The other scenario is \r, for example when showing progress:

    \rDownloading: 10%
    \rDownloading: 50%
    \rDownloading: 100%

Such input should be changed into such instructions:

  { number: 1, content: 'Downloading: 10%' }
  { number: 1, content: 'Downloading: 50%',  replace: true }
  { number: 1, content: 'Downloading: 100%', replace: true }

Travis.Log also supports folds, for example on bundle install, the code
was rewritten to make folds management simpler.
2012-12-04 22:57:57 +01:00
Piotr Sarnacki
dff93c93fe Don't require some of the attributes for incomplete records
When build or job is not finished, we don't need to load the record
because of them, they will be loaded when 'finished' events come in.
2012-10-31 16:10:42 +01:00
Piotr Sarnacki
6bf5bd3356 Needed to move part of incomplete impl. to store
When using get with path (eg. get('foo.bar.baz')), get method is called
only on the current object and computed property will be called. Because
there is no easy way to overwrite the computed property, I moved
incomplete record loading to ember-data. It's not DRY and it should be
rewritten, but I don't want to do it at this point as we will need to
completely rewrite it when upgrading ember-data.
2012-10-31 00:46:13 +01:00
Piotr Sarnacki
5ae7e1d046 Check also associations for incomplete records 2012-10-28 23:43:17 +01:00
Piotr Sarnacki
300ad58516 Fix incomplete implementation
While testing in the wild I spotted a few problems with it:

* it didn't work for camel case names.
* it was sometimes setting loaded data too late - it needed to use find
  and then save data on the record. Instead it should save data in
  special array saved on store, indexed by clientId
* there is already method to get attributes in ember-data, it just
  doesn't work with Travis.Foo.get('attributes'), it needs
  Ember.get(Travis.Foo, 'attributes') - it makes implementation much
  shorter
2012-10-22 02:54:48 +02:00
Piotr Sarnacki
af00392d15 Fix jobs table when jobs have different config keys
If we have 2 jobs within 1 build, with such config values:

    { rvm: 'jruby-head', jdk: 'oraclejdk7' }
    { rvm: '1.9.3', jdk: null }

We should return jdk in configValues for second build, even if it's not
present. Otherwise table rows may be missing.

(closes #28)
2012-10-20 02:14:17 +02:00
Piotr Sarnacki
9d07ef79ac Fix bug with undefined loadedAttributes 2012-10-16 17:47:03 +02:00
Piotr Sarnacki
96acd8e526 Fix specs and add missing spec file 2012-10-16 12:14:45 +02:00