Eliminate duplicated VSA event
What does this MR do?
This MR fixes a small inconsistency in Value Stream Stage event values in the codebase. The change is not visible to the end user.
The Issue first mentioned in commit
event presents in both FOSS and EE with different identifier (number)
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/analytics/cycle_analytics/stage_events.rb#L13
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/ee/gitlab/analytics/cycle_analytics/stage_events.rb#L18
This caused a bug where duplicated events showed up in the dropdown (fixed): !29030 (merged)
The fix was simply calling uniq
on the events, however it didn't fix the underlying problem.
This MR:
- Remove the event definition from EE (unlikely that it was ever used due to the
uniq
call) - Just to be safe, create a data migration where existing records are fixed.
Migration
up
== 20210119122354 AlterVsaIssueFirstMentionedInCommitValue: migrating =========
== 20210119122354 AlterVsaIssueFirstMentionedInCommitValue: migrated (0.0096s)
down
NOOP
Update query
Simple EachBatch
on the primary key. Updating 100 rows at once (0 affected records on PRD).
UPDATE "analytics_cycle_analytics_group_stages" SET "start_event_identifier" = 2 WHERE "analytics_cycle_analytics_group_stages"."id" >= 394 AND "analytics_cycle_analytics_group_stages"."id" < 540 AND "analytics_cycle_analytics_group_stages"."start_event_identifier" = 6
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Related to #214631 (closed)
Edited by Mayra Cabrera