Commit 946eedbb authored by Kerri Miller's avatar Kerri Miller

Merge branch...

Merge branch '333713-allow-experiment-data-to-be-pushed-to-the-client-without-running-the-experiment' into 'master'

Allow experiment data to be pushed to the client without running the XP

See merge request gitlab-org/gitlab!64118
parents 280731e1 9e65911f
......@@ -16,12 +16,15 @@ class ApplicationExperiment < Gitlab::Experiment # rubocop:disable Gitlab/Namesp
track(:assignment) # track that we've assigned a variant for this context
begin
Gon.push({ experiment: { name => signature } }, true) # push the experiment data to the client
push_to_client
end
# push the experiment data to the client
def push_to_client
Gon.push({ experiment: { name => signature } }, true)
rescue NoMethodError
# means we're not in the request cycle, and can't add to Gon. Log a warning maybe?
end
end
def track(action, **event_args)
return unless should_track? # don't track events for excluded contexts
......
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