Error thrown in cycle analytics events if build has not started
We'll have to deal with builds that have not yet started
ArgumentError at /gitlab-org/gitlab-ce/cycle_analytics/events/test.json
=======================================================================
> comparison of Time with nil failed
app/serializers/entity_date_helper.rb, line 5
---------------------------------------------
1 module EntityDateHelper
2 include ActionView::Helpers::DateHelper
3
4 def interval_in_words(diff)
> 5 "#{distance_of_time_in_words(Time.now, diff)} ago"
6 end
7
8 # Converts seconds into a hash such as:
9 # { days: 1, hours: 3, mins: 42, seconds: 40 }
10 #
App backtrace
-------------
- app/serializers/entity_date_helper.rb:5:in `interval_in_words'
- app/serializers/analytics_build_entity.rb:12:in `block in <class:AnalyticsBuildEntity>'
- lib/gitlab/cycle_analytics/staging_event.rb:27:in `serialize'
- lib/gitlab/cycle_analytics/base_event.rb:18:in `block in fetch'
- lib/gitlab/cycle_analytics/base_event.rb:17:in `fetch'
- lib/gitlab/cycle_analytics/staging_event.rb:17:in `fetch'
- lib/gitlab/cycle_analytics/events.rb:22:in `test_events'
- app/controllers/projects/cycle_analytics/events_controller.rb:26:in `test'
- lib/gitlab/request_profiler/middleware.rb:15:in `call'
- lib/gitlab/middleware/go.rb:16:in `call'
- lib/gitlab/middleware/static.rb:9:in `call'