Fill `size` values of `ci_job_artifacts` table from object storage

Description

From GitLab %11.3, we migrated legacy artifacts from ci_builds to ci_job_artfacts. Legacy artifact rows have values in size column, whereas legacy artifact metadata rows do not have the values, because it didn't exist in ci_builds. We should calculate the size and fill it into the legacy artifact metadata rows.

Solution

All artifact files on gitlab.com are stored in object storage, so we need to execute HEAD command to get the Content-length of the file. This is cheap that it doesn't actually pull the whole data.

Related

  • https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18615
  • https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17354
  • https://gitlab.com/gitlab-org/gitlab-ce/issues/43599#note_61122784
Edited Aug 24, 2018 by Shinya Maeda
Assignee Loading
Time tracking Loading