Commit d17e2ab4 authored by Etienne Baqué's avatar Etienne Baqué

Merge branch '299310-remove-vsa-backward-compatibility' into 'master'

Remove backward compatible VSA code

See merge request gitlab-org/gitlab!55190
parents d95c2101 49dac441
......@@ -49,14 +49,6 @@ module Analytics
end
end
def start_event_identifier
backward_compatible_identifier(:start_event_identifier) || super
end
def end_event_identifier
backward_compatible_identifier(:end_event_identifier) || super
end
def start_event_label_based?
start_event_identifier && start_event.label_based?
end
......@@ -136,17 +128,6 @@ module Analytics
.id_in(label_id)
.exists?
end
# Temporary, will be removed in 13.10
def backward_compatible_identifier(attribute_name)
removed_identifier = 6 # References IssueFirstMentionedInCommit removed on https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51975
replacement_identifier = :issue_first_mentioned_in_commit
# ActiveRecord returns nil if the column value is not part of the Enum definition
if self[attribute_name].nil? && read_attribute_before_type_cast(attribute_name) == removed_identifier
replacement_identifier
end
end
end
end
end
......@@ -33,38 +33,4 @@ RSpec.describe Analytics::CycleAnalytics::GroupStage do
let(:default_params) { { group: parent } }
end
end
context 'when the event identifier is using the old, recently deduplicated identifier' do
let(:group) { create(:group) }
let(:value_stream) { create(:cycle_analytics_group_value_stream, group: group) }
let(:invalid_identifier) { 6 }
let(:stage_params) do
{
name: 'My Stage',
parent: group,
start_event_identifier: :merge_request_created,
end_event_identifier: :merge_request_merged,
value_stream: value_stream
}
end
let(:stage) { described_class.create!(stage_params) }
before do
# update the columns directly so validations are skipped
stage.update_column(:start_event_identifier, invalid_identifier)
stage.update_column(:end_event_identifier, invalid_identifier)
end
subject { described_class.find(stage.id) }
it 'loads the correct start event' do
expect(subject.start_event).to be_a_kind_of(Gitlab::Analytics::CycleAnalytics::StageEvents::IssueFirstMentionedInCommit)
end
it 'loads the correct end event' do
expect(subject.end_event).to be_a_kind_of(Gitlab::Analytics::CycleAnalytics::StageEvents::IssueFirstMentionedInCommit)
end
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