Skip to content

Add pipeline_artifacts_size to ProjectStatistics

Ref: #234032 (closed)

This feature is behind a feature flag (coverage_report_view). The full feature has been developed on this POC branch.

What does this MR do?

This MR adds a new column (pipeline_artifact_size) to ProjectStatistics.

Why are we doing this?

You can visualize how much data is being stored on with your gitlab instance by visiting this page.

Following up !37969 (merged) where we introduced the concept of PipelineArtifact. This new model is being used to persist additional artifacts after a pipeline completes.

We need to inform users how much data is being stored on their disk. This is similar to what we already do with our BuildArtifact.

We will follow up and update this new column once a PipelineArtifact has been created in a different MR.

Why are we creating a new column for this?

PipelineArtifact is generated internally by gitlab. As mentioned by @fabiopitino in this thread we don't know yet if we will count this resource as a billable artifacts.

By creating a new column, we still have the choice to decide what we want to do in the future.

Migration output

$ bin/rails db:migrate
== 20200817142800 AddPipelineArtifactsSizeToProjectStatistics: migrating ======
-- add_column(:project_statistics, :pipeline_artifacts_size, :bigint, {:default=>0, :null=>false})
   -> 0.0049s
== 20200817142800 AddPipelineArtifactsSizeToProjectStatistics: migrated (0.0114s)

Migration Rollback

$ bin/rails db:rollback
== 20200817142800 AddPipelineArtifactsSizeToProjectStatistics: reverting ======
-- remove_column(:project_statistics, :pipeline_artifacts_size, :bigint, {:default=>0, :null=>false})
   -> 0.0010s
== 20200817142800 AddPipelineArtifactsSizeToProjectStatistics: reverted (0.0069s)

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 Max Orefice

Merge request reports

Loading