Commit e83a8187 authored by Maxim Rydkin's avatar Maxim Rydkin

adds changelog

fix CI

fix CI
parent 5b296f81
---
title: Move `lib/ci` to `lib/gitlab/ci`
merge_request: 14078
author: Maxim Rydkin
type: other
...@@ -4,7 +4,7 @@ module Gitlab ...@@ -4,7 +4,7 @@ module Gitlab
module DailyInterval module DailyInterval
def grouped_count(query) def grouped_count(query)
query query
.group("DATE(#{Ci::Pipeline.table_name}.created_at)") .group("DATE(#{::Ci::Pipeline.table_name}.created_at)")
.count(:created_at) .count(:created_at)
.transform_keys { |date| date.strftime(@format) } .transform_keys { |date| date.strftime(@format) }
end end
...@@ -18,12 +18,12 @@ module Gitlab ...@@ -18,12 +18,12 @@ module Gitlab
def grouped_count(query) def grouped_count(query)
if Gitlab::Database.postgresql? if Gitlab::Database.postgresql?
query query
.group("to_char(#{Ci::Pipeline.table_name}.created_at, '01 Month YYYY')") .group("to_char(#{::Ci::Pipeline.table_name}.created_at, '01 Month YYYY')")
.count(:created_at) .count(:created_at)
.transform_keys(&:squish) .transform_keys(&:squish)
else else
query query
.group("DATE_FORMAT(#{Ci::Pipeline.table_name}.created_at, '01 %M %Y')") .group("DATE_FORMAT(#{::Ci::Pipeline.table_name}.created_at, '01 %M %Y')")
.count(:created_at) .count(:created_at)
end end
end end
...@@ -48,7 +48,7 @@ module Gitlab ...@@ -48,7 +48,7 @@ module Gitlab
def collect def collect
query = project.pipelines query = project.pipelines
.where("? > #{Ci::Pipeline.table_name}.created_at AND #{Ci::Pipeline.table_name}.created_at > ?", @to, @from) # rubocop:disable GitlabSecurity/SqlInjection .where("? > #{::Ci::Pipeline.table_name}.created_at AND #{::Ci::Pipeline.table_name}.created_at > ?", @to, @from) # rubocop:disable GitlabSecurity/SqlInjection
totals_count = grouped_count(query) totals_count = grouped_count(query)
success_count = grouped_count(query.success) success_count = grouped_count(query.success)
......
...@@ -119,7 +119,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver do ...@@ -119,7 +119,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
it 'has no when YML attributes but only the DB column' do it 'has no when YML attributes but only the DB column' do
allow_any_instance_of(Ci::Pipeline).to receive(:ci_yaml_file).and_return(File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml'))) allow_any_instance_of(Ci::Pipeline).to receive(:ci_yaml_file).and_return(File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')))
expect_any_instance_of(Ci::GitlabCiYamlProcessor).not_to receive(:build_attributes) expect_any_instance_of(Gitlab::Ci::YamlProcessor).not_to receive(:build_attributes)
saved_project_json saved_project_json
end end
......
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