Commit 3459ba13 authored by Małgorzata Ksionek's avatar Małgorzata Ksionek

Add cr remarks

parent f6423fa4
...@@ -50,7 +50,7 @@ module Projects ...@@ -50,7 +50,7 @@ module Projects
end end
def cycle_analytics def cycle_analytics
@cycle_analytics ||= ::CycleAnalytics::ProjectLevel.new(project: project, options: options(events_params)) @cycle_analytics ||= ::CycleAnalytics::ProjectLevel.new(project, options: options(events_params))
end end
def events_params def events_params
......
...@@ -9,7 +9,7 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController ...@@ -9,7 +9,7 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController
before_action :authorize_read_cycle_analytics! before_action :authorize_read_cycle_analytics!
def show def show
@cycle_analytics = ::CycleAnalytics::ProjectLevel.new(project: @project, options: options(cycle_analytics_params)) @cycle_analytics = ::CycleAnalytics::ProjectLevel.new(@project, options: options(cycle_analytics_params))
@cycle_analytics_no_data = @cycle_analytics.no_stats? @cycle_analytics_no_data = @cycle_analytics.no_stats?
......
...@@ -32,7 +32,7 @@ module Gitlab ...@@ -32,7 +32,7 @@ module Gitlab
def medians_per_stage def medians_per_stage
projects.each_with_object({}) do |project, hsh| projects.each_with_object({}) do |project, hsh|
::CycleAnalytics::ProjectLevel.new(project: project, options: options).all_medians_by_stage.each do |stage_name, median| ::CycleAnalytics::ProjectLevel.new(project, options: options).all_medians_by_stage.each do |stage_name, median|
hsh[stage_name] ||= [] hsh[stage_name] ||= []
hsh[stage_name] << median hsh[stage_name] << median
end end
......
...@@ -7,7 +7,7 @@ describe 'cycle analytics events' do ...@@ -7,7 +7,7 @@ describe 'cycle analytics events' do
let!(:context) { create(:issue, project: project, created_at: 2.days.ago) } let!(:context) { create(:issue, project: project, created_at: 2.days.ago) }
let(:events) do let(:events) do
CycleAnalytics::ProjectLevel.new(project: project, options: { from: from_date, current_user: user })[stage].events CycleAnalytics::ProjectLevel.new(project, options: { from: from_date, current_user: user })[stage].events
end end
before do before do
......
...@@ -8,7 +8,7 @@ describe 'CycleAnalytics#code' do ...@@ -8,7 +8,7 @@ describe 'CycleAnalytics#code' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:from_date) { 10.days.ago } let(:from_date) { 10.days.ago }
let(:user) { create(:user, :admin) } let(:user) { create(:user, :admin) }
subject { CycleAnalytics::ProjectLevel.new(project: project, options: { from: from_date }) } subject { CycleAnalytics::ProjectLevel.new(project, options: { from: from_date }) }
context 'with deployment' do context 'with deployment' do
generate_cycle_analytics_spec( generate_cycle_analytics_spec(
......
...@@ -8,7 +8,7 @@ describe 'CycleAnalytics#issue' do ...@@ -8,7 +8,7 @@ describe 'CycleAnalytics#issue' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:from_date) { 10.days.ago } let(:from_date) { 10.days.ago }
let(:user) { create(:user, :admin) } let(:user) { create(:user, :admin) }
subject { CycleAnalytics::ProjectLevel.new(project: project, options: { from: from_date }) } subject { CycleAnalytics::ProjectLevel.new(project, options: { from: from_date }) }
generate_cycle_analytics_spec( generate_cycle_analytics_spec(
phase: :issue, phase: :issue,
......
...@@ -8,7 +8,7 @@ describe 'CycleAnalytics#plan' do ...@@ -8,7 +8,7 @@ describe 'CycleAnalytics#plan' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:from_date) { 10.days.ago } let(:from_date) { 10.days.ago }
let(:user) { create(:user, :admin) } let(:user) { create(:user, :admin) }
subject { CycleAnalytics::ProjectLevel.new(project: project, options: { from: from_date }) } subject { CycleAnalytics::ProjectLevel.new(project, options: { from: from_date }) }
generate_cycle_analytics_spec( generate_cycle_analytics_spec(
phase: :plan, phase: :plan,
......
...@@ -8,7 +8,7 @@ describe 'CycleAnalytics#production' do ...@@ -8,7 +8,7 @@ describe 'CycleAnalytics#production' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:from_date) { 10.days.ago } let(:from_date) { 10.days.ago }
let(:user) { create(:user, :admin) } let(:user) { create(:user, :admin) }
subject { CycleAnalytics::ProjectLevel.new(project: project, options: { from: from_date }) } subject { CycleAnalytics::ProjectLevel.new(project, options: { from: from_date }) }
generate_cycle_analytics_spec( generate_cycle_analytics_spec(
phase: :production, phase: :production,
......
...@@ -11,7 +11,7 @@ describe CycleAnalytics::ProjectLevel do ...@@ -11,7 +11,7 @@ describe CycleAnalytics::ProjectLevel do
let(:mr) { create_merge_request_closing_issue(user, project, issue, commit_message: "References #{issue.to_reference}") } let(:mr) { create_merge_request_closing_issue(user, project, issue, commit_message: "References #{issue.to_reference}") }
let(:pipeline) { create(:ci_empty_pipeline, status: 'created', project: project, ref: mr.source_branch, sha: mr.source_branch_sha, head_pipeline_of: mr) } let(:pipeline) { create(:ci_empty_pipeline, status: 'created', project: project, ref: mr.source_branch, sha: mr.source_branch_sha, head_pipeline_of: mr) }
subject { described_class.new(project: project, options: { from: from_date }) } subject { described_class.new(project, options: { from: from_date }) }
describe '#all_medians_by_stage' do describe '#all_medians_by_stage' do
before do before do
......
...@@ -8,7 +8,7 @@ describe 'CycleAnalytics#review' do ...@@ -8,7 +8,7 @@ describe 'CycleAnalytics#review' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:from_date) { 10.days.ago } let(:from_date) { 10.days.ago }
let(:user) { create(:user, :admin) } let(:user) { create(:user, :admin) }
subject { CycleAnalytics::ProjectLevel.new(project: project, options: { from: from_date }) } subject { CycleAnalytics::ProjectLevel.new(project, options: { from: from_date }) }
generate_cycle_analytics_spec( generate_cycle_analytics_spec(
phase: :review, phase: :review,
......
...@@ -9,7 +9,7 @@ describe 'CycleAnalytics#staging' do ...@@ -9,7 +9,7 @@ describe 'CycleAnalytics#staging' do
let(:from_date) { 10.days.ago } let(:from_date) { 10.days.ago }
let(:user) { create(:user, :admin) } let(:user) { create(:user, :admin) }
subject { CycleAnalytics::ProjectLevel.new(project: project, options: { from: from_date }) } subject { CycleAnalytics::ProjectLevel.new(project, options: { from: from_date }) }
generate_cycle_analytics_spec( generate_cycle_analytics_spec(
phase: :staging, phase: :staging,
......
...@@ -8,7 +8,7 @@ describe 'CycleAnalytics#test' do ...@@ -8,7 +8,7 @@ describe 'CycleAnalytics#test' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:from_date) { 10.days.ago } let(:from_date) { 10.days.ago }
let(:user) { create(:user, :admin) } let(:user) { create(:user, :admin) }
subject { CycleAnalytics::ProjectLevel.new(project: project, options: { from: from_date }) } subject { CycleAnalytics::ProjectLevel.new(project, options: { from: from_date }) }
generate_cycle_analytics_spec( generate_cycle_analytics_spec(
phase: :test, phase: :test,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment