Welcome to mirror list, hosted at ThFree Co, Russian Federation.

prometheus_service_helpers.rb « migrations_helpers « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 88f2f71ee1e9b483a98d99bda0b4458df19cb7dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true

module MigrationHelpers
  module PrometheusServiceHelpers
    def service_params_for(project_id, params = {})
      {
        project_id: project_id,
        active: false,
        properties: '{}',
        type: 'PrometheusService',
        template: false,
        push_events: true,
        issues_events: true,
        merge_requests_events: true,
        tag_push_events: true,
        note_events: true,
        category: 'monitoring',
        default: false,
        wiki_page_events: true,
        pipeline_events: true,
        confidential_issues_events: true,
        commit_events: true,
        job_events: true,
        confidential_note_events: true,
        deployment_events: false
      }.merge(params)
    end

    def row_attributes(entity)
      entity.attributes.with_indifferent_access.tap do |hash|
        hash.merge!(hash.slice(:created_at, :updated_at).transform_values { |v| v.to_s(:db) })
      end
    end
  end
end