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.
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.
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
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)