Module: Ci::TrackEnvironmentUsage

Extended by:
ActiveSupport::Concern
Included in:
Build
Defined in:
app/models/concerns/ci/track_environment_usage.rb

Instance Method Summary collapse

Instance Method Details

#count_user_deployment?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/models/concerns/ci/track_environment_usage.rb', line 23

def count_user_deployment?
  deployment_name?
end

#deployment_name?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'app/models/concerns/ci/track_environment_usage.rb', line 27

def deployment_name?
  self.class::DEPLOYMENT_NAMES.any? { |n| name.downcase.include?(n) }
end

#track_deployment_usageObject



7
8
9
10
11
# File 'app/models/concerns/ci/track_environment_usage.rb', line 7

def track_deployment_usage
  return unless user_id.present? && count_user_deployment?

  Gitlab::Utils::UsageData.track_usage_event('ci_users_executing_deployment_job', user_id)
end

#track_verify_environment_usageObject



13
14
15
16
17
# File 'app/models/concerns/ci/track_environment_usage.rb', line 13

def track_verify_environment_usage
  return unless user_id.present? && verifies_environment?

  Gitlab::Utils::UsageData.track_usage_event('ci_users_executing_verify_environment_job', user_id)
end

#verifies_environment?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/models/concerns/ci/track_environment_usage.rb', line 19

def verifies_environment?
  has_environment_keyword? && environment_action == 'verify'
end