Commit e1eb198b authored by Andreas Brandl's avatar Andreas Brandl

Merge branch '31222-follow-up-from-adjusts-snowplow-to-use-cookies-for-sessions' into 'master'

Resolve "Follow-up from "Adjusts snowplow to use cookies for sessions""

Closes #31222

See merge request gitlab-org/gitlab!19252
parents 123bcddf 7533169b
...@@ -293,7 +293,7 @@ module ApplicationSettingsHelper ...@@ -293,7 +293,7 @@ module ApplicationSettingsHelper
:snowplow_collector_hostname, :snowplow_collector_hostname,
:snowplow_cookie_domain, :snowplow_cookie_domain,
:snowplow_enabled, :snowplow_enabled,
:snowplow_site_id, :snowplow_app_id,
:snowplow_iglu_registry_url, :snowplow_iglu_registry_url,
:push_event_hooks_limit, :push_event_hooks_limit,
:push_event_activities_limit, :push_event_activities_limit,
......
...@@ -132,7 +132,7 @@ module ApplicationSettingImplementation ...@@ -132,7 +132,7 @@ module ApplicationSettingImplementation
snowplow_collector_hostname: nil, snowplow_collector_hostname: nil,
snowplow_cookie_domain: nil, snowplow_cookie_domain: nil,
snowplow_enabled: false, snowplow_enabled: false,
snowplow_site_id: nil, snowplow_app_id: nil,
snowplow_iglu_registry_url: nil, snowplow_iglu_registry_url: nil,
custom_http_clone_url_root: nil, custom_http_clone_url_root: nil,
pendo_enabled: false, pendo_enabled: false,
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
= f.label :snowplow_collector_hostname, _('Collector hostname'), class: 'label-light' = f.label :snowplow_collector_hostname, _('Collector hostname'), class: 'label-light'
= f.text_field :snowplow_collector_hostname, class: 'form-control', placeholder: 'snowplow.example.com' = f.text_field :snowplow_collector_hostname, class: 'form-control', placeholder: 'snowplow.example.com'
.form-group .form-group
= f.label :snowplow_site_id, _('Site ID'), class: 'label-light' = f.label :snowplow_app_id, _('App ID'), class: 'label-light'
= f.text_field :snowplow_site_id, class: 'form-control' = f.text_field :snowplow_app_id, class: 'form-control'
.form-group .form-group
= f.label :snowplow_cookie_domain, _('Cookie domain'), class: 'label-light' = f.label :snowplow_cookie_domain, _('Cookie domain'), class: 'label-light'
= f.text_field :snowplow_cookie_domain, class: 'form-control' = f.text_field :snowplow_cookie_domain, class: 'form-control'
......
---
title: Rename snowplow_site_id to snowplow_app_id in application_settings table
merge_request: 19252
author:
type: other
# frozen_string_literal: true
class RenameSnowplowSiteIdToSnowplowAppId < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
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
DOWNTIME = false
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 ...@@ -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 "hide_third_party_offers", default: false, null: false
t.boolean "snowplow_enabled", default: false, null: false t.boolean "snowplow_enabled", default: false, null: false
t.string "snowplow_collector_hostname" t.string "snowplow_collector_hostname"
t.string "snowplow_site_id"
t.string "snowplow_cookie_domain" t.string "snowplow_cookie_domain"
t.boolean "instance_statistics_visibility_private", default: false, null: false t.boolean "instance_statistics_visibility_private", default: false, null: false
t.boolean "web_ide_clientside_preview_enabled", 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 ...@@ -350,6 +349,7 @@ ActiveRecord::Schema.define(version: 2019_11_05_094625) do
t.string "eks_access_key_id", limit: 128 t.string "eks_access_key_id", limit: 128
t.string "encrypted_eks_secret_access_key_iv", limit: 255 t.string "encrypted_eks_secret_access_key_iv", limit: 255
t.text "encrypted_eks_secret_access_key" 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 ["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 ["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" 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. ...@@ -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_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_cookie_domain` | string | no | The Snowplow cookie domain. (e.g. `.gitlab.com`) |
| `snowplow_enabled` | boolean | no | Enable snowplow tracking. | | `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'| | `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_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. | | `pendo_enabled` | boolean | no | Enable pendo tracking. |
......
...@@ -7,7 +7,7 @@ module EE ...@@ -7,7 +7,7 @@ module EE
prepended do prepended do
EE_IGNORED_FK_COLUMNS = { 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], approvals: %w[user_id],
approver_groups: %w[target_id], approver_groups: %w[target_id],
approvers: %w[target_id user_id], approvers: %w[target_id user_id],
......
...@@ -145,7 +145,7 @@ module API ...@@ -145,7 +145,7 @@ module API
given snowplow_enabled: ->(val) { val } do given snowplow_enabled: ->(val) { val } do
requires :snowplow_collector_hostname, type: String, desc: 'The Snowplow collector hostname' requires :snowplow_collector_hostname, type: String, desc: 'The Snowplow collector hostname'
optional :snowplow_cookie_domain, type: String, desc: 'The Snowplow cookie domain' 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 end
optional :pendo_enabled, type: Grape::API::Boolean, desc: 'Enable Pendo tracking' optional :pendo_enabled, type: Grape::API::Boolean, desc: 'Enable Pendo tracking'
given pendo_enabled: ->(val) { val } do given pendo_enabled: ->(val) { val } do
......
...@@ -45,7 +45,7 @@ module Gitlab ...@@ -45,7 +45,7 @@ module Gitlab
namespace: SNOWPLOW_NAMESPACE, namespace: SNOWPLOW_NAMESPACE,
hostname: Gitlab::CurrentSettings.snowplow_collector_hostname, hostname: Gitlab::CurrentSettings.snowplow_collector_hostname,
cookie_domain: Gitlab::CurrentSettings.snowplow_cookie_domain, 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, form_tracking: additional_features,
link_click_tracking: additional_features, link_click_tracking: additional_features,
iglu_registry_url: Gitlab::CurrentSettings.snowplow_iglu_registry_url iglu_registry_url: Gitlab::CurrentSettings.snowplow_iglu_registry_url
...@@ -59,7 +59,7 @@ module Gitlab ...@@ -59,7 +59,7 @@ module Gitlab
SnowplowTracker::AsyncEmitter.new(Gitlab::CurrentSettings.snowplow_collector_hostname, protocol: 'https'), SnowplowTracker::AsyncEmitter.new(Gitlab::CurrentSettings.snowplow_collector_hostname, protocol: 'https'),
SnowplowTracker::Subject.new, SnowplowTracker::Subject.new,
SNOWPLOW_NAMESPACE, SNOWPLOW_NAMESPACE,
Gitlab::CurrentSettings.snowplow_site_id Gitlab::CurrentSettings.snowplow_app_id
) )
end end
end end
......
...@@ -1798,6 +1798,9 @@ msgstr "" ...@@ -1798,6 +1798,9 @@ msgstr ""
msgid "Any user" msgid "Any user"
msgstr "" msgstr ""
msgid "App ID"
msgstr ""
msgid "Appearance" msgid "Appearance"
msgstr "" msgstr ""
...@@ -15599,9 +15602,6 @@ msgstr "" ...@@ -15599,9 +15602,6 @@ msgstr ""
msgid "Single or combined queries" msgid "Single or combined queries"
msgstr "" msgstr ""
msgid "Site ID"
msgstr ""
msgid "Size" msgid "Size"
msgstr "" msgstr ""
......
...@@ -13,7 +13,7 @@ describe 'Database schema' do ...@@ -13,7 +13,7 @@ describe 'Database schema' do
# EE: edit the ee/spec/db/schema_support.rb # EE: edit the ee/spec/db/schema_support.rb
IGNORED_FK_COLUMNS = { IGNORED_FK_COLUMNS = {
abuse_reports: %w[reporter_id user_id], 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], approvers: %w[target_id user_id],
approvals: %w[user_id], approvals: %w[user_id],
approver_groups: %w[target_id], approver_groups: %w[target_id],
......
...@@ -38,7 +38,7 @@ describe ApplicationSettingsHelper do ...@@ -38,7 +38,7 @@ describe ApplicationSettingsHelper do
it_behaves_like 'when HTTP protocol is in use', 'http' it_behaves_like 'when HTTP protocol is in use', 'http'
context 'with tracking parameters' do 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)) } it { expect(visible_attributes).to include(*%i(pendo_enabled pendo_url)) }
end end
......
...@@ -8,7 +8,7 @@ describe Gitlab::Tracking do ...@@ -8,7 +8,7 @@ describe Gitlab::Tracking do
stub_application_setting(snowplow_enabled: true) stub_application_setting(snowplow_enabled: true)
stub_application_setting(snowplow_collector_hostname: 'gitfoo.com') stub_application_setting(snowplow_collector_hostname: 'gitfoo.com')
stub_application_setting(snowplow_cookie_domain: '.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') stub_application_setting(snowplow_iglu_registry_url: 'https://example.org')
end end
......
...@@ -178,7 +178,7 @@ describe API::Settings, 'Settings' do ...@@ -178,7 +178,7 @@ describe API::Settings, 'Settings' do
snowplow_collector_hostname: "snowplow.example.com", snowplow_collector_hostname: "snowplow.example.com",
snowplow_cookie_domain: ".example.com", snowplow_cookie_domain: ".example.com",
snowplow_enabled: true, snowplow_enabled: true,
snowplow_site_id: "site_id", snowplow_app_id: "app_id",
snowplow_iglu_registry_url: 'https://example.com' snowplow_iglu_registry_url: 'https://example.com'
} }
end 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