summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMałgorzata Ksionek <mksionek@gitlab.com>2019-07-02 13:15:42 +0200
committerMałgorzata Ksionek <mksionek@gitlab.com>2019-07-03 16:45:53 +0200
commitac769377e67884b61d56dcbd784b7d8733afc993 (patch)
tree90038d86a614f86aa270d35334fd5012c427a257
parent38a26123d94b0857a7a1265c6dd07e85fd2a1360 (diff)
downloadgitlab-ce-12077-move-cycle-analytics-to-group-level-ce-backport.tar.gz
Remove commented code, add comment explaining reasoning12077-move-cycle-analytics-to-group-level-ce-backport
-rw-r--r--lib/gitlab/cycle_analytics/summary/group/commit.rb23
-rw-r--r--spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb23
2 files changed, 2 insertions, 44 deletions
diff --git a/lib/gitlab/cycle_analytics/summary/group/commit.rb b/lib/gitlab/cycle_analytics/summary/group/commit.rb
index 66556320b87..39cab122f68 100644
--- a/lib/gitlab/cycle_analytics/summary/group/commit.rb
+++ b/lib/gitlab/cycle_analytics/summary/group/commit.rb
@@ -9,30 +9,11 @@ module Gitlab
n_('Commit', 'Commits', value)
end
+ # I'm not sure how iterating per project on gitaly service will perform,
+ # I propose not to show commits per group for MVC
def value
0
- # @value ||= count_commits
end
-
- # private
-
- # Don't use the `Gitlab::Git::Repository#log` method, because it enforces
- # a limit. Since we need a commit count, we _can't_ enforce a limit, so
- # the easiest way forward is to replicate the relevant portions of the
- # `log` function here.
- # def count_commits
- # return unless ref
-
- # gitaly_commit_client.commit_count(ref, after: @from)
- # end
-
- # def gitaly_commit_client
- # Gitlab::GitalyClient::CommitService.new(@project.repository.raw_repository)
- # end
-
- # def ref
- # @ref ||= @project.default_branch.presence
- # end
end
end
end
diff --git a/spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb b/spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb
index 3cb17ba163d..f87a80af7f0 100644
--- a/spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb
+++ b/spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb
@@ -28,29 +28,6 @@ describe Gitlab::CycleAnalytics::GroupStageSummary do
end
end
- # describe "#commits" do
- # it "finds the number of commits created after the 'from date'" do
- # Timecop.freeze(5.days.ago) { create_commit("Test message", project, user, 'master') }
- # Timecop.freeze(5.days.from_now) { create_commit("Test message", project_2, user, 'master') }
- # Timecop.freeze(5.days.from_now) { create_commit("Test message", project, user, 'master') }
-
- # expect(subject.second[:value]).to eq(2)
- # end
-
- # it "doesn't find commits from other projects" do
- # Timecop.freeze(5.days.from_now) { create_commit("Test message", create(:project, :repository, namespace: create(:group)), user, 'master') }
-
- # expect(subject.second[:value]).to eq(0)
- # end
-
- # it "finds a large (> 100) snumber of commits if present" do
- # Timecop.freeze(5.days.from_now) { create_commit("Test message", project, user, 'master', count: 51) }
- # Timecop.freeze(5.days.from_now) { create_commit("Test message", project_2, user, 'master', count: 51) }
-
- # expect(subject.second[:value]).to eq(100)
- # end
- # end
-
describe "#deploys" do
it "finds the number of deploys made created after the 'from date'" do
Timecop.freeze(5.days.ago) { create(:deployment, :success, project: project) }