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
|
||||
|
||||
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.
|
||||
#
|
||||
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(
|
||||
'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
|
||||
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)
|
||||
rescue StandardError => error
|
||||
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",
|
||||
"@gitlab/at.js": "1.5.7",
|
||||
"@gitlab/favicon-overlay": "2.0.0",
|
||||
"@gitlab/svgs": "3.1.0",
|
||||
"@gitlab/ui": "43.7.1",
|
||||
"@gitlab/svgs": "3.2.0",
|
||||
"@gitlab/ui": "43.9.1",
|
||||
"@gitlab/visual-review-tools": "1.7.3",
|
||||
"@gitlab/web-ide": "0.0.1-dev-20220815034418",
|
||||
"@rails/actioncable": "6.1.4-7",
|
||||
|
|
|
@ -129,7 +129,7 @@ RSpec.describe ApplicationExperiment, :experiment do
|
|||
|
||||
expect_snowplow_event(
|
||||
category: 'namespaced/stub',
|
||||
action: 'action',
|
||||
action: :action,
|
||||
property: '_property_',
|
||||
context: [
|
||||
{
|
||||
|
@ -162,7 +162,7 @@ RSpec.describe ApplicationExperiment, :experiment do
|
|||
|
||||
expect_snowplow_event(
|
||||
category: 'namespaced/stub',
|
||||
action: 'action',
|
||||
action: :action,
|
||||
user: user,
|
||||
project: project,
|
||||
namespace: namespace,
|
||||
|
@ -177,7 +177,7 @@ RSpec.describe ApplicationExperiment, :experiment do
|
|||
|
||||
expect_snowplow_event(
|
||||
category: 'namespaced/stub',
|
||||
action: 'action',
|
||||
action: :action,
|
||||
user: user,
|
||||
project: project,
|
||||
namespace: group,
|
||||
|
@ -193,7 +193,7 @@ RSpec.describe ApplicationExperiment, :experiment do
|
|||
|
||||
expect_snowplow_event(
|
||||
category: 'namespaced/stub',
|
||||
action: 'action',
|
||||
action: :action,
|
||||
user: actor,
|
||||
project: project,
|
||||
namespace: namespace,
|
||||
|
@ -208,7 +208,7 @@ RSpec.describe ApplicationExperiment, :experiment do
|
|||
|
||||
expect_snowplow_event(
|
||||
category: 'namespaced/stub',
|
||||
action: 'action',
|
||||
action: :action,
|
||||
project: project,
|
||||
namespace: namespace,
|
||||
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
|
||||
'top',
|
||||
'nested',
|
||||
:nested,
|
||||
hash_including(label: 'nested')
|
||||
)
|
||||
end
|
||||
|
|
|
@ -145,6 +145,26 @@ RSpec.describe Gitlab::Tracking do
|
|||
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
|
||||
before do
|
||||
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-scss "4.2.0"
|
||||
|
||||
"@gitlab/svgs@3.1.0":
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.1.0.tgz#0108498a17e2f79d16158015db0be764b406cc09"
|
||||
integrity sha512-kZ45VTQOgLdwQCLRSj7+aohF+6AUnAaoucR1CFY/6DPDLnNNGeflwsCLN0sFBKwx42HLxFfNwvDmKOMLdSQg5A==
|
||||
"@gitlab/svgs@3.2.0":
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.2.0.tgz#1ff40355642600e8807775f2b137c184e46380e9"
|
||||
integrity sha512-djAEmvB3AljQaVKwEoNWls8Q6oWwGvUVrmtBe3ykyPF/E50QVmiM2kXIko2BAEPzmIKhaH9YchowfYqJX3y2vg==
|
||||
|
||||
"@gitlab/ui@43.7.1":
|
||||
version "43.7.1"
|
||||
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-43.7.1.tgz#0550d08ed3312650eb08df9294f25022fe574c64"
|
||||
integrity sha512-L7Rf+Y2YcsnYFVf95m+8Q2EHXYRh2mbxYCu5S94xoIVUYEBGtiZW7uRsjeEuXZjo1yD54K7e3x9BzBem1onrZw==
|
||||
"@gitlab/ui@43.9.1":
|
||||
version "43.9.1"
|
||||
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-43.9.1.tgz#8864687ebaffe3ff71b8d6087ce55e3e52e57a79"
|
||||
integrity sha512-1Rn4ZEOyQ0flDsAbxsFSnHNFqO0I2kuJjdkXfiEI21g0pdZ3LrdNwE0WcoRZWQd+nQQ0XbvzRaqmxN53rTY21g==
|
||||
dependencies:
|
||||
"@popperjs/core" "^2.11.2"
|
||||
bootstrap-vue "2.20.1"
|
||||
|
|
Loading…
Reference in New Issue