diff options
author | Maxim Rydkin <maks.rydkin@gmail.com> | 2017-09-06 14:31:37 +0300 |
---|---|---|
committer | Maxim Rydkin <maks.rydkin@gmail.com> | 2017-09-12 22:32:02 +0300 |
commit | e83a8187510b3c44cfd699109ac0bcf02f693fbd (patch) | |
tree | 5ed2ae7542327e628878eae16538de2c85f192d5 | |
parent | 5b296f81e2f49fc7dc2d3b091340a9a8b86eae97 (diff) |
adds changelog
fix CI
fix CI
-rw-r--r-- | changelogs/unreleased/5836-move-lib-ci-into-gitlab-namespace.yml | 5 | ||||
-rw-r--r-- | lib/gitlab/ci/charts.rb | 8 | ||||
-rw-r--r-- | spec/lib/gitlab/import_export/project_tree_saver_spec.rb | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/changelogs/unreleased/5836-move-lib-ci-into-gitlab-namespace.yml b/changelogs/unreleased/5836-move-lib-ci-into-gitlab-namespace.yml new file mode 100644 index 00000000000..44e16512bae --- /dev/null +++ b/changelogs/unreleased/5836-move-lib-ci-into-gitlab-namespace.yml @@ -0,0 +1,5 @@ +--- +title: Move `lib/ci` to `lib/gitlab/ci` +merge_request: 14078 +author: Maxim Rydkin +type: other diff --git a/lib/gitlab/ci/charts.rb b/lib/gitlab/ci/charts.rb index ac4bd5d6684..7df7b542d91 100644 --- a/lib/gitlab/ci/charts.rb +++ b/lib/gitlab/ci/charts.rb @@ -4,7 +4,7 @@ module Gitlab module DailyInterval def grouped_count(query) query - .group("DATE(#{Ci::Pipeline.table_name}.created_at)") + .group("DATE(#{::Ci::Pipeline.table_name}.created_at)") .count(:created_at) .transform_keys { |date| date.strftime(@format) } end @@ -18,12 +18,12 @@ module Gitlab def grouped_count(query) if Gitlab::Database.postgresql? 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) .transform_keys(&:squish) else 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) end end @@ -48,7 +48,7 @@ module Gitlab def collect 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) success_count = grouped_count(query.success) diff --git a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb index 8e3554375e8..d9b86e1bf34 100644 --- a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb @@ -119,7 +119,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver 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'))) - 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 end |