Module: Ci::TrackEnvironmentUsage
- Extended by:
- ActiveSupport::Concern
- Included in:
- Build
- Defined in:
- app/models/concerns/ci/track_environment_usage.rb
Instance Method Summary collapse
- #count_user_deployment? ⇒ Boolean
- #deployment_name? ⇒ Boolean
- #track_deployment_usage ⇒ Object
- #track_verify_environment_usage ⇒ Object
- #verifies_environment? ⇒ Boolean
Instance Method Details
#count_user_deployment? ⇒ 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
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_usage ⇒ Object
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_usage ⇒ Object
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
19 20 21 |
# File 'app/models/concerns/ci/track_environment_usage.rb', line 19 def verifies_environment? has_environment_keyword? && environment_action == 'verify' end |