Module: Gitlab::Monitor::DemoProjects

Defined in:
lib/gitlab/monitor/demo_projects.rb

Overview

Constant Summary collapse

DOT_COM_IDS =
[14986497, 12507547].freeze
STAGING_IDS =
[4422333].freeze

Class Method Summary collapse

Class Method Details

.primary_keysObject


13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/gitlab/monitor/demo_projects.rb', line 13

def self.primary_keys
  # .com? returns true for staging
  if ::Gitlab.com? && !::Gitlab.staging?
    DOT_COM_IDS
  elsif ::Gitlab.staging?
    STAGING_IDS
  elsif ::Gitlab.dev_or_test_env?
    Project.limit(100).pluck(:id) # rubocop: disable CodeReuse/ActiveRecord
  else
    []
  end
end