Commit 13573998 authored by Doug Stull's avatar Doug Stull

Rename snowplow site id to app id

- this falls more inline with our nomenclature for what we call
  the snowplow instance
parent bec1492c
......@@ -293,7 +293,7 @@ module ApplicationSettingsHelper
:snowplow_collector_hostname,
:snowplow_cookie_domain,
:snowplow_enabled,
:snowplow_site_id,
:snowplow_app_id,
:snowplow_iglu_registry_url,
:push_event_hooks_limit,
:push_event_activities_limit,
......
......@@ -132,7 +132,7 @@ module ApplicationSettingImplementation
snowplow_collector_hostname: nil,
snowplow_cookie_domain: nil,
snowplow_enabled: false,
snowplow_site_id: nil,
snowplow_app_id: nil,
snowplow_iglu_registry_url: nil,
custom_http_clone_url_root: nil,
pendo_enabled: false,
......
......@@ -21,8 +21,8 @@
= f.label :snowplow_collector_hostname, _('Collector hostname'), class: 'label-light'
= f.text_field :snowplow_collector_hostname, class: 'form-control', placeholder: 'snowplow.example.com'
.form-group
= f.label :snowplow_site_id, _('Site ID'), class: 'label-light'
= f.text_field :snowplow_site_id, class: 'form-control'
= f.label :snowplow_app_id, _('App ID'), class: 'label-light'
= f.text_field :snowplow_app_id, class: 'form-control'
.form-group
= f.label :snowplow_cookie_domain, _('Cookie domain'), class: 'label-light'
= f.text_field :snowplow_cookie_domain, class: 'form-control'
......
# frozen_string_literal: true
class RenameSnowplowSiteIdToSnowplowAppId < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
def up
rename_column_concurrently :application_settings, :snowplow_site_id, :snowplow_app_id
end
def down
undo_rename_column_concurrently :application_settings, :snowplow_site_id, :snowplow_app_id
end
end
# frozen_string_literal: true
class CleanupApplicationSettingsSnowplowSiteIdRename < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
def up
cleanup_concurrent_column_rename :application_settings, :snowplow_site_id, :snowplow_app_id
end
def down
undo_cleanup_concurrent_column_rename :application_settings, :snowplow_site_id, :snowplow_app_id
end
end
......@@ -287,7 +287,6 @@ ActiveRecord::Schema.define(version: 2019_11_05_094625) do
t.boolean "hide_third_party_offers", default: false, null: false
t.boolean "snowplow_enabled", default: false, null: false
t.string "snowplow_collector_hostname"
t.string "snowplow_site_id"
t.string "snowplow_cookie_domain"
t.boolean "instance_statistics_visibility_private", default: false, null: false
t.boolean "web_ide_clientside_preview_enabled", default: false, null: false
......@@ -350,6 +349,7 @@ ActiveRecord::Schema.define(version: 2019_11_05_094625) do
t.string "eks_access_key_id", limit: 128
t.string "encrypted_eks_secret_access_key_iv", limit: 255
t.text "encrypted_eks_secret_access_key"
t.string "snowplow_app_id"
t.index ["custom_project_templates_group_id"], name: "index_application_settings_on_custom_project_templates_group_id"
t.index ["file_template_project_id"], name: "index_application_settings_on_file_template_project_id"
t.index ["instance_administration_project_id"], name: "index_applicationsettings_on_instance_administration_project_id"
......
......@@ -319,7 +319,7 @@ are listed in the descriptions of the relevant settings.
| `snowplow_collector_hostname` | string | required by: `snowplow_enabled` | The Snowplow collector hostname. (e.g. `snowplow.trx.gitlab.net`) |
| `snowplow_cookie_domain` | string | no | The Snowplow cookie domain. (e.g. `.gitlab.com`) |
| `snowplow_enabled` | boolean | no | Enable snowplow tracking. |
| `snowplow_site_id` | string | no | The Snowplow site name / application id. (e.g. `gitlab`) |
| `snowplow_app_id` | string | no | The Snowplow site name / application id. (e.g. `gitlab`) |
| `snowplow_iglu_registry_url` | string | no | The Snowplow base Iglu Schema Registry URL to use for custom context and self describing events'|
| `pendo_url` | string | required by: `pendo_enabled` | The Pendo endpoint url with js snippet. (e.g. `https://cdn.pendo.io/agent/static/your-api-key/pendo.js`) |
| `pendo_enabled` | boolean | no | Enable pendo tracking. |
......
......@@ -7,7 +7,7 @@ module EE
prepended do
EE_IGNORED_FK_COLUMNS = {
application_settings: %w[slack_app_id snowplow_site_id],
application_settings: %w[slack_app_id snowplow_app_id],
approvals: %w[user_id],
approver_groups: %w[target_id],
approvers: %w[target_id user_id],
......
......@@ -145,7 +145,7 @@ module API
given snowplow_enabled: ->(val) { val } do
requires :snowplow_collector_hostname, type: String, desc: 'The Snowplow collector hostname'
optional :snowplow_cookie_domain, type: String, desc: 'The Snowplow cookie domain'
optional :snowplow_site_id, type: String, desc: 'The Snowplow site name / application ic'
optional :snowplow_app_id, type: String, desc: 'The Snowplow site name / application id'
end
optional :pendo_enabled, type: Grape::API::Boolean, desc: 'Enable Pendo tracking'
given pendo_enabled: ->(val) { val } do
......
......@@ -45,7 +45,7 @@ module Gitlab
namespace: SNOWPLOW_NAMESPACE,
hostname: Gitlab::CurrentSettings.snowplow_collector_hostname,
cookie_domain: Gitlab::CurrentSettings.snowplow_cookie_domain,
app_id: Gitlab::CurrentSettings.snowplow_site_id,
app_id: Gitlab::CurrentSettings.snowplow_app_id,
form_tracking: additional_features,
link_click_tracking: additional_features,
iglu_registry_url: Gitlab::CurrentSettings.snowplow_iglu_registry_url
......@@ -59,7 +59,7 @@ module Gitlab
SnowplowTracker::AsyncEmitter.new(Gitlab::CurrentSettings.snowplow_collector_hostname, protocol: 'https'),
SnowplowTracker::Subject.new,
SNOWPLOW_NAMESPACE,
Gitlab::CurrentSettings.snowplow_site_id
Gitlab::CurrentSettings.snowplow_app_id
)
end
end
......
......@@ -13,7 +13,7 @@ describe 'Database schema' do
# EE: edit the ee/spec/db/schema_support.rb
IGNORED_FK_COLUMNS = {
abuse_reports: %w[reporter_id user_id],
application_settings: %w[performance_bar_allowed_group_id slack_app_id snowplow_site_id eks_account_id eks_access_key_id],
application_settings: %w[performance_bar_allowed_group_id slack_app_id snowplow_app_id eks_account_id eks_access_key_id],
approvers: %w[target_id user_id],
approvals: %w[user_id],
approver_groups: %w[target_id],
......
......@@ -38,7 +38,7 @@ describe ApplicationSettingsHelper do
it_behaves_like 'when HTTP protocol is in use', 'http'
context 'with tracking parameters' do
it { expect(visible_attributes).to include(*%i(snowplow_collector_hostname snowplow_cookie_domain snowplow_enabled snowplow_site_id)) }
it { expect(visible_attributes).to include(*%i(snowplow_collector_hostname snowplow_cookie_domain snowplow_enabled snowplow_app_id)) }
it { expect(visible_attributes).to include(*%i(pendo_enabled pendo_url)) }
end
......
......@@ -8,7 +8,7 @@ describe Gitlab::Tracking do
stub_application_setting(snowplow_enabled: true)
stub_application_setting(snowplow_collector_hostname: 'gitfoo.com')
stub_application_setting(snowplow_cookie_domain: '.gitfoo.com')
stub_application_setting(snowplow_site_id: '_abc123_')
stub_application_setting(snowplow_app_id: '_abc123_')
stub_application_setting(snowplow_iglu_registry_url: 'https://example.org')
end
......
......@@ -178,7 +178,7 @@ describe API::Settings, 'Settings' do
snowplow_collector_hostname: "snowplow.example.com",
snowplow_cookie_domain: ".example.com",
snowplow_enabled: true,
snowplow_site_id: "site_id",
snowplow_app_id: "app_id",
snowplow_iglu_registry_url: 'https://example.com'
}
end
......
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