Commit 3ed12ee6 authored by allison.browne's avatar allison.browne Committed by Ash McKenzie

Change oids to primary_keys

parent dcc3b50c
......@@ -16,7 +16,7 @@ module Clusters
idempotent!
def perform
demo_project_ids = Gitlab::Monitor::DemoProjects.oids
demo_project_ids = Gitlab::Monitor::DemoProjects.primary_keys
clusters = Clusters::Cluster.with_application_prometheus
.with_project_alert_service_data(demo_project_ids)
......
......@@ -5283,8 +5283,7 @@ CREATE TABLE public.project_settings (
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
push_rule_id bigint,
show_default_award_emojis boolean DEFAULT true,
CONSTRAINT check_bde223416c CHECK ((show_default_award_emojis IS NOT NULL))
show_default_award_emojis boolean DEFAULT true NOT NULL
);
CREATE TABLE public.project_statistics (
......
......@@ -6,7 +6,7 @@ module Gitlab
DOT_COM_IDS = [14986497, 12507547].freeze
STAGING_IDS = [4422333].freeze
def self.oids
def self.primary_keys
if ::Gitlab.com?
DOT_COM_IDS
elsif ::Gitlab.staging?
......
......@@ -3,22 +3,22 @@
require 'spec_helper'
describe Gitlab::Monitor::DemoProjects do
describe '#oids' do
subject { described_class.oids }
describe '#primary_keys' do
subject { described_class.primary_keys }
it 'fetches oids when in test env' do
it 'fetches primary_keys when in test env' do
project = create(:project)
expect(subject).to eq([project.id])
end
it 'fetches oids when on gitlab.com' do
it 'fetches primary_keys when on gitlab.com' do
expect(Gitlab).to receive(:'com?').and_return(true)
expect(subject).to eq(Gitlab::Monitor::DemoProjects::DOT_COM_IDS)
end
it 'fetches oids when on staging' do
it 'fetches primary_keys when on staging' do
expect(Gitlab).to receive(:staging?).and_return(true)
expect(subject).to eq(Gitlab::Monitor::DemoProjects::STAGING_IDS)
......
......@@ -7,7 +7,7 @@ describe Clusters::Applications::CheckPrometheusHealthWorker, '#perform' do
it 'triggers health service' do
cluster = create(:cluster)
allow(Gitlab::Monitor::DemoProjects).to receive(:oids)
allow(Gitlab::Monitor::DemoProjects).to receive(:primary_keys)
allow(Clusters::Cluster).to receive(:with_application_prometheus).and_return(double(with_project_alert_service_data: [cluster]))
service_instance = instance_double(Clusters::Applications::PrometheusHealthCheckService)
......
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