Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
cc28a4b4a7
commit
746091b38e
|
|
@ -52,8 +52,8 @@ rules:
|
|||
- '^variables$'
|
||||
- 'attrs?$'
|
||||
'@gitlab/vue-no-undef-apollo-properties': error
|
||||
'@gitlab/tailwind': error
|
||||
'@gitlab/vue-tailwind': error
|
||||
'@gitlab/tailwind-no-interpolation': error
|
||||
'@gitlab/vue-tailwind-no-interpolation': error
|
||||
no-param-reassign:
|
||||
- error
|
||||
- props: true
|
||||
|
|
@ -191,8 +191,8 @@ overrides:
|
|||
rules:
|
||||
'@gitlab/require-i18n-strings': off
|
||||
'@gitlab/no-runtime-template-compiler': off
|
||||
'@gitlab/tailwind': off
|
||||
'@gitlab/vue-tailwind': off
|
||||
'@gitlab/tailwind-no-interpolation': off
|
||||
'@gitlab/vue-tailwind-no-interpolation': off
|
||||
'require-await': error
|
||||
'import/no-dynamic-require': off
|
||||
'no-import-assign': off
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ db:rollback:
|
|||
- .db-job-base
|
||||
- .rails:rules:db-rollback
|
||||
script:
|
||||
- bundle exec rake db:migrate VERSION=20230728020644 # 16.4 First migration
|
||||
- bundle exec rake db:migrate VERSION=20230721095222 # First 16-4-stable-ee migration
|
||||
- bundle exec rake db:migrate
|
||||
|
||||
db:rollback single-db:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,188 @@
|
|||
---
|
||||
# Cop supports --autocorrect.
|
||||
Gitlab/DocumentationLinks/Link:
|
||||
Details: grace period
|
||||
Exclude:
|
||||
- '**/*.haml' # Excluding HAML files so as to not conflict with the DocumentationLinks HAML linter
|
||||
- 'app/controllers/concerns/enforces_two_factor_authentication.rb'
|
||||
- 'app/controllers/import/github_controller.rb'
|
||||
- 'app/controllers/jira_connect/app_descriptor_controller.rb'
|
||||
- 'app/controllers/jwt_controller.rb'
|
||||
- 'app/controllers/metrics_controller.rb'
|
||||
- 'app/controllers/repositories/git_http_client_controller.rb'
|
||||
- 'app/helpers/ci/jobs_helper.rb'
|
||||
- 'app/helpers/ci/pipeline_editor_helper.rb'
|
||||
- 'app/helpers/clusters_helper.rb'
|
||||
- 'app/helpers/container_registry/container_registry_helper.rb'
|
||||
- 'app/helpers/environments_helper.rb'
|
||||
- 'app/helpers/feature_flags_helper.rb'
|
||||
- 'app/helpers/ide_helper.rb'
|
||||
- 'app/helpers/import_helper.rb'
|
||||
- 'app/helpers/integrations_helper.rb'
|
||||
- 'app/helpers/invite_members_helper.rb'
|
||||
- 'app/helpers/issuables_helper.rb'
|
||||
- 'app/helpers/issues_helper.rb'
|
||||
- 'app/helpers/merge_requests_helper.rb'
|
||||
- 'app/helpers/mirror_helper.rb'
|
||||
- 'app/helpers/notes_helper.rb'
|
||||
- 'app/helpers/operations_helper.rb'
|
||||
- 'app/helpers/packages_helper.rb'
|
||||
- 'app/helpers/preferences_helper.rb'
|
||||
- 'app/helpers/projects/security/configuration_helper.rb'
|
||||
- 'app/helpers/projects_helper.rb'
|
||||
- 'app/helpers/releases_helper.rb'
|
||||
- 'app/helpers/search_helper.rb'
|
||||
- 'app/helpers/visibility_level_helper.rb'
|
||||
- 'app/helpers/wiki_helper.rb'
|
||||
- 'app/mailers/emails/identity_verification.rb'
|
||||
- 'app/models/concerns/ci/has_completion_reason.rb'
|
||||
- 'app/models/integration.rb'
|
||||
- 'app/models/integrations/apple_app_store.rb'
|
||||
- 'app/models/integrations/beyond_identity.rb'
|
||||
- 'app/models/integrations/google_play.rb'
|
||||
- 'app/models/integrations/irker.rb'
|
||||
- 'app/models/integrations/jira.rb'
|
||||
- 'app/models/integrations/jira_cloud_app.rb'
|
||||
- 'app/models/integrations/phorge.rb'
|
||||
- 'app/models/integrations/zentao.rb'
|
||||
- 'app/models/key.rb'
|
||||
- 'app/models/user.rb'
|
||||
- 'app/presenters/clusters/cluster_presenter.rb'
|
||||
- 'app/presenters/commit_status_presenter.rb'
|
||||
- 'app/presenters/dev_ops_report/metric_presenter.rb'
|
||||
- 'app/presenters/group_clusterable_presenter.rb'
|
||||
- 'app/presenters/instance_clusterable_presenter.rb'
|
||||
- 'app/presenters/key_presenter.rb'
|
||||
- 'app/presenters/project_clusterable_presenter.rb'
|
||||
- 'app/presenters/projects/security/configuration_presenter.rb'
|
||||
- 'app/serializers/issue_entity.rb'
|
||||
- 'app/serializers/merge_request_noteable_entity.rb'
|
||||
- 'app/serializers/merge_request_widget_entity.rb'
|
||||
- 'app/services/jira/requests/base.rb'
|
||||
- 'app/services/merge_requests/refresh_service.rb'
|
||||
- 'app/services/projects/update_service.rb'
|
||||
- 'ee/app/components/namespaces/combined_storage_users/base_alert_component.rb'
|
||||
- 'ee/app/components/namespaces/free_user_cap/enforcement_alert_component.rb'
|
||||
- 'ee/app/components/namespaces/storage/limit_alert_component.rb'
|
||||
- 'ee/app/components/namespaces/storage/pre_enforcement_alert_component.rb'
|
||||
- 'ee/app/components/namespaces/storage/repository_limit_alert_component.rb'
|
||||
- 'ee/app/controllers/concerns/gitlab_subscriptions/trials/duo_common.rb'
|
||||
- 'ee/app/helpers/billing_plans_helper.rb'
|
||||
- 'ee/app/helpers/dependencies_helper.rb'
|
||||
- 'ee/app/helpers/ee/container_registry/container_registry_helper.rb'
|
||||
- 'ee/app/helpers/ee/form_helper.rb'
|
||||
- 'ee/app/helpers/ee/groups/settings_helper.rb'
|
||||
- 'ee/app/helpers/ee/groups_helper.rb'
|
||||
- 'ee/app/helpers/ee/import_helper.rb'
|
||||
- 'ee/app/helpers/ee/projects_helper.rb'
|
||||
- 'ee/app/helpers/ee/security_orchestration_helper.rb'
|
||||
- 'ee/app/helpers/epics_helper.rb'
|
||||
- 'ee/app/helpers/groups/add_ons/discover_duo_pro_helper.rb'
|
||||
- 'ee/app/helpers/groups/discovers_helper.rb'
|
||||
- 'ee/app/helpers/member_roles_helper.rb'
|
||||
- 'ee/app/helpers/namespaces/free_user_cap_helper.rb'
|
||||
- 'ee/app/helpers/projects/learn_gitlab_helper.rb'
|
||||
- 'ee/app/helpers/projects/security/api_fuzzing_configuration_helper.rb'
|
||||
- 'ee/app/helpers/projects/security/sast_configuration_helper.rb'
|
||||
- 'ee/app/helpers/security_helper.rb'
|
||||
- 'ee/app/helpers/vulnerabilities_helper.rb'
|
||||
- 'ee/app/models/ee/member.rb'
|
||||
- 'ee/app/models/integrations/git_guardian.rb'
|
||||
- 'ee/app/models/integrations/github.rb'
|
||||
- 'ee/app/presenters/ee/merge_request_presenter.rb'
|
||||
- 'ee/app/serializers/epic_entity.rb'
|
||||
- 'ee/app/services/ee/auth/container_registry_authentication_service.rb'
|
||||
- 'ee/app/services/incident_management/create_incident_sla_exceeded_label_service.rb'
|
||||
- 'ee/app/services/merge_requests/update_blocks_service.rb'
|
||||
- 'ee/app/services/merge_trains/refresh_merge_request_service.rb'
|
||||
- 'ee/app/services/search/rake_task_executor_service.rb'
|
||||
- 'ee/app/services/security/security_orchestration_policies/project_create_service.rb'
|
||||
- 'ee/lib/api/managed_licenses.rb'
|
||||
- 'ee/lib/api/member_roles.rb'
|
||||
- 'ee/lib/ee/gitlab/namespace_storage_size_error_message.rb'
|
||||
- 'ee/lib/gitlab/analytics/cycle_analytics/summary/change_failure_rate.rb'
|
||||
- 'ee/lib/gitlab/analytics/cycle_analytics/summary/group/deployment_frequency.rb'
|
||||
- 'ee/lib/gitlab/analytics/cycle_analytics/summary/lead_time.rb'
|
||||
- 'ee/lib/gitlab/analytics/cycle_analytics/summary/lead_time_for_changes.rb'
|
||||
- 'ee/lib/gitlab/analytics/cycle_analytics/summary/time_to_merge.rb'
|
||||
- 'ee/lib/gitlab/analytics/cycle_analytics/summary/time_to_restore_service.rb'
|
||||
- 'ee/lib/gitlab/checks/secrets_check.rb'
|
||||
- 'ee/lib/gitlab/expiring_subscription_message.rb'
|
||||
- 'ee/lib/gitlab/llm/chain/tools/tool.rb'
|
||||
- 'ee/lib/gitlab/llm/embeddings/utils/base_content_parser.rb'
|
||||
- 'ee/lib/gitlab/root_excess_size_error_message.rb'
|
||||
- 'ee/lib/security/scan_result_policies/policy_violation_comment.rb'
|
||||
- 'ee/lib/system_check/geo/current_node_check.rb'
|
||||
- 'ee/spec/components/namespaces/free_user_cap/enforcement_alert_component_spec.rb'
|
||||
- 'ee/spec/components/namespaces/free_user_cap/non_owner_enforcement_alert_component_spec.rb'
|
||||
- 'ee/spec/components/namespaces/storage/pre_enforcement_alert_component_spec.rb'
|
||||
- 'ee/spec/features/admin/admin_show_new_user_signups_cap_alert_spec.rb'
|
||||
- 'ee/spec/features/groups/group_overview_spec.rb'
|
||||
- 'ee/spec/features/merge_request/user_edits_multiple_reviewers_mr_spec.rb'
|
||||
- 'ee/spec/features/projects/show_project_spec.rb'
|
||||
- 'ee/spec/features/search/elastic/project_search_spec.rb'
|
||||
- 'ee/spec/features/search/zoekt/search_spec.rb'
|
||||
- 'ee/spec/features/security/project/discover_spec.rb'
|
||||
- 'ee/spec/helpers/container_registry/container_registry_helper_spec.rb'
|
||||
- 'ee/spec/helpers/ee/projects/security/api_fuzzing_configuration_helper_spec.rb'
|
||||
- 'ee/spec/helpers/ee/projects/security/sast_configuration_helper_spec.rb'
|
||||
- 'ee/spec/helpers/epics_helper_spec.rb'
|
||||
- 'ee/spec/helpers/member_roles_helper_spec.rb'
|
||||
- 'ee/spec/helpers/projects/learn_gitlab_helper_spec.rb'
|
||||
- 'ee/spec/helpers/projects_helper_spec.rb'
|
||||
- 'ee/spec/helpers/security_helper_spec.rb'
|
||||
- 'ee/spec/lib/ee/gitlab/namespace_storage_size_error_message_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/analytics/cycle_analytics/summary/change_failure_rate_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/analytics/cycle_analytics/summary/lead_time_for_changes_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/analytics/cycle_analytics/summary/lead_time_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/analytics/cycle_analytics/summary/time_to_restore_service_spec.rb'
|
||||
- 'ee/spec/lib/gitlab/llm/embeddings/utils/base_content_parser_spec.rb'
|
||||
- 'ee/spec/mailers/emails/enterprise_users_spec.rb'
|
||||
- 'ee/spec/requests/api/internal/base_spec.rb'
|
||||
- 'ee/spec/requests/api/member_roles_spec.rb'
|
||||
- 'ee/spec/requests/callout_spec.rb'
|
||||
- 'ee/spec/services/ee/auth/container_registry_authentication_service_spec.rb'
|
||||
- 'ee/spec/support/shared_contexts/secrets_check_shared_contexts.rb'
|
||||
- 'ee/spec/views/admin/application_settings/_ee_package_registry.html.haml_spec.rb'
|
||||
- 'ee/spec/views/groups/add_ons/discover_duo_pro/show.html.haml_spec.rb'
|
||||
- 'ee/spec/views/groups/settings/analytics/_analytics_dashboards.html.haml_spec.rb'
|
||||
- 'ee/spec/views/projects/settings/analytics/_custom_dashboard_projects.html.haml_spec.rb'
|
||||
- 'ee/spec/views/user_settings/profiles/show.html.haml_spec.rb'
|
||||
- 'lib/backup/tasks/database.rb'
|
||||
- 'lib/gitlab/checks/global_file_size_check.rb'
|
||||
- 'lib/gitlab/cycle_analytics/summary/deployment_frequency.rb'
|
||||
- 'lib/gitlab/graphql/deprecations.rb'
|
||||
- 'lib/gitlab/middleware/go.rb'
|
||||
- 'lib/gitlab/security/features.rb'
|
||||
- 'lib/gitlab/usage_data_counters/hll_redis_counter.rb'
|
||||
- 'lib/slack/block_kit/app_home_opened.rb'
|
||||
- 'lib/system_check/helpers.rb'
|
||||
- 'lib/users/internal.rb'
|
||||
- 'lib/web_ide/extensions_marketplace.rb'
|
||||
- 'spec/controllers/import/github_controller_spec.rb'
|
||||
- 'spec/features/admin/admin_sees_background_migrations_spec.rb'
|
||||
- 'spec/features/dashboard/snippets_spec.rb'
|
||||
- 'spec/features/groups/container_registry_spec.rb'
|
||||
- 'spec/features/help_dropdown_spec.rb'
|
||||
- 'spec/features/issues/service_desk_spec.rb'
|
||||
- 'spec/features/projects/container_registry_spec.rb'
|
||||
- 'spec/features/projects/settings/branch_rules_callout_spec.rb'
|
||||
- 'spec/features/projects/settings/registry_settings_spec.rb'
|
||||
- 'spec/graphql/resolvers/projects/jira_projects_resolver_spec.rb'
|
||||
- 'spec/helpers/ci/pipeline_editor_helper_spec.rb'
|
||||
- 'spec/helpers/clusters_helper_spec.rb'
|
||||
- 'spec/helpers/container_registry/container_registry_helper_spec.rb'
|
||||
- 'spec/helpers/ide_helper_spec.rb'
|
||||
- 'spec/helpers/invite_members_helper_spec.rb'
|
||||
- 'spec/helpers/issues_helper_spec.rb'
|
||||
- 'spec/helpers/operations_helper_spec.rb'
|
||||
- 'spec/helpers/projects/security/configuration_helper_spec.rb'
|
||||
- 'spec/lib/gitlab/security/scan_configuration_spec.rb'
|
||||
- 'spec/mailers/emails/pages_domains_spec.rb'
|
||||
- 'spec/mailers/emails/profile_spec.rb'
|
||||
- 'spec/presenters/clusters/cluster_presenter_spec.rb'
|
||||
- 'spec/presenters/commit_status_presenter_spec.rb'
|
||||
- 'spec/presenters/projects/security/configuration_presenter_spec.rb'
|
||||
- 'spec/requests/api/import_github_spec.rb'
|
||||
- 'spec/support/shared_examples/services/jira/requests/base_shared_examples.rb'
|
||||
- 'spec/views/user_settings/profiles/show.html.haml_spec.rb'
|
||||
|
|
@ -1,12 +1,6 @@
|
|||
---
|
||||
Migration/EnsureFactoryForTable:
|
||||
Exclude:
|
||||
- 'db/migrate/20230821133549_create_packages_nuget_symbols.rb'
|
||||
- 'db/migrate/20230823132142_create_instance_google_cloud_logging_configurations.rb'
|
||||
- 'db/migrate/20230903170000_create_packages_protection_rules.rb'
|
||||
- 'db/migrate/20230905234948_create_projects_visits_tables.rb'
|
||||
- 'db/migrate/20230905234949_create_groups_visits_tables.rb'
|
||||
- 'db/migrate/20230906072349_create_audit_events_amazon_s3_configurations.rb'
|
||||
- 'db/migrate/20230915103259_create_ci_finished_build_ch_sync_events.rb'
|
||||
- 'db/migrate/20230926092914_add_approval_group_rules.rb'
|
||||
- 'db/migrate/20230926092944_add_approval_group_rules_groups.rb'
|
||||
|
|
|
|||
|
|
@ -821,7 +821,6 @@ RSpec/ContextWording:
|
|||
- 'ee/spec/workers/ci/runners/stale_group_runners_prune_cron_worker_spec.rb'
|
||||
- 'ee/spec/workers/ci/upstream_projects_subscriptions_cleanup_worker_spec.rb'
|
||||
- 'ee/spec/workers/ee/repository_check/batch_worker_spec.rb'
|
||||
- 'ee/spec/workers/elastic_index_bulk_cron_worker_spec.rb'
|
||||
- 'ee/spec/workers/elastic_indexing_control_worker_spec.rb'
|
||||
- 'ee/spec/workers/geo/prune_event_log_worker_spec.rb'
|
||||
- 'ee/spec/workers/geo/verification_timeout_worker_spec.rb'
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ RSpec/ExpectInHook:
|
|||
- 'ee/spec/tasks/gitlab/license_rake_spec.rb'
|
||||
- 'ee/spec/tasks/gitlab/spdx_rake_spec.rb'
|
||||
- 'ee/spec/workers/analytics/cycle_analytics/consistency_worker_spec.rb'
|
||||
- 'ee/spec/workers/elastic_index_bulk_cron_worker_spec.rb'
|
||||
- 'ee/spec/workers/elastic_indexing_control_worker_spec.rb'
|
||||
- 'ee/spec/workers/geo/secondary/registry_consistency_worker_spec.rb'
|
||||
- 'ee/spec/workers/geo/verification_state_backfill_worker_spec.rb'
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ Style/HashEachMethods:
|
|||
- 'app/services/security/merge_reports_service.rb'
|
||||
- 'config/initializers/6_validations.rb'
|
||||
- 'config/initializers/8_gitaly.rb'
|
||||
- 'db/post_migrate/20230905091059_sync_index_for_ci_stages_pipeline_id_bigint.rb'
|
||||
- 'db/post_migrate/20230906102738_sync_index_for_ci_sources_pipelines_pipeline_id_bigint.rb'
|
||||
- 'db/post_migrate/20240422070036_swap_ci_pipelines_pk_with_bigint_p_ci_builds_p_ci_stages.rb'
|
||||
- 'ee/app/graphql/types/compliance_management/merge_requests/compliance_violation_reason_enum.rb'
|
||||
|
|
|
|||
|
|
@ -1066,18 +1066,13 @@ Style/InlineDisableAnnotation:
|
|||
- 'config/routes/project.rb'
|
||||
- 'danger/ce_ee_vue_templates/Dangerfile'
|
||||
- 'danger/roulette/Dangerfile'
|
||||
- 'db/migrate/20230822064649_add_organization_id_to_project.rb'
|
||||
- 'db/migrate/20230906185552_add_markdown_fields_to_review_llm_summary.rb'
|
||||
- 'db/migrate/20230906204935_restart_self_hosted_sent_notifications_backfill.rb'
|
||||
- 'db/migrate/20230915103259_create_ci_finished_build_ch_sync_events.rb'
|
||||
- 'db/migrate/20230917144717_add_package_name_pattern_query_to_packages_protection_rule.rb'
|
||||
- 'db/migrate/20230921081527_add_queued_migration_version_to_batched_background_migrations.rb'
|
||||
- 'db/migrate/20231017135207_add_fields_to_ml_model.rb'
|
||||
- 'db/migrate/20231019180421_add_name_description_to_catalog_resources.rb'
|
||||
- 'db/migrate/20231024142236_add_fields_to_bulk_import_failures.rb'
|
||||
- 'db/post_migrate/20230823145126_swap_notes_id_to_bigint_for_self_managed.rb'
|
||||
- 'db/post_migrate/20230908033511_swap_columns_for_ci_pipeline_chat_data_pipeline_id_bigint.rb'
|
||||
- 'db/post_migrate/20230913130629_index_org_id_on_projects.rb'
|
||||
- 'db/post_migrate/20230924134453_cleanup_uuid_type_migration_on_vulnerability_occurrences.rb'
|
||||
- 'db/post_migrate/20231003045342_migrate_sidekiq_namespaced_jobs.rb'
|
||||
- 'db/post_migrate/20231003142534_add_build_timeout_index.rb'
|
||||
|
|
@ -2605,17 +2600,7 @@ Style/InlineDisableAnnotation:
|
|||
- 'spec/lib/object_storage/pending_direct_upload_spec.rb'
|
||||
- 'spec/lib/omni_auth/strategies/jwt_spec.rb'
|
||||
- 'spec/mailers/notify_spec.rb'
|
||||
- 'spec/migrations/20230726144458_swap_notes_id_to_bigint_for_self_managed_spec.rb'
|
||||
- 'spec/migrations/20230809174702_swap_system_note_metadata_note_id_to_bigint_for_self_managed_spec.rb'
|
||||
- 'spec/migrations/20230809210550_swap_issue_user_mentions_note_id_to_bigint_for_self_managed_spec.rb'
|
||||
- 'spec/migrations/20230810113227_swap_note_diff_files_note_id_to_bigint_for_self_hosts_spec.rb'
|
||||
- 'spec/migrations/20230816152639_swap_design_user_mentions_note_id_to_big_int_for_self_managed_spec.rb'
|
||||
- 'spec/migrations/20230817111938_swap_events_target_id_to_bigint_for_self_hosts_spec.rb'
|
||||
- 'spec/migrations/20230817143637_swap_award_emoji_note_id_to_bigint_for_self_hosts_spec.rb'
|
||||
- 'spec/migrations/20230906204934_restart_self_hosted_sent_notifications_bigint_conversion_spec.rb'
|
||||
- 'spec/migrations/20230906204935_restart_self_hosted_sent_notifications_backfill_spec.rb'
|
||||
- 'spec/migrations/20231016001000_fix_design_user_mentions_design_id_note_id_index_for_self_managed_spec.rb'
|
||||
- 'spec/migrations/swap_merge_request_user_mentions_note_id_to_bigint_for_self_managed_spec.rb'
|
||||
- 'spec/models/board_spec.rb'
|
||||
- 'spec/models/ci/build_trace_chunk_spec.rb'
|
||||
- 'spec/models/ci/job_token/project_scope_link_spec.rb'
|
||||
|
|
|
|||
2
Gemfile
2
Gemfile
|
|
@ -83,7 +83,7 @@ gem 'marginalia', '~> 1.11.1' # rubocop:todo Gemfile/MissingFeatureCategory
|
|||
gem 'declarative_policy', '~> 1.1.0' # rubocop:todo Gemfile/MissingFeatureCategory
|
||||
|
||||
# For source code paths mapping
|
||||
gem 'coverband', '6.1.2', require: false, feature_category: :shared
|
||||
gem 'coverband', '6.1.3', require: false, feature_category: :shared
|
||||
|
||||
# Authentication libraries
|
||||
gem 'devise', '~> 4.9.3', feature_category: :system_access
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
{"name":"cork","version":"0.3.0","platform":"ruby","checksum":"a0a0ac50e262f8514d1abe0a14e95e71c98b24e3378690e5d044daf0013ad4bc"},
|
||||
{"name":"cose","version":"1.3.0","platform":"ruby","checksum":"63247c66a5bc76e53926756574fe3724cc0a88707e358c90532ae2a320e98601"},
|
||||
{"name":"countries","version":"4.0.1","platform":"ruby","checksum":"d32e8a3c0b22949f1a41ea6d9005f5168ffce226f8fe077d1d6be785fffa81c5"},
|
||||
{"name":"coverband","version":"6.1.2","platform":"ruby","checksum":"979f356b0f1ff63a78b6ffbbbd0dccb3674c83d74d7e6fbdc3ee98f1ef35ba32"},
|
||||
{"name":"coverband","version":"6.1.3","platform":"ruby","checksum":"84c988d1d61edfb80d1e0c1f2fd56fd690fe5aad71bd8827867e826360f3b8e3"},
|
||||
{"name":"crack","version":"0.4.3","platform":"ruby","checksum":"5318ba8cd9cf7e0b5feb38948048503ba4b1fdc1b6ff30a39f0a00feb6036b29"},
|
||||
{"name":"crass","version":"1.0.6","platform":"ruby","checksum":"dc516022a56e7b3b156099abc81b6d2b08ea1ed12676ac7a5657617f012bd45d"},
|
||||
{"name":"creole","version":"0.5.0","platform":"ruby","checksum":"951701e2d80760f156b1cb2a93471ca97c076289becc067a33b745133ed32c03"},
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ GEM
|
|||
countries (4.0.1)
|
||||
i18n_data (~> 0.13.0)
|
||||
sixarm_ruby_unaccent (~> 1.1)
|
||||
coverband (6.1.2)
|
||||
coverband (6.1.3)
|
||||
redis (>= 3.0)
|
||||
crack (0.4.3)
|
||||
safe_yaml (~> 1.0.0)
|
||||
|
|
@ -2002,7 +2002,7 @@ DEPENDENCIES
|
|||
concurrent-ruby (~> 1.1)
|
||||
connection_pool (~> 2.4)
|
||||
countries (~> 4.0.0)
|
||||
coverband (= 6.1.2)
|
||||
coverband (= 6.1.3)
|
||||
creole (~> 0.5.0)
|
||||
crystalball (~> 0.7.0)
|
||||
cssbundling-rails (= 1.4.1)
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
{"name":"cork","version":"0.3.0","platform":"ruby","checksum":"a0a0ac50e262f8514d1abe0a14e95e71c98b24e3378690e5d044daf0013ad4bc"},
|
||||
{"name":"cose","version":"1.3.0","platform":"ruby","checksum":"63247c66a5bc76e53926756574fe3724cc0a88707e358c90532ae2a320e98601"},
|
||||
{"name":"countries","version":"4.0.1","platform":"ruby","checksum":"d32e8a3c0b22949f1a41ea6d9005f5168ffce226f8fe077d1d6be785fffa81c5"},
|
||||
{"name":"coverband","version":"6.1.2","platform":"ruby","checksum":"979f356b0f1ff63a78b6ffbbbd0dccb3674c83d74d7e6fbdc3ee98f1ef35ba32"},
|
||||
{"name":"coverband","version":"6.1.3","platform":"ruby","checksum":"84c988d1d61edfb80d1e0c1f2fd56fd690fe5aad71bd8827867e826360f3b8e3"},
|
||||
{"name":"crack","version":"0.4.3","platform":"ruby","checksum":"5318ba8cd9cf7e0b5feb38948048503ba4b1fdc1b6ff30a39f0a00feb6036b29"},
|
||||
{"name":"crass","version":"1.0.6","platform":"ruby","checksum":"dc516022a56e7b3b156099abc81b6d2b08ea1ed12676ac7a5657617f012bd45d"},
|
||||
{"name":"creole","version":"0.5.0","platform":"ruby","checksum":"951701e2d80760f156b1cb2a93471ca97c076289becc067a33b745133ed32c03"},
|
||||
|
|
|
|||
|
|
@ -460,7 +460,7 @@ GEM
|
|||
countries (4.0.1)
|
||||
i18n_data (~> 0.13.0)
|
||||
sixarm_ruby_unaccent (~> 1.1)
|
||||
coverband (6.1.2)
|
||||
coverband (6.1.3)
|
||||
redis (>= 3.0)
|
||||
crack (0.4.3)
|
||||
safe_yaml (~> 1.0.0)
|
||||
|
|
@ -2029,7 +2029,7 @@ DEPENDENCIES
|
|||
concurrent-ruby (~> 1.1)
|
||||
connection_pool (~> 2.4)
|
||||
countries (~> 4.0.0)
|
||||
coverband (= 6.1.2)
|
||||
coverband (= 6.1.3)
|
||||
creole (~> 0.5.0)
|
||||
crystalball (~> 0.7.0)
|
||||
cssbundling-rails (= 1.4.1)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<!-- eslint-disable vue/multi-word-component-names -->
|
||||
<script>
|
||||
import { GlButton, GlTabs, GlTab, GlLink, GlBadge } from '@gitlab/ui';
|
||||
import Markdown from '~/vue_shared/components/markdown/non_gfm_markdown.vue';
|
||||
import DocLine from './doc_line.vue';
|
||||
|
||||
export default {
|
||||
|
|
@ -11,6 +12,7 @@ export default {
|
|||
GlLink,
|
||||
GlBadge,
|
||||
DocLine,
|
||||
Markdown,
|
||||
},
|
||||
props: {
|
||||
position: {
|
||||
|
|
@ -104,9 +106,7 @@ export default {
|
|||
:class="$options.colorScheme"
|
||||
class="border-0 bg-transparent m-0 code highlight text-wrap"
|
||||
><doc-line v-for="(tokens, tokenIndex) in hover.tokens" :key="tokenIndex" :language="hover.language" :tokens="tokens" /></pre>
|
||||
<p v-else ref="doc-output" class="p-3 m-0">
|
||||
{{ hover.value }}
|
||||
</p>
|
||||
<markdown v-else ref="doc-output" class="gl-p-3" :markdown="hover.value" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="definitionPath || isCurrentDefinition" class="popover-body border-top">
|
||||
|
|
|
|||
|
|
@ -240,6 +240,7 @@ export default {
|
|||
twig: () => import(/* webpackChunkName: 'hl-twig' */ 'highlight.js/lib/languages/twig'),
|
||||
typescript: () =>
|
||||
import(/* webpackChunkName: 'hl-typescript' */ 'highlight.js/lib/languages/typescript'),
|
||||
ts: () => import(/* webpackChunkName: 'hl-typescript' */ 'highlight.js/lib/languages/typescript'),
|
||||
vala: () => import(/* webpackChunkName: 'hl-vala' */ 'highlight.js/lib/languages/vala'),
|
||||
vbnet: () => import(/* webpackChunkName: 'hl-vbnet' */ 'highlight.js/lib/languages/vbnet'),
|
||||
'vbscript-html': () =>
|
||||
|
|
|
|||
|
|
@ -103,20 +103,20 @@ export function removeListenerSystemColorSchemeChange(onEvent) {
|
|||
.removeEventListener('change', (event) => handleColorSchemeChange(onEvent, event));
|
||||
}
|
||||
|
||||
function isNarrowScreenMediaQuery(elRef) {
|
||||
const computedStyles = getComputedStyle(elRef);
|
||||
function isNarrowScreenMediaQuery() {
|
||||
const computedStyles = getComputedStyle(document.body);
|
||||
const largeBreakpointSize = parseInt(computedStyles.getPropertyValue('--breakpoint-lg'), 10);
|
||||
return window.matchMedia(`(max-width: ${largeBreakpointSize - 1}px)`);
|
||||
}
|
||||
|
||||
export function isNarrowScreen(elRef) {
|
||||
return isNarrowScreenMediaQuery(elRef).matches;
|
||||
export function isNarrowScreen() {
|
||||
return isNarrowScreenMediaQuery().matches;
|
||||
}
|
||||
|
||||
export function isNarrowScreenAddListener(elRef, handlerFn) {
|
||||
isNarrowScreenMediaQuery(elRef).addEventListener('change', handlerFn);
|
||||
export function isNarrowScreenAddListener(handlerFn) {
|
||||
isNarrowScreenMediaQuery().addEventListener('change', handlerFn);
|
||||
}
|
||||
|
||||
export function isNarrowScreenRemoveListener(elRef, handlerFn) {
|
||||
isNarrowScreenMediaQuery(elRef).removeEventListener('change', handlerFn);
|
||||
export function isNarrowScreenRemoveListener(handlerFn) {
|
||||
isNarrowScreenMediaQuery().removeEventListener('change', handlerFn);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,11 @@ export default {
|
|||
<assigned-users :users="mergeRequest.reviewers.nodes" type="REVIEWERS" />
|
||||
</td>
|
||||
<td class="gl-py-4 gl-pl-3 gl-pr-5 gl-align-top">
|
||||
<div class="gl-flex gl-justify-end gl-gap-3" :aria-label="statsAriaLabel">
|
||||
<div
|
||||
class="gl-flex gl-justify-end gl-gap-3"
|
||||
:aria-label="statsAriaLabel"
|
||||
:title="statsAriaLabel"
|
||||
>
|
||||
<div class="gl-whitespace-nowrap">
|
||||
<gl-icon name="comments" class="!gl-align-middle" />
|
||||
{{ mergeRequest.userNotesCount }}
|
||||
|
|
|
|||
|
|
@ -40,13 +40,11 @@ export default {
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
if (this.$refs?.buttonRoot) {
|
||||
this.isNarrowScreen = isNarrowScreen(this.$refs.buttonRoot);
|
||||
isNarrowScreenAddListener(this.$refs.buttonRoot, this.handleNarrowScreenChange);
|
||||
}
|
||||
this.isNarrowScreen = isNarrowScreen();
|
||||
isNarrowScreenAddListener(this.handleNarrowScreenChange);
|
||||
},
|
||||
beforeDestroy() {
|
||||
isNarrowScreenRemoveListener(this.$refs.buttonRoot, this.handleNarrowScreenChange);
|
||||
isNarrowScreenRemoveListener(this.handleNarrowScreenChange);
|
||||
},
|
||||
methods: {
|
||||
handleNarrowScreenChange({ matches }) {
|
||||
|
|
@ -65,7 +63,6 @@ export default {
|
|||
<template>
|
||||
<div
|
||||
v-if="glFeatures.searchButtonTopRight"
|
||||
ref="buttonRoot"
|
||||
:class="{ 'border-0 gl-w-[300px] gl-rounded-base': !isNarrowScreen }"
|
||||
>
|
||||
<gl-button
|
||||
|
|
|
|||
|
|
@ -134,11 +134,11 @@ export default {
|
|||
<section
|
||||
:id="anchorId"
|
||||
ref="crudComponent"
|
||||
class="crud gl-border gl-rounded-base gl-border-default gl-bg-subtle"
|
||||
class="crud gl-border gl-rounded-base gl-border-section gl-bg-subtle"
|
||||
:class="{ 'gl-mt-5': isCollapsible }"
|
||||
>
|
||||
<header
|
||||
class="crud-header gl-border-b gl-flex gl-flex-wrap gl-justify-between gl-gap-x-5 gl-gap-y-2 gl-rounded-t-base gl-border-default gl-bg-default gl-px-5 gl-py-4"
|
||||
class="crud-header gl-border-b gl-flex gl-flex-wrap gl-justify-between gl-gap-x-5 gl-gap-y-2 gl-rounded-t-base gl-border-section gl-bg-section gl-px-5 gl-py-4"
|
||||
:class="[
|
||||
headerClass,
|
||||
{
|
||||
|
|
@ -195,7 +195,7 @@ export default {
|
|||
>
|
||||
<div
|
||||
v-if="isCollapsible"
|
||||
class="gl-border-l gl-absolute gl-right-5 gl-top-4 gl-h-6 gl-pl-3"
|
||||
class="gl-border-l gl-absolute gl-right-5 gl-top-4 gl-h-6 gl-border-l-section gl-pl-3"
|
||||
>
|
||||
<gl-button
|
||||
v-gl-tooltip
|
||||
|
|
@ -216,7 +216,7 @@ export default {
|
|||
|
||||
<div
|
||||
v-if="isFormUsedAndVisible"
|
||||
class="gl-border-b gl-border-default gl-bg-default gl-p-5 gl-pt-4"
|
||||
class="gl-border-b gl-border-section gl-bg-section gl-p-5 gl-pt-4"
|
||||
data-testid="crud-form"
|
||||
>
|
||||
<slot name="form"></slot>
|
||||
|
|
@ -245,7 +245,7 @@ export default {
|
|||
|
||||
<footer
|
||||
v-if="$scopedSlots.footer"
|
||||
class="gl-border-t gl-rounded-b-base gl-border-default gl-bg-default gl-px-5 gl-py-4"
|
||||
class="gl-border-t gl-rounded-b-base gl-border-section gl-bg-section gl-px-5 gl-py-4"
|
||||
data-testid="crud-footer"
|
||||
>
|
||||
<slot name="footer"></slot>
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ $item-remove-button-space: 42px;
|
|||
|
||||
&:hover,
|
||||
&:focus-within {
|
||||
background-color: var(--gl-background-color-default);
|
||||
border-color: var(--gl-border-color-default);
|
||||
background-color: var(--gl-background-color-section);
|
||||
border-color: var(--gl-border-color-section);
|
||||
}
|
||||
|
||||
.merge-request-status.closed {
|
||||
|
|
|
|||
|
|
@ -61,6 +61,10 @@ $crud-header-min-height: px-to-rem(49px);
|
|||
tr:last-of-type td {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
tr th, tr td {
|
||||
border-color: var(--gl-border-color-section);
|
||||
}
|
||||
}
|
||||
|
||||
table.gl-table.b-table.b-table-stacked-sm {
|
||||
|
|
@ -81,7 +85,7 @@ $crud-header-min-height: px-to-rem(49px);
|
|||
|
||||
.content-list > li {
|
||||
padding-inline: $gl-spacing-scale-5;
|
||||
border-bottom-color: var(--gl-border-color-default);
|
||||
@apply gl-border-b-section #{!important};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
%section
|
||||
.crud.gl-bg-subtle.gl-border.gl-border-default.gl-rounded-base{ @options, class: ('js-toggle-container' if @toggle_text) }
|
||||
%header.crud-header.gl-flex.gl-flex-wrap.gl-justify-between.gl-gap-x-5.gl-gap-y-2.gl-px-5.gl-py-4.gl-bg-default.gl-border-b.gl-border-default.gl-rounded-t-base
|
||||
.crud.gl-bg-subtle.gl-border.gl-border-section.gl-rounded-base{ @options, class: ('js-toggle-container' if @toggle_text) }
|
||||
%header.crud-header.gl-flex.gl-flex-wrap.gl-justify-between.gl-gap-x-5.gl-gap-y-2.gl-px-5.gl-py-4.gl-bg-section.gl-border-b.gl-border-section.gl-rounded-t-base
|
||||
.gl-flex.gl-flex-col.gl-self-center
|
||||
%h2.gl-text-base.gl-font-bold.gl-leading-normal.gl-inline-flex.gl-gap-3.gl-m-0{ data: { testid: 'crud-title' } }
|
||||
= @title
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
= actions
|
||||
|
||||
- if form?
|
||||
.gl-p-5.gl-pt-4.gl-bg-default.gl-border-b.gl-border-default{ form_options_attrs }
|
||||
.gl-p-5.gl-pt-4.gl-bg-section.gl-border-b.gl-border-section{ form_options_attrs }
|
||||
= form
|
||||
|
||||
.crud-body.gl-mx-5.gl-my-4{ body_options_attrs }
|
||||
|
|
@ -31,5 +31,5 @@
|
|||
= pagination
|
||||
|
||||
- if footer?
|
||||
.gl-px-5.gl-py-4.gl-bg-default.gl-border-t.gl-border-default.gl-rounded-b-base{ footer_options_attrs }
|
||||
.gl-px-5.gl-py-4.gl-bg-section.gl-border-t.gl-border-section.gl-rounded-b-base{ footer_options_attrs }
|
||||
= footer
|
||||
|
|
|
|||
|
|
@ -77,6 +77,26 @@ module Projects
|
|||
private_runner_setup_scripts
|
||||
end
|
||||
|
||||
def export_job_token_authorizations
|
||||
response = ::Ci::JobToken::ExportAuthorizationsService
|
||||
.new(current_user: current_user, accessed_project: @project)
|
||||
.execute
|
||||
|
||||
respond_to do |format|
|
||||
format.csv do
|
||||
if response.success?
|
||||
send_data(response.payload.fetch(:data),
|
||||
type: 'text/csv; charset=utf-8',
|
||||
filename: response.payload.fetch(:filename))
|
||||
else
|
||||
flash[:alert] = _('Failed to generate export')
|
||||
|
||||
redirect_to project_settings_ci_cd_path(@project)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def authorize_reset_cache!
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ module Ci
|
|||
include Ci::Partitionable
|
||||
|
||||
MAX_ATTEMPTS = 5
|
||||
self.table_name = 'ci_build_trace_metadata'
|
||||
self.table_name = :p_ci_build_trace_metadata
|
||||
self.primary_key = :build_id
|
||||
|
||||
belongs_to :build,
|
||||
|
|
@ -13,12 +13,13 @@ module Ci
|
|||
class_name: 'Ci::Build',
|
||||
partition_foreign_key: :partition_id,
|
||||
inverse_of: :trace_metadata
|
||||
|
||||
belongs_to :trace_artifact, # rubocop:disable Rails/InverseOf -- No clear relation to be used
|
||||
->(metadata) { in_partition(metadata) },
|
||||
class_name: 'Ci::JobArtifact',
|
||||
partition_foreign_key: :partition_id
|
||||
|
||||
partitionable scope: :build
|
||||
partitionable scope: :build, partitioned: true
|
||||
|
||||
validates :build, presence: true
|
||||
validates :archival_attempts, presence: true
|
||||
|
|
@ -27,20 +28,10 @@ module Ci
|
|||
record = find_by(build_id: build_id, partition_id: partition_id)
|
||||
return record if record
|
||||
|
||||
upsert({ build_id: build_id, partition_id: partition_id }, unique_by: unique_by_columns_for_upsert)
|
||||
upsert({ build_id: build_id, partition_id: partition_id }, unique_by: %w[build_id partition_id])
|
||||
find_by!(build_id: build_id, partition_id: partition_id)
|
||||
end
|
||||
|
||||
# Temporary fix to correctly identify an unique index for upsert
|
||||
# should be replaced with `%w[build_id partition_id]` in %17.5
|
||||
def self.unique_by_columns_for_upsert
|
||||
unique_indexes = connection.schema_cache.indexes(table_name).select(&:unique)
|
||||
columns = %w[partition_id build_id]
|
||||
return columns if unique_indexes.any? { |index| index.columns == columns }
|
||||
|
||||
columns.reverse
|
||||
end
|
||||
|
||||
# The job is retried around 5 times during the 7 days retention period for
|
||||
# trace chunks as defined in `Ci::BuildTraceChunks::RedisBase::CHUNK_REDIS_TTL`
|
||||
def can_attempt_archival_now?
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ module Ci
|
|||
REQUEST_CACHE_KEY = :job_token_authorizations
|
||||
CAPTURE_DELAY = 5.minutes
|
||||
|
||||
scope :for_project, ->(accessed_project) { where(accessed_project: accessed_project) }
|
||||
scope :preload_origin_project, -> { includes(origin_project: :route) }
|
||||
|
||||
# Record in SafeRequestStore a cross-project access attempt
|
||||
def self.capture(origin_project:, accessed_project:)
|
||||
# Skip self-referential accesses as they are always allowed and don't need
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# This class exports CI job token authorizations to a given project.
|
||||
module Ci
|
||||
module JobToken
|
||||
class ExportAuthorizationsService
|
||||
include Gitlab::Allowable
|
||||
|
||||
def initialize(current_user:, accessed_project:)
|
||||
@current_user = current_user
|
||||
@accessed_project = accessed_project
|
||||
end
|
||||
|
||||
def execute
|
||||
unless can?(current_user, :admin_project, accessed_project)
|
||||
return ServiceResponse.error(message: _('Access denied'), reason: :forbidden)
|
||||
end
|
||||
|
||||
csv_data = CsvBuilder.new(authorizations, header_to_value_hash).render
|
||||
|
||||
ServiceResponse.success(payload: { data: csv_data, filename: csv_filename })
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
attr_reader :accessed_project, :current_user
|
||||
|
||||
def authorizations
|
||||
Ci::JobToken::Authorization.for_project(accessed_project).preload_origin_project
|
||||
end
|
||||
|
||||
def header_to_value_hash
|
||||
{
|
||||
'Origin Project Path' => ->(auth) { auth.origin_project.full_path },
|
||||
'Last Authorized At (UTC)' => ->(auth) { auth.last_authorized_at.utc.iso8601 }
|
||||
}
|
||||
end
|
||||
|
||||
def csv_filename
|
||||
"job-token-authorizations-#{accessed_project.id}-#{Time.current.to_fs(:number)}.csv"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
namespace_id: namespace&.id,
|
||||
plan_name: namespace&.actual_plan_name,
|
||||
project_id: @project&.id,
|
||||
user_id: current_user&.id
|
||||
user: current_user
|
||||
).to_context.to_json.to_json}
|
||||
gl.snowplowPseudonymizedPageUrl = #{masked_page_url(group: namespace, project: @project).to_json};
|
||||
gl.maskedDefaultReferrerUrl = #{masked_referrer_url(request.referer).to_json};
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
---
|
||||
name: partition_ci_build_trace_metadata
|
||||
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/469056
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/168756
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/481800
|
||||
milestone: '17.5'
|
||||
group: group::ci platform
|
||||
type: gitlab_com_derisk
|
||||
default_enabled: false
|
||||
|
|
@ -18,6 +18,7 @@ Gitlab::Database::Partitioning.register_models(
|
|||
Ci::BuildExecutionConfig,
|
||||
Ci::BuildName,
|
||||
Ci::BuildTag,
|
||||
Ci::BuildTraceMetadata,
|
||||
Ci::BuildSource,
|
||||
Ci::Catalog::Resources::Components::Usage,
|
||||
Ci::Catalog::Resources::SyncEvent,
|
||||
|
|
@ -103,21 +104,4 @@ Gitlab::Database::Partitioning.register_tables(
|
|||
]
|
||||
)
|
||||
|
||||
Gitlab::Database::Partitioning.register_tables(
|
||||
[
|
||||
{
|
||||
limit_connection_names: %i[ci],
|
||||
table_name: 'p_ci_build_trace_metadata',
|
||||
partitioned_column: :partition_id,
|
||||
strategy: :ci_sliding_list,
|
||||
next_partition_if: ->(latest_partition) {
|
||||
::Feature.enabled?(:partition_ci_build_trace_metadata, :instance) &&
|
||||
latest_partition &&
|
||||
[100, 101].include?(latest_partition.values.max)
|
||||
},
|
||||
detach_partition_if: proc { false }
|
||||
}
|
||||
]
|
||||
)
|
||||
|
||||
Gitlab::Database::Partitioning.sync_partitions_ignore_db_error
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
|
|||
put :reset_registration_token
|
||||
post :create_deploy_token, path: 'deploy_token/create', to: 'repository#create_deploy_token'
|
||||
get :runner_setup_scripts, format: :json
|
||||
get :export_job_token_authorizations, format: :csv
|
||||
end
|
||||
|
||||
resource :operations, only: [:show, :update] do
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
- name: Introducing Duo Quick Chat
|
||||
description: |
|
||||
Introducing Duo Quick Chat, an AI-powered chat designed to work exactly where you are in your code. Duo Quick Chat operates directly on the lines you're editing, offering real-time assistance without ever moving you away from your code. Whether you're refactoring, fixing bugs, or writing tests, Duo Quick Chat provides suggestions and explanations on the spot, ensuring that you stay fully focused without switching context.
|
||||
stage: create
|
||||
self-managed: true
|
||||
gitlab-com: true
|
||||
available_in: [Premium, Ultimate]
|
||||
documentation_link: https://docs.gitlab.com/ee/user/gitlab_duo_chat/#in-the-editor-window
|
||||
image_url: https://img.youtube.com/v1/5JbAM5g2VbQ/hqdefault.jpg
|
||||
published_at: 2024-10-17
|
||||
release: 17.5
|
||||
|
||||
- name: Use self-hosted model for GitLab Duo Code Suggestions
|
||||
description: |
|
||||
You can now host your own supported large language models (LLMs) and configure them to make suggestions to developers while they write code. This feature is in beta and available with an Ultimate and Duo Enterprise subscription on self-managed GitLab environments.
|
||||
stage: ai-powered
|
||||
self-managed: true
|
||||
gitlab-com: false
|
||||
available_in: [Premium, Ultimate]
|
||||
documentation_link: https://docs.gitlab.com/ee/administration/self_hosted_models/
|
||||
image_url: https://about.gitlab.com/images/17_5/self-hosted-beta.png
|
||||
published_at: 2024-10-17
|
||||
release: 17.5
|
||||
|
||||
- name: Export Code suggestion usage events
|
||||
description: |
|
||||
Users can export raw code suggestion events from the GraphQL API. This way you can import the data into your data analysis tool to get deeper insights into acceptance rates across more dimensions, such as suggestion size, language, and user.
|
||||
stage: plan
|
||||
self-managed: true
|
||||
gitlab-com: true
|
||||
available_in: [Ultimate]
|
||||
documentation_link: https://docs.gitlab.com/ee/api/graphql/reference/#codesuggestionevent
|
||||
published_at: 2024-10-17
|
||||
release: 17.5
|
||||
|
||||
- name: Have a conversation with GitLab Duo Chat about your merge request
|
||||
description: |
|
||||
In response to your feedback, GitLab Duo Chat is now aware of merge requests. Whether you are a reviewer or an author, you can now converse with Chat about a merge request to quickly dig into it, or learn what to do next. Simply open your merge request and open Duo Chat, then start the conversation.
|
||||
This new feature complements our exiting feature, where you can quickly populate the description of a merge request by asking GitLab Duo to summarize code changes, so that reviewers can get a general understanding of what the merge request is about.
|
||||
stage: ai-powered
|
||||
self-managed: true
|
||||
gitlab-com: true
|
||||
available_in: [Ultimate]
|
||||
documentation_link: https://docs.gitlab.com/ee/user/gitlab_duo_chat/examples#ask-about-a-specific-merge-request
|
||||
image_url: https://img.youtube.com/v1/4muvSFuWWL4/hqdefault.jpg
|
||||
published_at: 2024-10-17
|
||||
release: 17.5
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,19 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddSnowplowDatabaseCollectorHostnameToApplicationSettings < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
with_lock_retries do
|
||||
add_column :application_settings, :snowplow_database_collector_hostname, :text, if_not_exists: true
|
||||
end
|
||||
|
||||
add_text_limit :application_settings, :snowplow_database_collector_hostname, 255
|
||||
end
|
||||
|
||||
def down
|
||||
with_lock_retries do
|
||||
remove_column :application_settings, :snowplow_database_collector_hostname, if_exists: true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddAdminMergeRequestToMemberRoles < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def up
|
||||
return if column_exists?(:member_roles, :admin_merge_request)
|
||||
|
||||
add_column :member_roles, :admin_merge_request, :boolean, default: false, null: false
|
||||
end
|
||||
|
||||
def down
|
||||
return unless column_exists?(:member_roles, :admin_merge_request)
|
||||
|
||||
remove_column :member_roles, :admin_merge_request
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddRollupProgressToWiProgresses < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :work_item_progresses, :rollup_progress, :boolean, default: true, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIndexToAbuseReportsOnUserIdStatusAndCategory < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
INDEX_NAME = 'idx_abuse_reports_user_id_status_and_category'
|
||||
|
||||
def up
|
||||
add_concurrent_index :abuse_reports, [:user_id, :status, :category], name: INDEX_NAME
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index_by_name :abuse_reports, INDEX_NAME
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPagesMultipleVersionsEnabledToProjectSettings < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :project_settings, :pages_multiple_versions_enabled, :boolean, default: false, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddDecompressArchiveFileTimeoutToApplicationSetting < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_column :application_settings, :decompress_archive_file_timeout, :integer, default: 210, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddMergedCommitShaToMergeRequests < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
with_lock_retries do
|
||||
add_column :merge_requests, :merged_commit_sha, :bytea unless column_exists?(:merge_requests, :merged_commit_sha)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
with_lock_retries do
|
||||
remove_column :merge_requests, :merged_commit_sha if column_exists?(:merge_requests, :merged_commit_sha)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddHashesToCreditCardValidations < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
with_lock_retries do
|
||||
add_column :user_credit_card_validations, :last_digits_hash, :text, if_not_exists: true
|
||||
add_column :user_credit_card_validations, :holder_name_hash, :text, if_not_exists: true
|
||||
add_column :user_credit_card_validations, :expiration_date_hash, :text, if_not_exists: true
|
||||
add_column :user_credit_card_validations, :network_hash, :text, if_not_exists: true
|
||||
end
|
||||
|
||||
add_text_limit :user_credit_card_validations, :last_digits_hash, 44
|
||||
add_text_limit :user_credit_card_validations, :holder_name_hash, 44
|
||||
add_text_limit :user_credit_card_validations, :expiration_date_hash, 44
|
||||
add_text_limit :user_credit_card_validations, :network_hash, 44
|
||||
end
|
||||
|
||||
def down
|
||||
with_lock_retries do
|
||||
remove_column :user_credit_card_validations, :last_digits_hash, if_exists: true
|
||||
remove_column :user_credit_card_validations, :holder_name_hash, if_exists: true
|
||||
remove_column :user_credit_card_validations, :expiration_date_hash, if_exists: true
|
||||
remove_column :user_credit_card_validations, :network_hash, if_exists: true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddLicensesToSbomOccurrences < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
add_column :sbom_occurrences, :licenses, :jsonb, default: []
|
||||
end
|
||||
end
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class InitBigintConversionForSharedRunnersDuration < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
TABLE_NAMES = %i[ci_project_monthly_usages ci_namespace_monthly_usages]
|
||||
COLUMN_NAMES = %i[shared_runners_duration]
|
||||
|
||||
def up
|
||||
TABLE_NAMES.each do |table_name|
|
||||
initialize_conversion_of_integer_to_bigint table_name, COLUMN_NAMES
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
TABLE_NAMES.each do |table_name|
|
||||
revert_initialize_conversion_of_integer_to_bigint table_name, COLUMN_NAMES
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateWorkspaceVariables < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
create_table :workspace_variables do |t|
|
||||
t.references :workspace, index: true, null: false, foreign_key: { on_delete: :cascade }
|
||||
t.integer :variable_type, null: false, limit: 2
|
||||
t.timestamps_with_timezone null: false
|
||||
t.text :key, null: false, limit: 255
|
||||
t.binary :encrypted_value, null: false
|
||||
t.binary :encrypted_value_iv, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPersonalAccessTokenIdToWorkspaces < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
INDEX_NAME = "index_workspaces_on_personal_access_token_id"
|
||||
|
||||
def up
|
||||
with_lock_retries do
|
||||
add_column :workspaces, :personal_access_token_id, :bigint
|
||||
end
|
||||
|
||||
add_concurrent_index :workspaces, :personal_access_token_id, name: INDEX_NAME
|
||||
|
||||
# Personal Access Tokens are revokable and are soft deleted, so the record should never actually be deleted.
|
||||
# Therefore, `restrict` is the appropriate choice, because if a record ever is attempted to be deleted
|
||||
# outside of Rails, this should be prevented, because `nullify` would result in an invalid state for the workspace,
|
||||
# and `cascade` would delete the workspace.
|
||||
add_concurrent_foreign_key :workspaces,
|
||||
:personal_access_tokens,
|
||||
column: :personal_access_token_id,
|
||||
on_delete: :restrict
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index_by_name :workspaces, INDEX_NAME
|
||||
remove_foreign_key_if_exists :workspaces, column: :personal_access_tokens
|
||||
|
||||
with_lock_retries do
|
||||
remove_column :workspaces, :personal_access_token_id, if_exists: true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddConfigVersionToWorkspaces < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
add_column :workspaces, :config_version, :integer, default: 1, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddMrRequiresSamlAuthForApprovalToGroupMrApprovalSettings < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
add_column(
|
||||
:group_merge_request_approval_settings,
|
||||
:require_saml_auth_to_approve,
|
||||
:boolean,
|
||||
default: false,
|
||||
null: false
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoveCrlNull < Gitlab::Database::Migration[2.1]
|
||||
def up
|
||||
change_column_null :x509_certificates, :subject, true
|
||||
change_column_null :x509_issuers, :subject, true
|
||||
change_column_null :x509_issuers, :crl_url, true
|
||||
end
|
||||
|
||||
def down
|
||||
change_column_null :x509_certificates, :subject, false
|
||||
change_column_null :x509_issuers, :subject, false
|
||||
change_column_null :x509_issuers, :crl_url, false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreatePackagesNugetSymbols < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
create_table :packages_nuget_symbols do |t|
|
||||
t.timestamps_with_timezone null: false
|
||||
|
||||
t.references :package,
|
||||
foreign_key: { to_table: :packages_packages, on_delete: :nullify },
|
||||
index: true,
|
||||
type: :bigint
|
||||
t.integer :size, null: false
|
||||
t.integer :file_store, default: 1, limit: 2
|
||||
t.text :file, null: false, limit: 255
|
||||
t.text :file_path, null: false, limit: 255
|
||||
t.text :signature, null: false, limit: 255
|
||||
t.text :object_storage_key, null: false, limit: 255, index: { unique: true }
|
||||
|
||||
t.index [:signature, :file_path], unique: true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddOrganizationIdToProject < Gitlab::Database::Migration[2.1]
|
||||
DEFAULT_ORGANIZATION_ID = 1
|
||||
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :projects, :organization_id, :bigint, default: DEFAULT_ORGANIZATION_ID, null: true # rubocop:disable Migration/AddColumnsToWideTables
|
||||
end
|
||||
end
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoveFreeUserCapEmailWorkers < Gitlab::Database::Migration[2.1]
|
||||
DEPRECATED_JOB_CLASSES = %w[
|
||||
Namespaces::FreeUserCap::BackfillNotificationClearingJobsWorker
|
||||
Namespaces::FreeUserCap::BackfillNotificationJobsWorker
|
||||
Namespaces::FreeUserCap::NotificationClearingWorker
|
||||
Namespaces::FreeUserCap::OverLimitNotificationWorker
|
||||
]
|
||||
disable_ddl_transaction!
|
||||
def up
|
||||
sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES)
|
||||
end
|
||||
|
||||
def down
|
||||
# This migration removes any instances of deprecated workers and cannot be undone.
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddOkrReminderFieldsToWorkItemProgresses < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
add_column :work_item_progresses, :reminder_frequency, :integer, limit: 2, null: false, default: 0
|
||||
end
|
||||
end
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateInstanceGoogleCloudLoggingConfigurations < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
UNIQUE_INDEX_NAME = "unique_instance_google_cloud_logging_configurations"
|
||||
UNIQUE_CONFIG_NAME_INDEX = "unique_instance_google_cloud_logging_configurations_name"
|
||||
|
||||
def change
|
||||
create_table :audit_events_instance_google_cloud_logging_configurations do |t|
|
||||
t.timestamps_with_timezone null: false
|
||||
t.text :google_project_id_name, null: false, limit: 30
|
||||
t.text :client_email, null: false, limit: 254
|
||||
t.text :log_id_name, default: "audit_events", limit: 511
|
||||
t.text :name, null: false, limit: 72
|
||||
t.binary :encrypted_private_key, null: false
|
||||
t.binary :encrypted_private_key_iv, null: false
|
||||
|
||||
t.index [:google_project_id_name, :log_id_name], unique: true, name: UNIQUE_INDEX_NAME
|
||||
t.index :name, unique: true, name: UNIQUE_CONFIG_NAME_INDEX
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPatchIdShaOnApprovals < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def up
|
||||
add_column :approvals, :patch_id_sha, :binary
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :approvals, :patch_id_sha
|
||||
end
|
||||
end
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddFindingIdToVulnerabilities < Gitlab::Database::Migration[2.1]
|
||||
def up
|
||||
add_column :vulnerabilities, :finding_id, :bigint, if_not_exists: true
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :vulnerabilities, :finding_id
|
||||
end
|
||||
end
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MakeFindingIdOnVulnerabilitiesInvalidForeignKey < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_concurrent_foreign_key :vulnerabilities, :vulnerability_occurrences,
|
||||
column: :finding_id, on_delete: :cascade, validate: false
|
||||
end
|
||||
|
||||
def down
|
||||
remove_foreign_key_if_exists :vulnerabilities, column: :finding_id
|
||||
end
|
||||
end
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ExtendPushRulesRegexLimits < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
REGEX_COLUMNS = %i[
|
||||
force_push_regex
|
||||
delete_branch_regex
|
||||
commit_message_regex
|
||||
author_email_regex
|
||||
file_name_regex
|
||||
branch_name_regex
|
||||
].freeze
|
||||
|
||||
LONG_REGEX_COLUMNS = %i[commit_message_negative_regex]
|
||||
|
||||
def up
|
||||
REGEX_COLUMNS.each do |column_name|
|
||||
add_check_constraint :push_rules, "char_length(#{column_name}) <= 511", "#{column_name}_size_constraint",
|
||||
validate: false
|
||||
end
|
||||
|
||||
LONG_REGEX_COLUMNS.each do |column_name|
|
||||
next unless column_exists?(:push_rules, column_name)
|
||||
|
||||
add_check_constraint :push_rules, "char_length(#{column_name}) <= 2047", "#{column_name}_size_constraint",
|
||||
validate: false
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
REGEX_COLUMNS.each do |column_name|
|
||||
remove_check_constraint :push_rules, "#{column_name}_size_constraint"
|
||||
end
|
||||
|
||||
LONG_REGEX_COLUMNS.each do |column_name|
|
||||
next unless column_exists?(:push_rules, column_name)
|
||||
|
||||
remove_check_constraint :push_rules, "#{column_name}_size_constraint"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddSearchRateLimitAllowlistToApplicationSettings < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
add_column :application_settings, :search_rate_limit_allowlist, :text, array: true, default: [], null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ValidatePushRulesConstraints < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
REGEX_COLUMNS = %i[
|
||||
force_push_regex
|
||||
delete_branch_regex
|
||||
commit_message_regex
|
||||
commit_message_negative_regex
|
||||
author_email_regex
|
||||
file_name_regex
|
||||
branch_name_regex
|
||||
].freeze
|
||||
|
||||
def up
|
||||
REGEX_COLUMNS.each do |column_name|
|
||||
next unless column_exists?(:push_rules, column_name)
|
||||
|
||||
validate_check_constraint :push_rules, "#{column_name}_size_constraint"
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
# No op
|
||||
end
|
||||
end
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemovePushRulesRegexLimits < Gitlab::Database::Migration[2.1]
|
||||
def up
|
||||
change_column :push_rules, :force_push_regex, :string, limit: nil
|
||||
change_column :push_rules, :delete_branch_regex, :string, limit: nil
|
||||
change_column :push_rules, :commit_message_regex, :string, limit: nil
|
||||
change_column :push_rules, :author_email_regex, :string, limit: nil
|
||||
change_column :push_rules, :file_name_regex, :string, limit: nil
|
||||
change_column :push_rules, :branch_name_regex, :string, limit: nil
|
||||
|
||||
return unless column_exists?(:push_rules, :commit_message_negative_regex)
|
||||
|
||||
change_column :push_rules, :commit_message_negative_regex, :string, limit: nil
|
||||
end
|
||||
|
||||
def down
|
||||
# No op
|
||||
end
|
||||
end
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddApprovalSettingsToScanResultPolicies < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :scan_result_policies, :project_approval_settings, :jsonb, default: {}, null: false
|
||||
add_column :scan_result_policies, :commits, :smallint
|
||||
end
|
||||
end
|
||||
|
|
@ -1,211 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class UpdateVulnerabilityReadsTriggerToSetHasMergeRequest < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def up
|
||||
execute(<<~SQL)
|
||||
CREATE OR REPLACE FUNCTION insert_or_update_vulnerability_reads()
|
||||
RETURNS trigger
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
DECLARE
|
||||
severity smallint;
|
||||
state smallint;
|
||||
report_type smallint;
|
||||
resolved_on_default_branch boolean;
|
||||
present_on_default_branch boolean;
|
||||
namespace_id bigint;
|
||||
has_issues boolean;
|
||||
has_merge_request boolean;
|
||||
BEGIN
|
||||
IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN
|
||||
RETURN NULL;
|
||||
END IF;
|
||||
|
||||
IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN
|
||||
RETURN NULL;
|
||||
END IF;
|
||||
|
||||
SELECT
|
||||
vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch, vulnerabilities.present_on_default_branch
|
||||
INTO
|
||||
severity, state, report_type, resolved_on_default_branch, present_on_default_branch
|
||||
FROM
|
||||
vulnerabilities
|
||||
WHERE
|
||||
vulnerabilities.id = NEW.vulnerability_id;
|
||||
|
||||
IF present_on_default_branch IS NOT true THEN
|
||||
RETURN NULL;
|
||||
END IF;
|
||||
|
||||
SELECT
|
||||
projects.namespace_id
|
||||
INTO
|
||||
namespace_id
|
||||
FROM
|
||||
projects
|
||||
WHERE
|
||||
projects.id = NEW.project_id;
|
||||
|
||||
SELECT
|
||||
EXISTS (SELECT 1 FROM vulnerability_issue_links WHERE vulnerability_issue_links.vulnerability_id = NEW.vulnerability_id)
|
||||
INTO
|
||||
has_issues;
|
||||
|
||||
SELECT
|
||||
EXISTS (SELECT 1 FROM vulnerability_merge_request_links WHERE vulnerability_merge_request_links.vulnerability_id = NEW.vulnerability_id)
|
||||
INTO
|
||||
has_merge_request;
|
||||
|
||||
INSERT INTO vulnerability_reads (vulnerability_id, namespace_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id, casted_cluster_agent_id, has_issues, has_merge_request)
|
||||
VALUES (NEW.vulnerability_id, namespace_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id', CAST(NEW.location->'kubernetes_resource'->>'agent_id' AS bigint), has_issues, has_merge_request)
|
||||
ON CONFLICT(vulnerability_id) DO NOTHING;
|
||||
RETURN NULL;
|
||||
END
|
||||
$$
|
||||
SQL
|
||||
|
||||
execute(<<~SQL)
|
||||
CREATE OR REPLACE FUNCTION insert_vulnerability_reads_from_vulnerability()
|
||||
RETURNS trigger
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
DECLARE
|
||||
scanner_id bigint;
|
||||
uuid uuid;
|
||||
location_image text;
|
||||
cluster_agent_id text;
|
||||
casted_cluster_agent_id bigint;
|
||||
namespace_id bigint;
|
||||
has_issues boolean;
|
||||
has_merge_request boolean;
|
||||
BEGIN
|
||||
SELECT
|
||||
v_o.scanner_id, v_o.uuid, v_o.location->>'image', v_o.location->'kubernetes_resource'->>'agent_id', CAST(v_o.location->'kubernetes_resource'->>'agent_id' AS bigint), projects.namespace_id
|
||||
INTO
|
||||
scanner_id, uuid, location_image, cluster_agent_id, casted_cluster_agent_id, namespace_id
|
||||
FROM
|
||||
vulnerability_occurrences v_o
|
||||
INNER JOIN projects ON projects.id = v_o.project_id
|
||||
WHERE
|
||||
v_o.vulnerability_id = NEW.id
|
||||
LIMIT 1;
|
||||
|
||||
SELECT
|
||||
EXISTS (SELECT 1 FROM vulnerability_issue_links WHERE vulnerability_issue_links.vulnerability_id = NEW.id)
|
||||
INTO
|
||||
has_issues;
|
||||
|
||||
SELECT
|
||||
EXISTS (SELECT 1 FROM vulnerability_merge_request_links WHERE vulnerability_merge_request_links.vulnerability_id = NEW.id)
|
||||
INTO
|
||||
has_merge_request;
|
||||
|
||||
INSERT INTO vulnerability_reads (vulnerability_id, namespace_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id, casted_cluster_agent_id, has_issues, has_merge_request)
|
||||
VALUES (NEW.id, namespace_id, NEW.project_id, scanner_id, NEW.report_type, NEW.severity, NEW.state, NEW.resolved_on_default_branch, uuid::uuid, location_image, cluster_agent_id, casted_cluster_agent_id, has_issues, has_merge_request)
|
||||
ON CONFLICT(vulnerability_id) DO NOTHING;
|
||||
RETURN NULL;
|
||||
END
|
||||
$$
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
execute(<<~SQL)
|
||||
CREATE OR REPLACE FUNCTION insert_or_update_vulnerability_reads()
|
||||
RETURNS trigger
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
DECLARE
|
||||
severity smallint;
|
||||
state smallint;
|
||||
report_type smallint;
|
||||
resolved_on_default_branch boolean;
|
||||
present_on_default_branch boolean;
|
||||
namespace_id bigint;
|
||||
has_issues boolean;
|
||||
BEGIN
|
||||
IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN
|
||||
RETURN NULL;
|
||||
END IF;
|
||||
|
||||
IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN
|
||||
RETURN NULL;
|
||||
END IF;
|
||||
|
||||
SELECT
|
||||
vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch, vulnerabilities.present_on_default_branch
|
||||
INTO
|
||||
severity, state, report_type, resolved_on_default_branch, present_on_default_branch
|
||||
FROM
|
||||
vulnerabilities
|
||||
WHERE
|
||||
vulnerabilities.id = NEW.vulnerability_id;
|
||||
|
||||
IF present_on_default_branch IS NOT true THEN
|
||||
RETURN NULL;
|
||||
END IF;
|
||||
|
||||
SELECT
|
||||
projects.namespace_id
|
||||
INTO
|
||||
namespace_id
|
||||
FROM
|
||||
projects
|
||||
WHERE
|
||||
projects.id = NEW.project_id;
|
||||
|
||||
SELECT
|
||||
EXISTS (SELECT 1 FROM vulnerability_issue_links WHERE vulnerability_issue_links.vulnerability_id = NEW.vulnerability_id)
|
||||
INTO
|
||||
has_issues;
|
||||
|
||||
INSERT INTO vulnerability_reads (vulnerability_id, namespace_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id, casted_cluster_agent_id, has_issues)
|
||||
VALUES (NEW.vulnerability_id, namespace_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id', CAST(NEW.location->'kubernetes_resource'->>'agent_id' AS bigint), has_issues)
|
||||
ON CONFLICT(vulnerability_id) DO NOTHING;
|
||||
RETURN NULL;
|
||||
END
|
||||
$$
|
||||
SQL
|
||||
|
||||
execute(<<~SQL)
|
||||
CREATE OR REPLACE FUNCTION insert_vulnerability_reads_from_vulnerability()
|
||||
RETURNS trigger
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
DECLARE
|
||||
scanner_id bigint;
|
||||
uuid uuid;
|
||||
location_image text;
|
||||
cluster_agent_id text;
|
||||
casted_cluster_agent_id bigint;
|
||||
namespace_id bigint;
|
||||
has_issues boolean;
|
||||
BEGIN
|
||||
SELECT
|
||||
v_o.scanner_id, v_o.uuid, v_o.location->>'image', v_o.location->'kubernetes_resource'->>'agent_id', CAST(v_o.location->'kubernetes_resource'->>'agent_id' AS bigint), projects.namespace_id
|
||||
INTO
|
||||
scanner_id, uuid, location_image, cluster_agent_id, casted_cluster_agent_id, namespace_id
|
||||
FROM
|
||||
vulnerability_occurrences v_o
|
||||
INNER JOIN projects ON projects.id = v_o.project_id
|
||||
WHERE
|
||||
v_o.vulnerability_id = NEW.id
|
||||
LIMIT 1;
|
||||
|
||||
SELECT
|
||||
EXISTS (SELECT 1 FROM vulnerability_issue_links WHERE vulnerability_issue_links.vulnerability_id = NEW.id)
|
||||
INTO
|
||||
has_issues;
|
||||
|
||||
INSERT INTO vulnerability_reads (vulnerability_id, namespace_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id, casted_cluster_agent_id, has_issues)
|
||||
VALUES (NEW.id, namespace_id, NEW.project_id, scanner_id, NEW.report_type, NEW.severity, NEW.state, NEW.resolved_on_default_branch, uuid::uuid, location_image, cluster_agent_id, casted_cluster_agent_id, has_issues)
|
||||
ON CONFLICT(vulnerability_id) DO NOTHING;
|
||||
RETURN NULL;
|
||||
END
|
||||
$$
|
||||
SQL
|
||||
end
|
||||
end
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreatePackagesProtectionRules < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
create_table :packages_protection_rules do |t|
|
||||
t.references :project, null: false, index: false, foreign_key: { on_delete: :cascade }
|
||||
t.timestamps_with_timezone null: false
|
||||
t.integer :push_protected_up_to_access_level, null: false
|
||||
t.integer :package_type, limit: 2, null: false
|
||||
t.text :package_name_pattern, limit: 255, null: false
|
||||
|
||||
t.index [:project_id, :package_type, :package_name_pattern], unique: true,
|
||||
name: :i_packages_unique_project_id_package_type_package_name_pattern
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddForeignKeyForCiPipelineChatDataForPipelineIdBigint < Gitlab::Database::Migration[2.1]
|
||||
TABLE_NAME = :ci_pipeline_chat_data
|
||||
REFERENCING_TABLE_NAME = :ci_pipelines
|
||||
COLUMN_NAME = :pipeline_id_convert_to_bigint
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_concurrent_foreign_key(
|
||||
TABLE_NAME, REFERENCING_TABLE_NAME,
|
||||
column: COLUMN_NAME, on_delete: :cascade, reverse_lock_order: true
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
remove_foreign_key_if_exists TABLE_NAME, column: COLUMN_NAME
|
||||
end
|
||||
end
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddForeignKeyForCiPipelineMessagesPipelineIdBigint < Gitlab::Database::Migration[2.1]
|
||||
TABLE_NAME = :ci_pipeline_messages
|
||||
REFERENCING_TABLE_NAME = :ci_pipelines
|
||||
COLUMN_NAME = :pipeline_id_convert_to_bigint
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_concurrent_foreign_key(
|
||||
TABLE_NAME, REFERENCING_TABLE_NAME,
|
||||
column: COLUMN_NAME, on_delete: :cascade, validate: false, reverse_lock_order: true
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
remove_foreign_key_if_exists TABLE_NAME, column: COLUMN_NAME
|
||||
end
|
||||
end
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateProjectsVisitsTables < Gitlab::Database::Migration[2.1]
|
||||
def up
|
||||
create_table :projects_visits, primary_key: [:id, :visited_at],
|
||||
options: 'PARTITION BY RANGE (visited_at)' do |t|
|
||||
t.bigserial :id, null: false
|
||||
t.bigint :entity_id, null: false, index: true
|
||||
t.bigint :user_id, null: false
|
||||
t.datetime_with_timezone :visited_at, null: false
|
||||
end
|
||||
|
||||
add_index(:projects_visits, [:user_id, :entity_id, :visited_at])
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :projects_visits
|
||||
end
|
||||
end
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateGroupsVisitsTables < Gitlab::Database::Migration[2.1]
|
||||
def up
|
||||
create_table :groups_visits, primary_key: [:id, :visited_at],
|
||||
options: 'PARTITION BY RANGE (visited_at)' do |t|
|
||||
t.bigserial :id, null: false
|
||||
t.bigint :entity_id, null: false, index: true
|
||||
t.bigint :user_id, null: false
|
||||
t.datetime_with_timezone :visited_at, null: false
|
||||
end
|
||||
|
||||
add_index(:groups_visits, [:user_id, :entity_id, :visited_at])
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :groups_visits
|
||||
end
|
||||
end
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateAuditEventsAmazonS3Configurations < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
UNIQUE_NAME = "unique_amazon_s3_configurations_namespace_id_and_name"
|
||||
UNIQUE_BUCKET_NAME = "unique_amazon_s3_configurations_namespace_id_and_bucket_name"
|
||||
|
||||
def change
|
||||
create_table :audit_events_amazon_s3_configurations do |t|
|
||||
t.timestamps_with_timezone null: false
|
||||
t.references :namespace, index: false, null: false, foreign_key: { on_delete: :cascade }
|
||||
t.text :access_key_xid, null: false, limit: 128
|
||||
t.text :name, null: false, limit: 72
|
||||
t.text :bucket_name, null: false, limit: 63
|
||||
t.text :aws_region, null: false, limit: 50
|
||||
t.binary :encrypted_secret_access_key, null: false
|
||||
t.binary :encrypted_secret_access_key_iv, null: false
|
||||
|
||||
t.index [:namespace_id, :name], unique: true, name: UNIQUE_NAME
|
||||
t.index [:namespace_id, :bucket_name], unique: true, name: UNIQUE_BUCKET_NAME
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddMetadataColumnsToPackagesPyPiMetadata < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
with_lock_retries do
|
||||
add_column :packages_pypi_metadata, :metadata_version, :text, null: true, if_not_exists: true
|
||||
add_column :packages_pypi_metadata, :summary, :text, null: true, if_not_exists: true
|
||||
add_column :packages_pypi_metadata, :keywords, :text, null: true, if_not_exists: true
|
||||
add_column :packages_pypi_metadata, :author_email, :text, null: true, if_not_exists: true
|
||||
add_column :packages_pypi_metadata, :description, :text, null: true, if_not_exists: true
|
||||
add_column :packages_pypi_metadata, :description_content_type, :text, null: true, if_not_exists: true
|
||||
end
|
||||
|
||||
add_text_limit :packages_pypi_metadata, :metadata_version, 16
|
||||
add_text_limit :packages_pypi_metadata, :summary, 255
|
||||
add_text_limit :packages_pypi_metadata, :keywords, 255
|
||||
add_text_limit :packages_pypi_metadata, :author_email, 2048
|
||||
add_text_limit :packages_pypi_metadata, :description, 4000
|
||||
add_text_limit :packages_pypi_metadata, :description_content_type, 128
|
||||
end
|
||||
|
||||
def down
|
||||
with_lock_retries do
|
||||
remove_column :packages_pypi_metadata, :metadata_version, if_exists: true
|
||||
remove_column :packages_pypi_metadata, :summary, if_exists: true
|
||||
remove_column :packages_pypi_metadata, :keywords, if_exists: true
|
||||
remove_column :packages_pypi_metadata, :author_email, if_exists: true
|
||||
remove_column :packages_pypi_metadata, :description, if_exists: true
|
||||
remove_column :packages_pypi_metadata, :description_content_type, if_exists: true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddAuditEventsAmazonS3ConfigurationLimitToPlanLimits < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
add_column(:plan_limits, :audit_events_amazon_s3_configurations, :integer, default: 5, null: false)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ReplaceSbomOccurrencesComponentIdIndex < Gitlab::Database::Migration[2.1]
|
||||
REMOVED_INDEX_NAME = "index_sbom_occurrences_on_component_id"
|
||||
ADDED_INDEX_NAME = "index_sbom_occurrences_on_component_id_and_id"
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
# rubocop:disable Migration/PreventIndexCreation -- Legacy migration
|
||||
def up
|
||||
add_concurrent_index :sbom_occurrences, %i[component_id id], name: ADDED_INDEX_NAME
|
||||
remove_concurrent_index_by_name :sbom_occurrences, name: REMOVED_INDEX_NAME
|
||||
end
|
||||
# rubocop:enable Migration/PreventIndexCreation
|
||||
|
||||
def down
|
||||
add_concurrent_index :sbom_occurrences, :component_id, name: REMOVED_INDEX_NAME
|
||||
remove_concurrent_index_by_name :sbom_occurrences, name: ADDED_INDEX_NAME
|
||||
end
|
||||
end
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddMarkdownFieldsToReviewLlmSummary < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
# rubocop:disable Migration/AddLimitToTextColumns
|
||||
add_column :merge_request_review_llm_summaries,
|
||||
:cached_markdown_version,
|
||||
:integer,
|
||||
null: true
|
||||
add_column :merge_request_review_llm_summaries,
|
||||
:content_html,
|
||||
:text,
|
||||
null: true
|
||||
# rubocop:enable Migration/AddLimitToTextColumns
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :merge_request_review_llm_summaries, :cached_markdown_version
|
||||
remove_column :merge_request_review_llm_summaries, :content_html
|
||||
end
|
||||
end
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RestartSelfHostedSentNotificationsBigintConversion < Gitlab::Database::Migration[2.1]
|
||||
include Gitlab::Database::MigrationHelpers::ConvertToBigint
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
TABLE = :sent_notifications
|
||||
COLUMNS = %i[id]
|
||||
|
||||
def up
|
||||
return if should_skip? || id_is_bigint? || id_convert_to_bigint_exist?
|
||||
|
||||
initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
|
||||
end
|
||||
|
||||
def down
|
||||
return if should_skip? || id_is_bigint?
|
||||
|
||||
revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
|
||||
end
|
||||
|
||||
def should_skip?
|
||||
com_or_dev_or_test_but_not_jh?
|
||||
end
|
||||
|
||||
def id_is_bigint?
|
||||
table_columns = columns(TABLE)
|
||||
column_id = table_columns.find { |c| c.name == 'id' }
|
||||
column_id.sql_type == 'bigint'
|
||||
end
|
||||
|
||||
def id_convert_to_bigint_exist?
|
||||
column_exists?(TABLE.to_s, 'id_convert_to_bigint')
|
||||
end
|
||||
end
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RestartSelfHostedSentNotificationsBackfill < Gitlab::Database::Migration[2.1]
|
||||
include Gitlab::Database::MigrationHelpers::ConvertToBigint
|
||||
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
|
||||
TABLE = :sent_notifications
|
||||
COLUMNS = %i[id]
|
||||
|
||||
def up
|
||||
return if should_skip? || id_is_bigint? || already_backfilled?
|
||||
|
||||
# rubocop: disable Migration/BatchMigrationsPostOnly
|
||||
delete_batched_background_migration(
|
||||
'CopyColumnUsingBackgroundMigrationJob',
|
||||
:sent_notifications,
|
||||
:id,
|
||||
[["id"], ["id_convert_to_bigint"]]
|
||||
)
|
||||
# rubocop: enable Migration/BatchMigrationsPostOnly
|
||||
|
||||
backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
|
||||
end
|
||||
|
||||
def down
|
||||
return if should_skip? || id_is_bigint? || already_backfilled?
|
||||
|
||||
revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
|
||||
end
|
||||
|
||||
def should_skip?
|
||||
com_or_dev_or_test_but_not_jh?
|
||||
end
|
||||
|
||||
def id_is_bigint?
|
||||
table_columns = columns(TABLE)
|
||||
column_id = table_columns.find { |c| c.name == 'id' }
|
||||
column_id.sql_type == 'bigint'
|
||||
end
|
||||
|
||||
def already_backfilled?
|
||||
res = connection.execute <<~SQL
|
||||
SELECT
|
||||
id_convert_to_bigint
|
||||
FROM
|
||||
sent_notifications
|
||||
ORDER BY
|
||||
id ASC
|
||||
LIMIT 1
|
||||
SQL
|
||||
return false if res.ntuples == 0
|
||||
|
||||
res.first['id_convert_to_bigint'].to_i != 0
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddForceFullReconciliationToWorkspaces < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :workspaces, :force_full_reconciliation, :boolean, default: false, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddContinuousVulnScansToggleToSecurityProjectSettings < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
TABLE_NAME = :project_security_settings
|
||||
COLUMN_NAME = :continuous_vulnerability_scans_enabled
|
||||
|
||||
def up
|
||||
add_column TABLE_NAME, COLUMN_NAME, :boolean, null: false,
|
||||
default: false
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column TABLE_NAME, COLUMN_NAME
|
||||
end
|
||||
end
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddRootNamespaceIdToProjectStatistics < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
INDEX_NAME = "index_project_statistics_on_root_namespace_id"
|
||||
|
||||
# rubocop:disable Migration/PreventIndexCreation -- Legacy migration
|
||||
def up
|
||||
unless column_exists?(:project_statistics, :root_namespace_id)
|
||||
add_column :project_statistics, :root_namespace_id, :bigint
|
||||
end
|
||||
|
||||
add_concurrent_foreign_key :project_statistics, :namespaces,
|
||||
column: :root_namespace_id,
|
||||
on_delete: :nullify
|
||||
|
||||
add_concurrent_index :project_statistics, :root_namespace_id, name: INDEX_NAME
|
||||
end
|
||||
# rubocop:enable Migration/PreventIndexCreation
|
||||
|
||||
def down
|
||||
return unless column_exists?(:project_statistics, :root_namespace_id)
|
||||
|
||||
remove_column :project_statistics, :root_namespace_id, :bigint
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddDeletedAtToPagesDeployments < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
add_column :pages_deployments, :deleted_at, :datetime_with_timezone, null: true
|
||||
end
|
||||
end
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPagesDeploymentsDeletedAtIndex < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
INDEX = 'pages_deployments_deleted_at_index'
|
||||
COLUMNS = [:id, :project_id, :path_prefix]
|
||||
|
||||
def up
|
||||
add_concurrent_index :pages_deployments,
|
||||
COLUMNS,
|
||||
where: 'deleted_at IS NULL',
|
||||
name: INDEX
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index :pages_deployments, COLUMNS, name: INDEX
|
||||
end
|
||||
end
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ChangeGeoNodeStatusesLastEventIdIntegerToBigInt < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
with_lock_retries do
|
||||
execute "ALTER TABLE geo_node_statuses ALTER COLUMN last_event_id TYPE bigint;"
|
||||
end
|
||||
|
||||
execute "ANALYZE geo_node_statuses;"
|
||||
end
|
||||
|
||||
def down
|
||||
with_lock_retries do
|
||||
execute "ALTER TABLE geo_node_statuses ALTER COLUMN last_event_id TYPE integer;"
|
||||
end
|
||||
|
||||
execute "ANALYZE geo_node_statuses;"
|
||||
end
|
||||
end
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ChangeGeoNodeStatusesCursorLastEventIdIntegerToBigInt < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
with_lock_retries do
|
||||
execute "ALTER TABLE geo_node_statuses ALTER COLUMN cursor_last_event_id TYPE bigint;"
|
||||
end
|
||||
|
||||
execute "ANALYZE geo_node_statuses;"
|
||||
end
|
||||
|
||||
def down
|
||||
with_lock_retries do
|
||||
execute "ALTER TABLE geo_node_statuses ALTER COLUMN cursor_last_event_id TYPE integer;"
|
||||
end
|
||||
|
||||
execute "ANALYZE geo_node_statuses;"
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddKeyboardShortcutsToggleToUserPreferences < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :user_preferences, :keyboard_shortcuts_enabled, :boolean, default: true, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddMergeImmediatelyToCiCdSettings < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def up
|
||||
add_column :project_ci_cd_settings, :merge_trains_skip_train_allowed, :boolean, default: false, null: false
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :project_ci_cd_settings, :merge_trains_skip_train_allowed
|
||||
end
|
||||
end
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddCurrentUserTodosWidgetToEpicWorkItemType < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
|
||||
EPIC_ENUM_VALUE = 7
|
||||
WIDGET_NAME = 'Current user todos'
|
||||
WIDGET_ENUM_VALUE = 15
|
||||
|
||||
class MigrationWorkItemType < MigrationRecord
|
||||
self.table_name = 'work_item_types'
|
||||
end
|
||||
|
||||
class MigrationWidgetDefinition < MigrationRecord
|
||||
self.table_name = 'work_item_widget_definitions'
|
||||
end
|
||||
|
||||
def up
|
||||
epic_work_item_type = MigrationWorkItemType.find_by(base_type: EPIC_ENUM_VALUE, namespace_id: nil)
|
||||
|
||||
# Epic type should exist in production applications, checking here to avoid failures
|
||||
# if inconsistent data is present.
|
||||
return say('Epic work item type does not exist, skipping widget creation') unless epic_work_item_type
|
||||
|
||||
widgets = [
|
||||
{
|
||||
work_item_type_id: epic_work_item_type.id,
|
||||
name: WIDGET_NAME,
|
||||
widget_type: WIDGET_ENUM_VALUE
|
||||
}
|
||||
]
|
||||
|
||||
MigrationWidgetDefinition.upsert_all(
|
||||
widgets,
|
||||
unique_by: :index_work_item_widget_definitions_on_default_witype_and_name
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
epic_work_item_type = MigrationWorkItemType.find_by(base_type: EPIC_ENUM_VALUE, namespace_id: nil)
|
||||
|
||||
return say('Epic work item type does not exist, skipping widget removal') unless epic_work_item_type
|
||||
|
||||
widget_definition = MigrationWidgetDefinition.find_by(
|
||||
work_item_type_id: epic_work_item_type.id,
|
||||
widget_type: WIDGET_ENUM_VALUE,
|
||||
name: WIDGET_NAME,
|
||||
namespace_id: nil
|
||||
)
|
||||
|
||||
return say('Widget definition not found, skipping widget removal') unless widget_definition
|
||||
|
||||
widget_definition.destroy
|
||||
end
|
||||
end
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddUniqueIndexOnUuidConvertStringToUuid < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
INDEX_NAME = "index_vulnerability_occurrences_on_uuid_1"
|
||||
|
||||
# rubocop:disable Migration/PreventIndexCreation -- Legacy migration
|
||||
def up
|
||||
add_concurrent_index(
|
||||
:vulnerability_occurrences,
|
||||
:uuid_convert_string_to_uuid,
|
||||
unique: true,
|
||||
name: INDEX_NAME
|
||||
)
|
||||
end
|
||||
# rubocop:enable Migration/PreventIndexCreation
|
||||
|
||||
def down
|
||||
remove_concurrent_index_by_name(
|
||||
:vulnerability_occurrences,
|
||||
INDEX_NAME
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddUniqueIndexOnUuidConvertStringToUuidIncludingVulnerabilityId < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
INDEX_NAME = "index_vuln_findings_on_uuid_including_vuln_id_1"
|
||||
|
||||
def up
|
||||
execute <<~SQL
|
||||
CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS #{INDEX_NAME}
|
||||
ON vulnerability_occurrences(uuid_convert_string_to_uuid)
|
||||
INCLUDE(vulnerability_id)
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index_by_name(
|
||||
:vulnerability_occurrences,
|
||||
INDEX_NAME
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoveApplicationSettingsDashboardColumns < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
remove_column :application_settings, :dashboard_enforcement_limit, :integer, default: 0, null: false
|
||||
remove_column :application_settings, :dashboard_limit_new_namespace_creation_enforcement_date, :date
|
||||
end
|
||||
end
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class EnsureSystemNoteMetadataBigintBackfillIsFinishedForSelfManaged < Gitlab::Database::Migration[2.1]
|
||||
include Gitlab::Database::MigrationHelpers::ConvertToBigint
|
||||
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
return if com_or_dev_or_test_but_not_jh?
|
||||
|
||||
ensure_batched_background_migration_is_finished(
|
||||
job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
|
||||
table_name: 'system_note_metadata',
|
||||
column_name: 'id',
|
||||
job_arguments: [['note_id'], ['note_id_convert_to_bigint']]
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
# no-op
|
||||
end
|
||||
end
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class SwapSystemNoteMetadataNoteIdToBigintForSelfManaged < Gitlab::Database::Migration[2.1]
|
||||
include Gitlab::Database::MigrationHelpers::ConvertToBigint
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
TABLE_NAME = 'system_note_metadata'
|
||||
|
||||
def up
|
||||
return if com_or_dev_or_test_but_not_jh?
|
||||
return if temp_column_removed?(TABLE_NAME, :note_id)
|
||||
return if columns_swapped?(TABLE_NAME, :note_id)
|
||||
|
||||
swap
|
||||
end
|
||||
|
||||
def down
|
||||
return if com_or_dev_or_test_but_not_jh?
|
||||
return if temp_column_removed?(TABLE_NAME, :note_id)
|
||||
return unless columns_swapped?(TABLE_NAME, :note_id)
|
||||
|
||||
swap
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def swap
|
||||
# This will replace the existing index_system_note_metadata_on_note_id
|
||||
add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true,
|
||||
name: 'index_system_note_metadata_on_note_id_convert_to_bigint'
|
||||
|
||||
# This will replace the existing fk_d83a918cb1
|
||||
add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint,
|
||||
name: 'fk_system_note_metadata_note_id_convert_to_bigint',
|
||||
on_delete: :cascade
|
||||
|
||||
with_lock_retries(raise_on_exhaustion: true) do
|
||||
execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
|
||||
|
||||
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp"
|
||||
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id"
|
||||
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint"
|
||||
|
||||
function_name = Gitlab::Database::UnidirectionalCopyTrigger
|
||||
.on_table(TABLE_NAME, connection: connection)
|
||||
.name(:note_id, :note_id_convert_to_bigint)
|
||||
execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
|
||||
|
||||
# Swap defaults
|
||||
change_column_default TABLE_NAME, :note_id, nil
|
||||
change_column_default TABLE_NAME, :note_id_convert_to_bigint, 0
|
||||
|
||||
execute 'DROP INDEX IF EXISTS index_system_note_metadata_on_note_id'
|
||||
rename_index TABLE_NAME, 'index_system_note_metadata_on_note_id_convert_to_bigint',
|
||||
'index_system_note_metadata_on_note_id'
|
||||
|
||||
execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_d83a918cb1"
|
||||
rename_constraint(TABLE_NAME, 'fk_system_note_metadata_note_id_convert_to_bigint', 'fk_d83a918cb1')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class EnsureIssueUserMentionsBigintBackfillIsFinishedForSelfManaged < Gitlab::Database::Migration[2.1]
|
||||
include Gitlab::Database::MigrationHelpers::ConvertToBigint
|
||||
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
return if com_or_dev_or_test_but_not_jh?
|
||||
|
||||
ensure_batched_background_migration_is_finished(
|
||||
job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
|
||||
table_name: 'issue_user_mentions',
|
||||
column_name: 'id',
|
||||
job_arguments: [['note_id'], ['note_id_convert_to_bigint']]
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
# no-op
|
||||
end
|
||||
end
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class SwapIssueUserMentionsNoteIdToBigintForSelfManaged < Gitlab::Database::Migration[2.1]
|
||||
include Gitlab::Database::MigrationHelpers::ConvertToBigint
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
TABLE_NAME = 'issue_user_mentions'
|
||||
|
||||
def up
|
||||
return if com_or_dev_or_test_but_not_jh?
|
||||
return if temp_column_removed?(TABLE_NAME, :note_id)
|
||||
return if columns_swapped?(TABLE_NAME, :note_id)
|
||||
|
||||
swap
|
||||
end
|
||||
|
||||
def down
|
||||
return if com_or_dev_or_test_but_not_jh?
|
||||
return if temp_column_removed?(TABLE_NAME, :note_id)
|
||||
return unless columns_swapped?(TABLE_NAME, :note_id)
|
||||
|
||||
swap
|
||||
end
|
||||
|
||||
def swap
|
||||
# This will replace the existing index_issue_user_mentions_on_note_id
|
||||
add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true,
|
||||
name: 'index_issue_user_mentions_on_note_id_convert_to_bigint',
|
||||
where: 'note_id_convert_to_bigint IS NOT NULL'
|
||||
|
||||
# This will replace the existing issue_user_mentions_on_issue_id_and_note_id_index
|
||||
add_concurrent_index TABLE_NAME, [:issue_id, :note_id_convert_to_bigint], unique: true,
|
||||
name: 'tmp_issue_user_mentions_on_issue_id_and_note_id_index'
|
||||
|
||||
# This will replace the existing issue_user_mentions_on_issue_id_index
|
||||
add_concurrent_index TABLE_NAME, :issue_id, unique: true,
|
||||
name: 'tmp_issue_user_mentions_on_issue_id_index',
|
||||
where: 'note_id_convert_to_bigint IS NULL'
|
||||
|
||||
# This will replace the existing fk_rails_3861d9fefa
|
||||
add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint,
|
||||
name: 'fk_issue_user_mentions_note_id_convert_to_bigint',
|
||||
on_delete: :cascade
|
||||
|
||||
with_lock_retries(raise_on_exhaustion: true) do
|
||||
execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
|
||||
|
||||
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp"
|
||||
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id"
|
||||
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint"
|
||||
|
||||
function_name = Gitlab::Database::UnidirectionalCopyTrigger
|
||||
.on_table(TABLE_NAME, connection: connection)
|
||||
.name(:note_id, :note_id_convert_to_bigint)
|
||||
execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
|
||||
|
||||
execute 'DROP INDEX IF EXISTS index_issue_user_mentions_on_note_id'
|
||||
rename_index TABLE_NAME, 'index_issue_user_mentions_on_note_id_convert_to_bigint',
|
||||
'index_issue_user_mentions_on_note_id'
|
||||
|
||||
execute 'DROP INDEX IF EXISTS issue_user_mentions_on_issue_id_and_note_id_index'
|
||||
rename_index TABLE_NAME, 'tmp_issue_user_mentions_on_issue_id_and_note_id_index',
|
||||
'issue_user_mentions_on_issue_id_and_note_id_index'
|
||||
|
||||
execute 'DROP INDEX IF EXISTS issue_user_mentions_on_issue_id_index'
|
||||
rename_index TABLE_NAME, 'tmp_issue_user_mentions_on_issue_id_index',
|
||||
'issue_user_mentions_on_issue_id_index'
|
||||
|
||||
execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_3861d9fefa"
|
||||
rename_constraint(TABLE_NAME, 'fk_issue_user_mentions_note_id_convert_to_bigint', 'fk_rails_3861d9fefa')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class EnsureNoteDiffFilesBigintBackfillIsFinishedForSelfHosts < Gitlab::Database::Migration[2.1]
|
||||
include Gitlab::Database::MigrationHelpers::ConvertToBigint
|
||||
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
ensure_batched_background_migration_is_finished(
|
||||
job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
|
||||
table_name: 'note_diff_files',
|
||||
column_name: 'id',
|
||||
job_arguments: [['diff_note_id'], ['diff_note_id_convert_to_bigint']]
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
# no-op
|
||||
end
|
||||
end
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class SwapNoteDiffFilesNoteIdToBigintForSelfHosts < Gitlab::Database::Migration[2.1]
|
||||
include Gitlab::Database::MigrationHelpers::ConvertToBigint
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
TABLE_NAME = 'note_diff_files'
|
||||
|
||||
def up
|
||||
return if should_skip?
|
||||
return if temp_column_removed?(TABLE_NAME, :diff_note_id)
|
||||
return if columns_swapped?(TABLE_NAME, :diff_note_id)
|
||||
|
||||
swap
|
||||
end
|
||||
|
||||
def down
|
||||
return if should_skip?
|
||||
return if temp_column_removed?(TABLE_NAME, :diff_note_id)
|
||||
return unless columns_swapped?(TABLE_NAME, :diff_note_id)
|
||||
|
||||
swap
|
||||
end
|
||||
|
||||
def swap
|
||||
# This will replace the existing index_note_diff_files_on_diff_note_id
|
||||
add_concurrent_index TABLE_NAME, :diff_note_id_convert_to_bigint, unique: true,
|
||||
name: 'index_note_diff_files_on_diff_note_id_convert_to_bigint'
|
||||
|
||||
# This will replace the existing fk_rails_3d66047aeb
|
||||
add_concurrent_foreign_key TABLE_NAME, :notes, column: :diff_note_id_convert_to_bigint,
|
||||
name: 'fk_note_diff_files_diff_note_id_convert_to_bigint',
|
||||
on_delete: :cascade
|
||||
|
||||
with_lock_retries(raise_on_exhaustion: true) do
|
||||
execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
|
||||
|
||||
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN diff_note_id TO diff_note_id_tmp"
|
||||
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN diff_note_id_convert_to_bigint TO diff_note_id"
|
||||
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN diff_note_id_tmp TO diff_note_id_convert_to_bigint"
|
||||
|
||||
function_name = Gitlab::Database::UnidirectionalCopyTrigger
|
||||
.on_table(TABLE_NAME, connection: connection)
|
||||
.name(:diff_note_id, :diff_note_id_convert_to_bigint)
|
||||
execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
|
||||
|
||||
# Swap defaults
|
||||
change_column_default TABLE_NAME, :diff_note_id, nil
|
||||
change_column_default TABLE_NAME, :diff_note_id_convert_to_bigint, 0
|
||||
|
||||
execute 'DROP INDEX IF EXISTS index_note_diff_files_on_diff_note_id'
|
||||
rename_index TABLE_NAME, 'index_note_diff_files_on_diff_note_id_convert_to_bigint',
|
||||
'index_note_diff_files_on_diff_note_id'
|
||||
|
||||
execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_3d66047aeb"
|
||||
rename_constraint(TABLE_NAME, 'fk_note_diff_files_diff_note_id_convert_to_bigint', 'fk_rails_3d66047aeb')
|
||||
end
|
||||
end
|
||||
|
||||
def should_skip?
|
||||
com_or_dev_or_test_but_not_jh?
|
||||
end
|
||||
end
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ScheduleFixingNamespaceIdsOfVulnerabilityReads < Gitlab::Database::Migration[2.1]
|
||||
MIGRATION = 'FixNamespaceIdsOfVulnerabilityReads'
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
|
||||
def up
|
||||
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
|
||||
queue_batched_background_migration(
|
||||
MIGRATION,
|
||||
:vulnerability_reads,
|
||||
:vulnerability_id,
|
||||
job_interval: 2.minutes,
|
||||
batch_size: 10_000,
|
||||
sub_batch_size: 100
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
|
||||
delete_batched_background_migration(MIGRATION, :vulnerability_reads, :vulnerability_id, [])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class QueueBackfillNugetNormalizedVersion < Gitlab::Database::Migration[2.1]
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
|
||||
MIGRATION = "BackfillNugetNormalizedVersion"
|
||||
DELAY_INTERVAL = 2.minutes
|
||||
BATCH_SIZE = 6000
|
||||
SUB_BATCH_SIZE = 250
|
||||
|
||||
def up
|
||||
queue_batched_background_migration(
|
||||
MIGRATION,
|
||||
:packages_nuget_metadata,
|
||||
:package_id,
|
||||
job_interval: DELAY_INTERVAL,
|
||||
batch_size: BATCH_SIZE,
|
||||
sub_batch_size: SUB_BATCH_SIZE
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
delete_batched_background_migration(MIGRATION, :packages_nuget_metadata, :package_id, [])
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoveApplicationSettingsDashboardNotificationLimitColumn < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
remove_column :application_settings, :dashboard_notification_limit, :integer, default: 0, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Migrate Integrations::Prometheus records to 'alert_management_http_integrations',
|
||||
# corresponding to Metrics Dashboard removal in 16.0.
|
||||
# See https://gitlab.com/gitlab-org/gitlab/-/issues/338838 for more details.
|
||||
class BackfillAlertManagementPrometheusIntegrations < Gitlab::Database::Migration[2.1]
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
disable_ddl_transaction!
|
||||
|
||||
BATCH_SIZE = 10
|
||||
|
||||
def up
|
||||
each_batch_range(:project_alerting_settings, of: BATCH_SIZE) do |min, max|
|
||||
execute <<~SQL
|
||||
INSERT INTO alert_management_http_integrations (
|
||||
project_id,
|
||||
encrypted_token,
|
||||
encrypted_token_iv,
|
||||
active,
|
||||
name,
|
||||
endpoint_identifier,
|
||||
type_identifier,
|
||||
created_at,
|
||||
updated_at
|
||||
) SELECT
|
||||
project_alerting_settings.project_id,
|
||||
project_alerting_settings.encrypted_token,
|
||||
project_alerting_settings.encrypted_token_iv,
|
||||
COALESCE(integrations.active, FALSE),
|
||||
'Prometheus',
|
||||
'legacy-prometheus',
|
||||
1, --type_identifiers { http: 0, prometheus: 1 }
|
||||
CURRENT_TIMESTAMP,
|
||||
CURRENT_TIMESTAMP
|
||||
FROM project_alerting_settings
|
||||
LEFT JOIN integrations
|
||||
ON project_alerting_settings.project_id = integrations.project_id
|
||||
AND integrations.type_new = 'Integrations::Prometheus'
|
||||
WHERE project_alerting_settings.project_id BETWEEN #{min} AND #{max}
|
||||
ON CONFLICT DO NOTHING
|
||||
SQL
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
execute <<~SQL
|
||||
DELETE FROM alert_management_http_integrations
|
||||
WHERE type_identifier = 1 --type_identifiers { http: 0, prometheus: 1 }
|
||||
AND endpoint_identifier = 'legacy-prometheus'
|
||||
SQL
|
||||
end
|
||||
end
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class QueuePopulateDenormalizedColumnsForSbomOccurrences < Gitlab::Database::Migration[2.1]
|
||||
MIGRATION = "PopulateDenormalizedColumnsForSbomOccurrences"
|
||||
DELAY_INTERVAL = 2.minutes
|
||||
BATCH_SIZE = 5_000
|
||||
SUB_BATCH_SIZE = 100
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_sec
|
||||
|
||||
def up
|
||||
queue_batched_background_migration(
|
||||
MIGRATION,
|
||||
:sbom_occurrences,
|
||||
:id,
|
||||
job_interval: DELAY_INTERVAL,
|
||||
batch_size: BATCH_SIZE,
|
||||
sub_batch_size: SUB_BATCH_SIZE
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
delete_batched_background_migration(MIGRATION, :sbom_occurrences, :id, [])
|
||||
end
|
||||
end
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RenamePlansTitlesWithLegacyPlanNames < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main_clusterwide
|
||||
|
||||
def up
|
||||
execute "UPDATE plans SET title = 'Premium' WHERE name = 'premium'"
|
||||
execute "UPDATE plans SET title = 'Ultimate' WHERE name = 'ultimate'"
|
||||
end
|
||||
|
||||
def down
|
||||
# no-op
|
||||
|
||||
# We don't know or even want to revert back to the old plan titles.
|
||||
end
|
||||
end
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class EnsureIdUniquenessForPCiBuildsV3 < Gitlab::Database::Migration[2.1]
|
||||
include Gitlab::Database::SchemaHelpers
|
||||
|
||||
enable_lock_retries!
|
||||
|
||||
TABLE_NAME = :p_ci_builds
|
||||
FUNCTION_NAME = :assign_p_ci_builds_id_value
|
||||
TRIGGER_NAME = :assign_p_ci_builds_id_trigger
|
||||
|
||||
def up
|
||||
return if trigger_exists?(:ci_builds, TRIGGER_NAME)
|
||||
|
||||
change_column_default(TABLE_NAME, :id, nil)
|
||||
|
||||
create_trigger_function(FUNCTION_NAME) do
|
||||
<<~SQL
|
||||
IF NEW."id" IS NOT NULL THEN
|
||||
RAISE WARNING 'Manually assigning ids is not allowed, the value will be ignored';
|
||||
END IF;
|
||||
NEW."id" := nextval('ci_builds_id_seq'::regclass);
|
||||
RETURN NEW;
|
||||
SQL
|
||||
end
|
||||
|
||||
Gitlab::Database::PostgresPartitionedTable.each_partition(TABLE_NAME) do |partition|
|
||||
create_trigger(partition.identifier, TRIGGER_NAME, FUNCTION_NAME, fires: 'BEFORE INSERT')
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
execute(<<~SQL.squish)
|
||||
ALTER TABLE #{TABLE_NAME}
|
||||
ALTER COLUMN id SET DEFAULT nextval('ci_builds_id_seq'::regclass);
|
||||
|
||||
DROP FUNCTION IF EXISTS #{FUNCTION_NAME} CASCADE;
|
||||
SQL
|
||||
end
|
||||
end
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class EnsureDumNoteIdBigintBackfillIsFinishedForSelfManaged < Gitlab::Database::Migration[2.1]
|
||||
include Gitlab::Database::MigrationHelpers::ConvertToBigint
|
||||
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
return if com_or_dev_or_test_but_not_jh?
|
||||
|
||||
ensure_batched_background_migration_is_finished(
|
||||
job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
|
||||
table_name: 'design_user_mentions',
|
||||
column_name: 'id',
|
||||
job_arguments: [['note_id'], ['note_id_convert_to_bigint']]
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
# no-op
|
||||
end
|
||||
end
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue