Problematic legacy trace migrations
Problem
In GitLab %11.0, we shipped legacy trace migration as one of the post-migrations.
After a few months, we realized that this migration has two problems.
-
ScheduleToArchiveLegacyTraces
cannot be cleaned up -
BackgroundMigration::ArchiveLegacyTraces
uses application code directly (Usually migrations code has to be isolated from application side). This means we can't changeGitlab::Ci::Trace#archive!
code andCi::JobArtifact
model. However, in order to implement other features, often we have to extendCi::JobArtifact
. This situation forced us to use a workaround, as described below, and pile up nasty ~"technical debt"s.
Acknowledged technical debt so far
-
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/ci/trace.rb#L168 (Can't set
file_format
) -
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18615#note_96982071 (Can't set
file_location
) -
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21510 (
file_location
doesn't exist so it requires addition conditions)
Proposal
Make the background migrations no-op, and re-work the migrations again.
Edited by Shinya Maeda