Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
6d89885501
commit
c6c658b674
|
@ -20,3 +20,5 @@ module DependencyProxy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
DependencyProxy::GroupAccess.prepend_mod_with('DependencyProxy::GroupAccess')
|
||||||
|
|
|
@ -65,7 +65,7 @@ Gitlab::Experiment.configure do |config|
|
||||||
# permitted, and will be sent along using Gitlab::Tracking::StandardContext.
|
# permitted, and will be sent along using Gitlab::Tracking::StandardContext.
|
||||||
#
|
#
|
||||||
config.tracking_behavior = lambda do |action, event_args|
|
config.tracking_behavior = lambda do |action, event_args|
|
||||||
Gitlab::Tracking.event(name, action.to_s, **event_args.merge(
|
Gitlab::Tracking.event(name, action, **event_args.merge(
|
||||||
context: (event_args[:context] || []) << SnowplowTracker::SelfDescribingJson.new(
|
context: (event_args[:context] || []) << SnowplowTracker::SelfDescribingJson.new(
|
||||||
'iglu:com.gitlab/gitlab_experiment/jsonschema/1-0-0', signature
|
'iglu:com.gitlab/gitlab_experiment/jsonschema/1-0-0', signature
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,6 +10,8 @@ module Gitlab
|
||||||
def event(category, action, label: nil, property: nil, value: nil, context: [], project: nil, user: nil, namespace: nil, **extra) # rubocop:disable Metrics/ParameterLists
|
def event(category, action, label: nil, property: nil, value: nil, context: [], project: nil, user: nil, namespace: nil, **extra) # rubocop:disable Metrics/ParameterLists
|
||||||
contexts = [Tracking::StandardContext.new(project: project, user: user, namespace: namespace, **extra).to_context, *context]
|
contexts = [Tracking::StandardContext.new(project: project, user: user, namespace: namespace, **extra).to_context, *context]
|
||||||
|
|
||||||
|
action = action.to_s
|
||||||
|
|
||||||
tracker.event(category, action, label: label, property: property, value: value, context: contexts)
|
tracker.event(category, action, label: label, property: property, value: value, context: contexts)
|
||||||
rescue StandardError => error
|
rescue StandardError => error
|
||||||
Gitlab::ErrorTracking.track_and_raise_for_dev_exception(error, snowplow_category: category, snowplow_action: action)
|
Gitlab::ErrorTracking.track_and_raise_for_dev_exception(error, snowplow_category: category, snowplow_action: action)
|
||||||
|
|
|
@ -51,8 +51,8 @@
|
||||||
"@babel/preset-env": "^7.18.2",
|
"@babel/preset-env": "^7.18.2",
|
||||||
"@gitlab/at.js": "1.5.7",
|
"@gitlab/at.js": "1.5.7",
|
||||||
"@gitlab/favicon-overlay": "2.0.0",
|
"@gitlab/favicon-overlay": "2.0.0",
|
||||||
"@gitlab/svgs": "3.1.0",
|
"@gitlab/svgs": "3.2.0",
|
||||||
"@gitlab/ui": "43.7.1",
|
"@gitlab/ui": "43.9.1",
|
||||||
"@gitlab/visual-review-tools": "1.7.3",
|
"@gitlab/visual-review-tools": "1.7.3",
|
||||||
"@gitlab/web-ide": "0.0.1-dev-20220815034418",
|
"@gitlab/web-ide": "0.0.1-dev-20220815034418",
|
||||||
"@rails/actioncable": "6.1.4-7",
|
"@rails/actioncable": "6.1.4-7",
|
||||||
|
|
|
@ -129,7 +129,7 @@ RSpec.describe ApplicationExperiment, :experiment do
|
||||||
|
|
||||||
expect_snowplow_event(
|
expect_snowplow_event(
|
||||||
category: 'namespaced/stub',
|
category: 'namespaced/stub',
|
||||||
action: 'action',
|
action: :action,
|
||||||
property: '_property_',
|
property: '_property_',
|
||||||
context: [
|
context: [
|
||||||
{
|
{
|
||||||
|
@ -162,7 +162,7 @@ RSpec.describe ApplicationExperiment, :experiment do
|
||||||
|
|
||||||
expect_snowplow_event(
|
expect_snowplow_event(
|
||||||
category: 'namespaced/stub',
|
category: 'namespaced/stub',
|
||||||
action: 'action',
|
action: :action,
|
||||||
user: user,
|
user: user,
|
||||||
project: project,
|
project: project,
|
||||||
namespace: namespace,
|
namespace: namespace,
|
||||||
|
@ -177,7 +177,7 @@ RSpec.describe ApplicationExperiment, :experiment do
|
||||||
|
|
||||||
expect_snowplow_event(
|
expect_snowplow_event(
|
||||||
category: 'namespaced/stub',
|
category: 'namespaced/stub',
|
||||||
action: 'action',
|
action: :action,
|
||||||
user: user,
|
user: user,
|
||||||
project: project,
|
project: project,
|
||||||
namespace: group,
|
namespace: group,
|
||||||
|
@ -193,7 +193,7 @@ RSpec.describe ApplicationExperiment, :experiment do
|
||||||
|
|
||||||
expect_snowplow_event(
|
expect_snowplow_event(
|
||||||
category: 'namespaced/stub',
|
category: 'namespaced/stub',
|
||||||
action: 'action',
|
action: :action,
|
||||||
user: actor,
|
user: actor,
|
||||||
project: project,
|
project: project,
|
||||||
namespace: namespace,
|
namespace: namespace,
|
||||||
|
@ -208,7 +208,7 @@ RSpec.describe ApplicationExperiment, :experiment do
|
||||||
|
|
||||||
expect_snowplow_event(
|
expect_snowplow_event(
|
||||||
category: 'namespaced/stub',
|
category: 'namespaced/stub',
|
||||||
action: 'action',
|
action: :action,
|
||||||
project: project,
|
project: project,
|
||||||
namespace: namespace,
|
namespace: namespace,
|
||||||
context: an_instance_of(Array)
|
context: an_instance_of(Array)
|
||||||
|
@ -297,7 +297,7 @@ RSpec.describe ApplicationExperiment, :experiment do
|
||||||
|
|
||||||
expect(Gitlab::Tracking).to have_received(:event).with( # rubocop:disable RSpec/ExpectGitlabTracking
|
expect(Gitlab::Tracking).to have_received(:event).with( # rubocop:disable RSpec/ExpectGitlabTracking
|
||||||
'top',
|
'top',
|
||||||
'nested',
|
:nested,
|
||||||
hash_including(label: 'nested')
|
hash_including(label: 'nested')
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -145,6 +145,26 @@ RSpec.describe Gitlab::Tracking do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when the action is not passed in as a string' do
|
||||||
|
it 'allows symbols' do
|
||||||
|
expect(Gitlab::ErrorTracking).not_to receive(:track_and_raise_for_dev_exception)
|
||||||
|
|
||||||
|
described_class.event('category', :some_action)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'allows nil' do
|
||||||
|
expect(Gitlab::ErrorTracking).not_to receive(:track_and_raise_for_dev_exception)
|
||||||
|
|
||||||
|
described_class.event('category', nil)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'allows integers' do
|
||||||
|
expect(Gitlab::ErrorTracking).not_to receive(:track_and_raise_for_dev_exception)
|
||||||
|
|
||||||
|
described_class.event('category', 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'when destination is Snowplow' do
|
context 'when destination is Snowplow' do
|
||||||
before do
|
before do
|
||||||
allow(Rails.env).to receive(:development?).and_return(true)
|
allow(Rails.env).to receive(:development?).and_return(true)
|
||||||
|
|
16
yarn.lock
16
yarn.lock
|
@ -1051,15 +1051,15 @@
|
||||||
stylelint-declaration-strict-value "1.8.0"
|
stylelint-declaration-strict-value "1.8.0"
|
||||||
stylelint-scss "4.2.0"
|
stylelint-scss "4.2.0"
|
||||||
|
|
||||||
"@gitlab/svgs@3.1.0":
|
"@gitlab/svgs@3.2.0":
|
||||||
version "3.1.0"
|
version "3.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.1.0.tgz#0108498a17e2f79d16158015db0be764b406cc09"
|
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.2.0.tgz#1ff40355642600e8807775f2b137c184e46380e9"
|
||||||
integrity sha512-kZ45VTQOgLdwQCLRSj7+aohF+6AUnAaoucR1CFY/6DPDLnNNGeflwsCLN0sFBKwx42HLxFfNwvDmKOMLdSQg5A==
|
integrity sha512-djAEmvB3AljQaVKwEoNWls8Q6oWwGvUVrmtBe3ykyPF/E50QVmiM2kXIko2BAEPzmIKhaH9YchowfYqJX3y2vg==
|
||||||
|
|
||||||
"@gitlab/ui@43.7.1":
|
"@gitlab/ui@43.9.1":
|
||||||
version "43.7.1"
|
version "43.9.1"
|
||||||
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-43.7.1.tgz#0550d08ed3312650eb08df9294f25022fe574c64"
|
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-43.9.1.tgz#8864687ebaffe3ff71b8d6087ce55e3e52e57a79"
|
||||||
integrity sha512-L7Rf+Y2YcsnYFVf95m+8Q2EHXYRh2mbxYCu5S94xoIVUYEBGtiZW7uRsjeEuXZjo1yD54K7e3x9BzBem1onrZw==
|
integrity sha512-1Rn4ZEOyQ0flDsAbxsFSnHNFqO0I2kuJjdkXfiEI21g0pdZ3LrdNwE0WcoRZWQd+nQQ0XbvzRaqmxN53rTY21g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@popperjs/core" "^2.11.2"
|
"@popperjs/core" "^2.11.2"
|
||||||
bootstrap-vue "2.20.1"
|
bootstrap-vue "2.20.1"
|
||||||
|
|
Loading…
Reference in New Issue