Loading lib/labkit/covered_experience/experience.rb +2 −7 Original line number Diff line number Diff line Loading @@ -160,17 +160,12 @@ module Labkit def build_log_data(event_type, **extra) extra ||= {} log_data = { log_data = extra.merge( checkpoint: event_type, covered_experience: @definition.covered_experience, feature_category: @definition.feature_category, urgency: @definition.urgency } context_data = Labkit::Context.current.to_h.select do |k, _| k == "correlation_id" || k.start_with?("meta") end log_data = extra.merge(context_data).merge(log_data) ) if has_error? log_data[:error] = true Loading lib/labkit/rspec/matchers/covered_experience_matchers.rb +2 −12 Original line number Diff line number Diff line Loading @@ -42,18 +42,8 @@ module Labkit def allow_logger_call(covered_experience_id, checkpoint_type, extra = {}) return unless logger labels = attributes(covered_experience_id) context_data = Labkit::Context.current.to_h.select do |k, _| k == "correlation_id" || k.start_with?("meta") end expected_log_data = extra.merge(context_data).merge( checkpoint: checkpoint_type, covered_experience: covered_experience_id.to_s, feature_category: labels[:feature_category], urgency: labels[:urgency] ) attrs = attributes(covered_experience_id) expected_log_data = { **extra, **attrs, checkpoint: checkpoint_type } allow(logger).to receive(:info).with(hash_including(expected_log_data)).and_call_original # rubocop:disable CodeReuse/ActiveRecord -- false positive end Loading Loading
lib/labkit/covered_experience/experience.rb +2 −7 Original line number Diff line number Diff line Loading @@ -160,17 +160,12 @@ module Labkit def build_log_data(event_type, **extra) extra ||= {} log_data = { log_data = extra.merge( checkpoint: event_type, covered_experience: @definition.covered_experience, feature_category: @definition.feature_category, urgency: @definition.urgency } context_data = Labkit::Context.current.to_h.select do |k, _| k == "correlation_id" || k.start_with?("meta") end log_data = extra.merge(context_data).merge(log_data) ) if has_error? log_data[:error] = true Loading
lib/labkit/rspec/matchers/covered_experience_matchers.rb +2 −12 Original line number Diff line number Diff line Loading @@ -42,18 +42,8 @@ module Labkit def allow_logger_call(covered_experience_id, checkpoint_type, extra = {}) return unless logger labels = attributes(covered_experience_id) context_data = Labkit::Context.current.to_h.select do |k, _| k == "correlation_id" || k.start_with?("meta") end expected_log_data = extra.merge(context_data).merge( checkpoint: checkpoint_type, covered_experience: covered_experience_id.to_s, feature_category: labels[:feature_category], urgency: labels[:urgency] ) attrs = attributes(covered_experience_id) expected_log_data = { **extra, **attrs, checkpoint: checkpoint_type } allow(logger).to receive(:info).with(hash_including(expected_log_data)).and_call_original # rubocop:disable CodeReuse/ActiveRecord -- false positive end Loading