Commit df8a56e6 authored by Ryan Cobb's avatar Ryan Cobb

Rename Gitlab::Importers module

In order to avoid confusion between Gitlab::Importers module and other
like named modules, this renamed it to Gitlab::DatabaseImporters.
parent 68b37a99
# frozen_string_literal: true # frozen_string_literal: true
::Gitlab::Importers::CommonMetrics::Importer.new.execute ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute
# frozen_string_literal: true # frozen_string_literal: true
::Gitlab::Importers::CommonMetrics::Importer.new.execute ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute
...@@ -6,7 +6,7 @@ class ImportCommonMetrics < ActiveRecord::Migration[4.2] ...@@ -6,7 +6,7 @@ class ImportCommonMetrics < ActiveRecord::Migration[4.2]
DOWNTIME = false DOWNTIME = false
def up def up
::Gitlab::Importers::CommonMetrics::Importer.new.execute ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute
end end
def down def down
......
...@@ -4,7 +4,7 @@ class ImportCommonMetricsNginxVts < ActiveRecord::Migration[5.0] ...@@ -4,7 +4,7 @@ class ImportCommonMetricsNginxVts < ActiveRecord::Migration[5.0]
DOWNTIME = false DOWNTIME = false
def up def up
::Gitlab::Importers::CommonMetrics::Importer.new.execute ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute
end end
def down def down
......
...@@ -6,7 +6,7 @@ class ImportCommonMetricsKnative < ActiveRecord::Migration[5.0] ...@@ -6,7 +6,7 @@ class ImportCommonMetricsKnative < ActiveRecord::Migration[5.0]
DOWNTIME = false DOWNTIME = false
def up def up
::Gitlab::Importers::CommonMetrics::Importer.new.execute ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute
end end
def down def down
......
...@@ -9,7 +9,7 @@ class PrometheusKnative05Fix < ActiveRecord::Migration[5.0] ...@@ -9,7 +9,7 @@ class PrometheusKnative05Fix < ActiveRecord::Migration[5.0]
DOWNTIME = false DOWNTIME = false
def up def up
::Gitlab::Importers::CommonMetrics::Importer.new.execute ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute
end end
def down def down
......
...@@ -36,7 +36,7 @@ class ImportCommonMetrics < ActiveRecord::Migration[4.2] ...@@ -36,7 +36,7 @@ class ImportCommonMetrics < ActiveRecord::Migration[4.2]
DOWNTIME = false DOWNTIME = false
def up def up
::Gitlab::Importers::CommonMetrics::Importer.new.execute ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute
end end
def down def down
......
# frozen_string_literal: true # frozen_string_literal: true
module Gitlab module Gitlab
module Importers module DatabaseImporters
module CommonMetrics module CommonMetrics
end end
end end
......
# frozen_string_literal: true # frozen_string_literal: true
module Gitlab module Gitlab
module Importers module DatabaseImporters
module CommonMetrics module CommonMetrics
class Importer class Importer
MissingQueryId = Class.new(StandardError) MissingQueryId = Class.new(StandardError)
......
# frozen_string_literal: true # frozen_string_literal: true
module Gitlab module Gitlab
module Importers module DatabaseImporters
module CommonMetrics module CommonMetrics
class PrometheusMetric < ApplicationRecord class PrometheusMetric < ApplicationRecord
enum group: PrometheusMetricEnums.groups enum group: PrometheusMetricEnums.groups
......
# frozen_string_literal: true # frozen_string_literal: true
module Gitlab module Gitlab
module Importers module DatabaseImporters
module CommonMetrics module CommonMetrics
module PrometheusMetricEnums module PrometheusMetricEnums
def self.groups def self.groups
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'rails_helper' require 'rails_helper'
describe Gitlab::Importers::CommonMetrics::Importer do describe Gitlab::DatabaseImporters::CommonMetrics::Importer do
subject { described_class.new } subject { described_class.new }
context "does import common_metrics.yml" do context "does import common_metrics.yml" do
...@@ -87,7 +87,7 @@ describe Gitlab::Importers::CommonMetrics::Importer do ...@@ -87,7 +87,7 @@ describe Gitlab::Importers::CommonMetrics::Importer do
let(:query_identifier) { } let(:query_identifier) { }
it 'raises exception' do it 'raises exception' do
expect { subject.execute }.to raise_error(Gitlab::Importers::CommonMetrics::Importer::MissingQueryId) expect { subject.execute }.to raise_error(Gitlab::DatabaseImporters::CommonMetrics::Importer::MissingQueryId)
end end
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'rails_helper' require 'rails_helper'
describe Gitlab::Importers::CommonMetrics::PrometheusMetric do describe Gitlab::DatabaseImporters::CommonMetrics::PrometheusMetric do
let(:existing_group_titles) do let(:existing_group_titles) do
::PrometheusMetricEnums.group_details.each_with_object({}) do |(key, value), memo| ::PrometheusMetricEnums.group_details.each_with_object({}) do |(key, value), memo|
memo[key] = value[:group_title] memo[key] = value[:group_title]
...@@ -14,6 +14,6 @@ describe Gitlab::Importers::CommonMetrics::PrometheusMetric do ...@@ -14,6 +14,6 @@ describe Gitlab::Importers::CommonMetrics::PrometheusMetric do
end end
it '.group_titles equals ::PrometheusMetric' do it '.group_titles equals ::PrometheusMetric' do
expect(Gitlab::Importers::CommonMetrics::PrometheusMetricEnums.group_titles).to eq(existing_group_titles) expect(Gitlab::DatabaseImporters::CommonMetrics::PrometheusMetricEnums.group_titles).to eq(existing_group_titles)
end end
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