diff options
author | James Lopez <james@jameslopez.es> | 2016-12-05 12:45:07 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-01-17 13:32:55 +0300 |
commit | 099aa124ebefac0ab490ab8e28294e0ea78279de (patch) | |
tree | ad73f494027ed2c0a8a262ed3ba6e2b869a1f76f /lib/gitlab/cycle_analytics | |
parent | 3f681f4cefb5eda594acaab2eaf1be18ebd9066c (diff) |
fix plan stage issue and some spec failures
Diffstat (limited to 'lib/gitlab/cycle_analytics')
-rw-r--r-- | lib/gitlab/cycle_analytics/base_stage.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/cycle_analytics/metrics_fetcher.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/cycle_analytics/plan_stage.rb | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/gitlab/cycle_analytics/base_stage.rb b/lib/gitlab/cycle_analytics/base_stage.rb index f81a41bccb6..c2605364ff0 100644 --- a/lib/gitlab/cycle_analytics/base_stage.rb +++ b/lib/gitlab/cycle_analytics/base_stage.rb @@ -15,7 +15,9 @@ module Gitlab end def event - @event ||= Gitlab::CycleAnalytics::Event[stage].new(fetcher: @fetcher, options: @options, stage: stage) + @event ||= Gitlab::CycleAnalytics::Event[stage].new(fetcher: @fetcher, + options: @options, + stage: stage) end def events diff --git a/lib/gitlab/cycle_analytics/metrics_fetcher.rb b/lib/gitlab/cycle_analytics/metrics_fetcher.rb index dd291840ecd..559dbc0e8fc 100644 --- a/lib/gitlab/cycle_analytics/metrics_fetcher.rb +++ b/lib/gitlab/cycle_analytics/metrics_fetcher.rb @@ -47,7 +47,11 @@ module Gitlab end def order - @stage.event.order || @stage.start_time_attrs.is_a?(Array) ? @stage.start_time_attrs.first : @stage.start_time_attrs + @stage.event.order || default_order + end + + def default_order + @stage.start_time_attrs.is_a?(Array) ? @stage.start_time_attrs.first : @stage.start_time_attrs end # Join table with a row for every <issue,merge_request> pair (where the merge request diff --git a/lib/gitlab/cycle_analytics/plan_stage.rb b/lib/gitlab/cycle_analytics/plan_stage.rb index de2d5aaeb23..f8c9b9c4495 100644 --- a/lib/gitlab/cycle_analytics/plan_stage.rb +++ b/lib/gitlab/cycle_analytics/plan_stage.rb @@ -10,7 +10,7 @@ module Gitlab end def stage - :code + :plan end def description |