Skip to content

Populate timelogs.project_id

Lee Tickett requested to merge populate-timelogs.project_id into master

What does this MR do?

In order to complete !57322 (merged) we need to improve performance by adding project_id to timelogs directly (instead of having to navigate via issues / merge_requests).

In !60040 (merged) we added the column and configured it to populate for all new timelogs.

This merge request populates all historic entries.

We should follow this up with a final merge request to make the column non-nullable.

!57322 (comment 558205523)

@sabrams has confirmed the merge request update should take around 4 minutes, so it is acceptable to run as a post-migration

Unfortunately, the issue update will likely take 20 minutes, so we need to run it as a background migration

Screenshots (strongly suggested)

lee@cc-gdk-2:~/gitlab-development-kit/gitlab$ bundle exec rake db:migrate:down VERSION=20210427212034 RAILS_ENV=development
== 20210427212034 ScheduleUpdateTimelogsProjectId: reverting ==================
== 20210427212034 ScheduleUpdateTimelogsProjectId: reverted (0.0000s) =========

lee@cc-gdk-2:~/gitlab-development-kit/gitlab$ bundle exec rake db:migrate:up VERSION=20210427212034 RAILS_ENV=development
== 20210427212034 ScheduleUpdateTimelogsProjectId: migrating ==================
-- Scheduled 1 UpdateTimelogsProjectId jobs with a maximum of 50000 records per batch and an interval of 120 seconds.

The migration is expected to take at least 120 seconds. Expect all jobs to have completed after 2021-04-29 08:23:08 UTC."
== 20210427212034 ScheduleUpdateTimelogsProjectId: migrated (0.0220s) =========

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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
Edited by Mayra Cabrera

Merge request reports