From dc7de5ed4cc655b168555aca75bbd028f03074d7 Mon Sep 17 00:00:00 2001 From: Patrick Bajao Date: Fri, 13 Dec 2024 17:34:09 +0800 Subject: [PATCH] Increase ci_max_artifact_size_lsif default limit In order to support bigger LSIF artifacts, we are increasing the default limit of LSIF artifacts. This is currently increased on production in code behind the `increase_lsif_artifacts_limit` feature flag which will be removed after these migration run. That is needed to be done so GitLab.com won't revert to lower limits until we run these migrations. Changelog: changed --- app/models/plan_limits.rb | 4 ++++ ...fact_size_lsif_of_plan_limits_from100_to200.rb | 9 +++++++++ ...fact_size_lsif_of_plan_limits_from100_to200.rb | 15 +++++++++++++++ db/schema_migrations/20241213092101 | 1 + db/schema_migrations/20241213092247 | 1 + db/structure.sql | 2 +- doc/administration/instance_limits.md | 5 +++-- doc/user/project/code_intelligence.md | 2 +- 8 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 db/post_migrate/20241213092101_change_default_value_of_ci_max_artifact_size_lsif_of_plan_limits_from100_to200.rb create mode 100644 db/post_migrate/20241213092247_update_ci_max_artifact_size_lsif_of_plan_limits_from100_to200.rb create mode 100644 db/schema_migrations/20241213092101 create mode 100644 db/schema_migrations/20241213092247 diff --git a/app/models/plan_limits.rb b/app/models/plan_limits.rb index be1be6ae91bc8f..dd3eadc5937b1f 100644 --- a/app/models/plan_limits.rb +++ b/app/models/plan_limits.rb @@ -1,6 +1,10 @@ # frozen_string_literal: true class PlanLimits < ApplicationRecord + include SafelyChangeColumnDefault + + columns_changing_default :ci_max_artifact_size_lsif + ALLOWED_LIMITS_HISTORY_ATTRIBUTES = %i[notification_limit enforcement_limit storage_size_limit dashboard_limit_enabled_at].freeze diff --git a/db/post_migrate/20241213092101_change_default_value_of_ci_max_artifact_size_lsif_of_plan_limits_from100_to200.rb b/db/post_migrate/20241213092101_change_default_value_of_ci_max_artifact_size_lsif_of_plan_limits_from100_to200.rb new file mode 100644 index 00000000000000..e030eb4deead4c --- /dev/null +++ b/db/post_migrate/20241213092101_change_default_value_of_ci_max_artifact_size_lsif_of_plan_limits_from100_to200.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class ChangeDefaultValueOfCiMaxArtifactSizeLsifOfPlanLimitsFrom100To200 < Gitlab::Database::Migration[2.2] + milestone '17.8' + + def change + change_column_default('plan_limits', 'ci_max_artifact_size_lsif', from: 100, to: 200) + end +end diff --git a/db/post_migrate/20241213092247_update_ci_max_artifact_size_lsif_of_plan_limits_from100_to200.rb b/db/post_migrate/20241213092247_update_ci_max_artifact_size_lsif_of_plan_limits_from100_to200.rb new file mode 100644 index 00000000000000..854ce17f7c7511 --- /dev/null +++ b/db/post_migrate/20241213092247_update_ci_max_artifact_size_lsif_of_plan_limits_from100_to200.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class UpdateCiMaxArtifactSizeLsifOfPlanLimitsFrom100To200 < Gitlab::Database::Migration[2.2] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + milestone '17.8' + + def up + execute('UPDATE plan_limits SET ci_max_artifact_size_lsif = 200 WHERE ci_max_artifact_size_lsif = 100') + end + + def down + execute('UPDATE plan_limits SET ci_max_artifact_size_lsif = 100 WHERE ci_max_artifact_size_lsif = 200') + end +end diff --git a/db/schema_migrations/20241213092101 b/db/schema_migrations/20241213092101 new file mode 100644 index 00000000000000..e1ee1e77143e78 --- /dev/null +++ b/db/schema_migrations/20241213092101 @@ -0,0 +1 @@ +039baa4cf8eb44a20ff9edaf0fc9df25697c883dfc8b9fd7f743f9cef98fbe1b \ No newline at end of file diff --git a/db/schema_migrations/20241213092247 b/db/schema_migrations/20241213092247 new file mode 100644 index 00000000000000..374046eee078b8 --- /dev/null +++ b/db/schema_migrations/20241213092247 @@ -0,0 +1 @@ +d3ed2d122f555f4be3309dfd9945241f640c0b543a8ffe6153915af5e8bd79b7 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 028c0fbe69dec8..fbe06f43751beb 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -17247,7 +17247,7 @@ CREATE TABLE plan_limits ( offset_pagination_limit integer DEFAULT 50000 NOT NULL, ci_instance_level_variables integer DEFAULT 25 NOT NULL, storage_size_limit integer DEFAULT 0 NOT NULL, - ci_max_artifact_size_lsif integer DEFAULT 100 NOT NULL, + ci_max_artifact_size_lsif integer DEFAULT 200 NOT NULL, ci_max_artifact_size_archive integer DEFAULT 0 NOT NULL, ci_max_artifact_size_metadata integer DEFAULT 0 NOT NULL, ci_max_artifact_size_trace integer DEFAULT 0 NOT NULL, diff --git a/doc/administration/instance_limits.md b/doc/administration/instance_limits.md index 11b4e2e36f5163..0f404643b36398 100644 --- a/doc/administration/instance_limits.md +++ b/doc/administration/instance_limits.md @@ -612,6 +612,7 @@ To update the `default` plan of one of these limits on a self-managed installati ### Maximum file size per type of artifact > - `ci_max_artifact_size_annotations` limit [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/38337) in GitLab 16.3. +> - `ci_max_artifact_size_lsif` limit [increased](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/175684) in GitLab 17.8. Job artifacts defined with [`artifacts:reports`](../ci/yaml/index.md#artifactsreports) that are uploaded by the runner are rejected if the file size exceeds the maximum @@ -644,7 +645,7 @@ setting is used: | `ci_max_artifact_size_license_management` | 0 | | `ci_max_artifact_size_license_scanning` | 0 | | `ci_max_artifact_size_load_performance` | 0 | -| `ci_max_artifact_size_lsif` | 100 MB | +| `ci_max_artifact_size_lsif` | 200 MB | | `ci_max_artifact_size_metadata` | 0 | | `ci_max_artifact_size_metrics_referee` | 0 | | `ci_max_artifact_size_metrics` | 0 | @@ -1193,7 +1194,7 @@ ci_pipeline_schedules: 10, offset_pagination_limit: 50000, ci_instance_level_variables: "[FILTERED]", storage_size_limit: 0, -ci_max_artifact_size_lsif: 100, +ci_max_artifact_size_lsif: 200, ci_max_artifact_size_archive: 0, ci_max_artifact_size_metadata: 0, ci_max_artifact_size_trace: "[FILTERED]", diff --git a/doc/user/project/code_intelligence.md b/doc/user/project/code_intelligence.md index 7d28015e7499c9..fb7c9cfb7bfc49 100644 --- a/doc/user/project/code_intelligence.md +++ b/doc/user/project/code_intelligence.md @@ -135,7 +135,7 @@ SCIP index and converts it to LSIF for use in GitLab: ::EndTabs NOTE: -GitLab limits the artifact produced by the code generation jobs to 100 MB by the +GitLab limits the artifact produced by the code generation jobs to 200 MB by the [(`ci_max_artifact_size_lsif`)](../../administration/instance_limits.md#maximum-file-size-per-type-of-artifact) artifact application limit. On self-managed installations, an instance administrator can change this value. -- GitLab