Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
055b4c04d5
commit
af7558b036
|
|
@ -36,7 +36,7 @@ db:rollback:
|
|||
- .db-job-base
|
||||
- .rails:rules:db-rollback
|
||||
script:
|
||||
- bundle exec rake db:migrate VERSION=20221111123146 # 15.7
|
||||
- bundle exec rake db:migrate VERSION=20230216060333 # 16.0 First migration
|
||||
- bundle exec rake db:migrate
|
||||
|
||||
db:rollback single-db:
|
||||
|
|
|
|||
|
|
@ -508,40 +508,6 @@ Layout/ArgumentAlignment:
|
|||
- 'config/initializers/rack_timeout.rb'
|
||||
- 'config/initializers/rest-client-hostname_override.rb'
|
||||
- 'config/initializers/zz_metrics.rb'
|
||||
- 'db/migrate/20220824082427_remove_tmp_idx_vulnerability_occurrences_on_id_and_scanner_id.rb'
|
||||
- 'db/migrate/20221103205317_create_dast_pre_scan_verification.rb'
|
||||
- 'db/migrate/20221111142921_add_hierarchy_restrictions.rb'
|
||||
- 'db/migrate/20221116160204_create_ml_experiment_metadata_and_ml_candidate_metadata.rb'
|
||||
- 'db/migrate/20221121091238_add_work_item_progress.rb'
|
||||
- 'db/migrate/20221130170433_create_dast_pre_scan_verification_step.rb'
|
||||
- 'db/migrate/20221202144210_create_achievements.rb'
|
||||
- 'db/migrate/20221207220120_create_dast_scanner_profiles_runner_tags.rb'
|
||||
- 'db/migrate/20221214201256_create_user_achievements.rb'
|
||||
- 'db/migrate/20221221134116_create_elastic_group_index_statuses.rb'
|
||||
- 'db/migrate/20221222144954_create_analytics_dashboards_configuration_pointers.rb'
|
||||
- 'db/migrate/20230106184809_create_dast_profiles_tags.rb'
|
||||
- 'db/migrate/20230109093043_create_namespaces_storage_limit_exclusions.rb'
|
||||
- 'db/migrate/20230109121313_add_runner_machines_contacted_at_index.rb'
|
||||
- 'db/migrate/20230117173433_create_project_data_transfer.rb'
|
||||
- 'db/migrate/20230123095022_create_scan_result_policies.rb'
|
||||
- 'db/migrate/20230124193917_add_index_for_protected_tag_create_access_levels.rb'
|
||||
- 'db/migrate/20230127151529_add_project_pointer_for_analytics_dashboard.rb'
|
||||
- 'db/migrate/20230127151531_change_dashboard_analytics_project_pointer_project_null.rb'
|
||||
- 'db/post_migrate/20220826152430_remove_container_repository_deprecated_geo_fields.rb'
|
||||
- 'db/post_migrate/20220826152432_remove_container_repository_updated_events.rb'
|
||||
- 'db/post_migrate/20221110190340_add_partial_legacy_open_source_license_available_project_id_index.rb'
|
||||
- 'db/post_migrate/20221114142044_delete_experiments_foreign_keys.rb'
|
||||
- 'db/post_migrate/20221116105434_remove_index_project_settings_on_legacy_open_source_license_available.rb'
|
||||
- 'db/post_migrate/20221205170310_add_index_for_active_members.rb'
|
||||
- 'db/post_migrate/20230104103748_remove_new_amount_used_column.rb'
|
||||
- 'db/post_migrate/20230104150601_prepare_builds_metadata_async_idx.rb'
|
||||
- 'db/post_migrate/20230104222514_add_foreign_key_to_builds_metadata.rb'
|
||||
- 'db/post_migrate/20230104224020_drop_vuln_reads_on_default_branch_index.rb'
|
||||
- 'db/post_migrate/20230105180002_remove_new_amount_used_column_on_ci_namespace_monthly_usages.rb'
|
||||
- 'db/post_migrate/20230119123908_add_temporary_size_index_to_package_files.rb'
|
||||
- 'db/post_migrate/20230123095023_add_scan_result_policy_id_to_software_license_policies.rb'
|
||||
- 'db/post_migrate/20230124104310_prepare_web_hook_logs_id_created_at_async_index.rb'
|
||||
- 'db/post_migrate/20230130070623_add_index_on_packages_package_file_file_name.rb'
|
||||
- 'ee/app/components/namespaces/free_user_cap/base_alert_component.rb'
|
||||
- 'ee/app/components/namespaces/free_user_cap/enforcement_at_limit_alert_component.rb'
|
||||
- 'ee/app/graphql/ee/mutations/alert_management/http_integration/create.rb'
|
||||
|
|
|
|||
|
|
@ -127,16 +127,6 @@ Layout/EmptyLineAfterMagicComment:
|
|||
- 'danger/ce_ee_vue_templates/Dangerfile'
|
||||
- 'danger/feature_flag/Dangerfile'
|
||||
- 'danger/pajamas/Dangerfile'
|
||||
- 'db/migrate/20221116134507_add_projects_emails_enabled_column.rb'
|
||||
- 'db/migrate/20221116134539_add_namespaces_emails_enabled_column.rb'
|
||||
- 'db/migrate/20221202202351_remove_index_i_ci_job_token_project_scope_links_on_source_and_target_project.rb'
|
||||
- 'db/migrate/20221216145659_add_pa_clickhouse_connection_string_to_application_settings.rb'
|
||||
- 'db/migrate/20221219103007_add_name_to_ml_candidates.rb'
|
||||
- 'db/migrate/20221219122320_copy_clickhouse_connection_string_to_encrypted_var.rb'
|
||||
- 'db/migrate/20230111124512_remove_tmp_index_vulns_on_report_type.rb'
|
||||
- 'db/post_migrate/20221116134611_add_namespaces_emails_enabled_column_data.rb'
|
||||
- 'db/post_migrate/20221116134633_add_projects_emails_enabled_column_data.rb'
|
||||
- 'db/post_migrate/20221210154044_update_active_billable_users_index.rb'
|
||||
- 'ee/app/controllers/concerns/epics_actions.rb'
|
||||
- 'ee/app/controllers/concerns/saml_authorization.rb'
|
||||
- 'ee/app/controllers/ee/projects/analytics/cycle_analytics/stages_controller.rb'
|
||||
|
|
|
|||
|
|
@ -76,9 +76,6 @@ Lint/RedundantCopDisableDirective:
|
|||
- 'config/initializers/wikicloth_redos_patch.rb'
|
||||
- 'config/initializers/wikicloth_ruby_3_patch.rb'
|
||||
- 'config/routes/api.rb'
|
||||
- 'db/post_migrate/20221102231131_remove_temp_index_for_user_details_fields.rb'
|
||||
- 'db/post_migrate/20230104103748_remove_new_amount_used_column.rb'
|
||||
- 'db/post_migrate/20230105180002_remove_new_amount_used_column_on_ci_namespace_monthly_usages.rb'
|
||||
- 'ee/app/controllers/ee/admin/application_settings_controller.rb'
|
||||
- 'ee/app/controllers/ee/groups/group_members_controller.rb'
|
||||
- 'ee/app/controllers/ee/projects/settings/ci_cd_controller.rb'
|
||||
|
|
@ -260,8 +257,6 @@ Lint/RedundantCopDisableDirective:
|
|||
- 'spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb'
|
||||
- 'spec/lib/gitlab/sidekiq_middleware/size_limiter/server_spec.rb'
|
||||
- 'spec/metrics_server/metrics_server_spec.rb'
|
||||
- 'spec/migrations/add_namespaces_emails_enabled_column_data_spec.rb'
|
||||
- 'spec/migrations/add_projects_emails_enabled_column_data_spec.rb'
|
||||
- 'spec/models/ci/build_trace_chunk_spec.rb'
|
||||
- 'spec/models/ci/pipeline_spec.rb'
|
||||
- 'spec/models/concerns/encrypted_user_password_spec.rb'
|
||||
|
|
|
|||
|
|
@ -1568,7 +1568,6 @@ RSpec/ContextWording:
|
|||
- 'spec/lib/gitlab/auth_spec.rb'
|
||||
- 'spec/lib/gitlab/authorized_keys_spec.rb'
|
||||
- 'spec/lib/gitlab/avatar_cache_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_imported_issue_search_data_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/copy_column_using_background_migration_job_spec.rb'
|
||||
- 'spec/lib/gitlab/blame_spec.rb'
|
||||
- 'spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb'
|
||||
|
|
|
|||
|
|
@ -2777,7 +2777,6 @@ RSpec/FeatureCategory:
|
|||
- 'spec/lib/gitlab/authorized_keys_spec.rb'
|
||||
- 'spec/lib/gitlab/avatar_cache_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_cluster_agents_has_vulnerabilities_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_imported_issue_search_data_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_integrations_enable_ssl_verification_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_internal_on_notes_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_namespace_details_spec.rb'
|
||||
|
|
@ -2788,7 +2787,6 @@ RSpec/FeatureCategory:
|
|||
- 'spec/lib/gitlab/background_migration/backfill_project_namespace_details_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_project_repositories_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_topics_title_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_user_details_fields_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/base_job_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/batching_strategies/backfill_project_statistics_with_container_registry_size_batching_strategy_spec.rb'
|
||||
|
|
@ -2804,10 +2802,8 @@ RSpec/FeatureCategory:
|
|||
- 'spec/lib/gitlab/background_migration/destroy_invalid_members_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/disable_legacy_open_source_licence_for_recent_public_projects_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_inactive_public_projects_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_no_issues_no_repo_projects_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/expire_o_auth_tokens_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/job_coordinator_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/legacy_uploads_migrator_spec.rb'
|
||||
|
|
|
|||
|
|
@ -1821,7 +1821,6 @@ RSpec/NamedSubject:
|
|||
- 'spec/lib/gitlab/background_migration/backfill_missing_ci_cd_settings_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_project_repositories_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_topics_title_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_user_details_fields_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/delete_invalid_protected_branch_merge_access_levels_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/delete_invalid_protected_branch_push_access_levels_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/delete_invalid_protected_tag_create_access_levels_spec.rb'
|
||||
|
|
@ -1835,7 +1834,6 @@ RSpec/NamedSubject:
|
|||
- 'spec/lib/gitlab/background_migration/populate_vulnerability_dismissal_fields_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/redis/backfill_project_pipeline_status_ttl_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/remove_backfilled_job_artifacts_expire_at_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/remove_project_group_link_with_missing_groups_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/truncate_overlong_vulnerability_html_titles_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/update_ci_pipeline_artifacts_unknown_locked_status_spec.rb'
|
||||
- 'spec/lib/gitlab/background_task_spec.rb'
|
||||
|
|
@ -2562,8 +2560,6 @@ RSpec/NamedSubject:
|
|||
- 'spec/mailers/emails/merge_requests_spec.rb'
|
||||
- 'spec/mailers/notify_spec.rb'
|
||||
- 'spec/metrics_server/metrics_server_spec.rb'
|
||||
- 'spec/migrations/20221210154044_update_active_billable_users_index_spec.rb'
|
||||
- 'spec/migrations/20221221110733_remove_temp_index_for_project_statistics_upload_size_migration_spec.rb'
|
||||
- 'spec/migrations/20230714015909_add_index_for_member_expiring_query_spec.rb'
|
||||
- 'spec/migrations/drop_packages_events_table_spec.rb'
|
||||
- 'spec/models/ability_spec.rb'
|
||||
|
|
|
|||
|
|
@ -120,7 +120,6 @@ RSpec/ScatteredLet:
|
|||
- 'spec/lib/gitlab/asciidoc/include_processor_spec.rb'
|
||||
- 'spec/lib/gitlab/auth/ldap/person_spec.rb'
|
||||
- 'spec/lib/gitlab/auth/saml/auth_hash_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_imported_issue_search_data_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_inactive_public_projects_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/legacy_uploads_migrator_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/reset_too_many_tags_skipped_registry_imports_spec.rb'
|
||||
|
|
|
|||
|
|
@ -1117,23 +1117,6 @@ Style/InlineDisableAnnotation:
|
|||
- 'config/routes/project.rb'
|
||||
- 'danger/ce_ee_vue_templates/Dangerfile'
|
||||
- 'danger/roulette/Dangerfile'
|
||||
- 'db/migrate/20221111123146_add_onboarding_in_progress_to_users.rb'
|
||||
- 'db/migrate/20221111123147_add_onboarding_step_url_to_user_details.rb'
|
||||
- 'db/migrate/20221114131943_add_short_title_to_appearances.rb'
|
||||
- 'db/migrate/20221128155738_add_discord_to_user_details.rb'
|
||||
- 'db/migrate/20221212192452_add_uuid_column_to_sbom_occurrences.rb'
|
||||
- 'db/migrate/20221219103007_add_name_to_ml_candidates.rb'
|
||||
- 'db/migrate/20221223114543_add_pwa_icon_to_appearances.rb'
|
||||
- 'db/migrate/20221228072549_add_pwa_attributes_to_appearances.rb'
|
||||
- 'db/migrate/20230102131000_add_smtp_credentials_to_service_desk_settings.rb'
|
||||
- 'db/migrate/20230102180341_add_merge_request_meta_to_merge_requests_compliance_violations.rb'
|
||||
- 'db/migrate/20230111132621_unpartition_pm_package_metadata_tables.rb'
|
||||
- 'db/migrate/20230116143310_add_pages_unique_domain_columns_to_project_settings.rb'
|
||||
- 'db/migrate/20230119151636_add_url_hash_to_web_hook_logs.rb'
|
||||
- 'db/migrate/20230119214643_add_deactivation_email_additional_text_to_application_settings.rb'
|
||||
- 'db/migrate/20230127155217_add_id_column_to_package_metadata_join_table.rb'
|
||||
- 'db/migrate/20230130125541_add_attempts_and_last_error_to_postgres_async_indexes.rb'
|
||||
- 'db/migrate/20230214142813_remove_ci_job_artifacts_original_filename.rb'
|
||||
- 'db/migrate/20230216144719_drop_table_airflow_dags.rb'
|
||||
- 'db/migrate/20230222161226_add_custom_jira_regex_to_jira_tracker_data.rb'
|
||||
- 'db/migrate/20230228133011_add_design_description.rb'
|
||||
|
|
@ -1177,17 +1160,7 @@ Style/InlineDisableAnnotation:
|
|||
- '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/20221102231131_remove_temp_index_for_user_details_fields.rb'
|
||||
- 'db/post_migrate/20221115184525_remove_namespaces_tmp_project_id_column.rb'
|
||||
- 'db/post_migrate/20221220131020_bump_default_partition_id_value_for_ci_tables.rb'
|
||||
- 'db/post_migrate/20221221150123_update_billable_users_index.rb'
|
||||
- 'db/post_migrate/20230104103748_remove_new_amount_used_column.rb'
|
||||
- 'db/post_migrate/20230105180002_remove_new_amount_used_column_on_ci_namespace_monthly_usages.rb'
|
||||
- 'db/post_migrate/20230110172751_add_partial_index_on_group_path_id.rb'
|
||||
- 'db/post_migrate/20230117114739_clear_duplicate_jobs_cookies.rb'
|
||||
- 'db/post_migrate/20230123095023_add_scan_result_policy_id_to_software_license_policies.rb'
|
||||
- 'db/post_migrate/20230131184319_update_billable_users_index_for_service_accounts.rb'
|
||||
- 'db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb'
|
||||
- 'db/post_migrate/20230303154314_add_user_type_migration_indexes.rb'
|
||||
- 'db/post_migrate/20230310111859_recreate_user_type_migration_indexes.rb'
|
||||
- 'db/post_migrate/20230313150531_reschedule_migration_for_remediation.rb'
|
||||
|
|
@ -2882,7 +2855,6 @@ Style/InlineDisableAnnotation:
|
|||
- 'spec/lib/gitlab/background_migration/backfill_has_merge_request_of_vulnerability_reads_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_missing_ci_cd_settings_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_project_import_level_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_project_namespace_on_issues_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_project_repositories_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_resource_link_events_spec.rb'
|
||||
- 'spec/lib/gitlab/background_migration/backfill_root_storage_statistics_fork_storage_sizes_spec.rb'
|
||||
|
|
@ -3019,8 +2991,6 @@ Style/InlineDisableAnnotation:
|
|||
- '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/add_namespaces_emails_enabled_column_data_spec.rb'
|
||||
- 'spec/migrations/add_projects_emails_enabled_column_data_spec.rb'
|
||||
- 'spec/migrations/cleanup_bigint_conversion_for_merge_request_metrics_for_self_hosts_spec.rb'
|
||||
- 'spec/migrations/cleanup_conversion_big_int_ci_build_needs_self_managed_spec.rb'
|
||||
- 'spec/migrations/swap_award_emoji_note_id_to_bigint_for_gitlab_dot_com_spec.rb'
|
||||
|
|
|
|||
2
Gemfile
2
Gemfile
|
|
@ -517,7 +517,7 @@ group :test do
|
|||
# Moved in `test` because https://gitlab.com/gitlab-org/gitlab/-/issues/217527
|
||||
gem 'derailed_benchmarks', require: false # rubocop:todo Gemfile/MissingFeatureCategory
|
||||
|
||||
gem 'gitlab_quality-test_tooling', '~> 1.11.0', require: false, feature_category: :tooling
|
||||
gem 'gitlab_quality-test_tooling', '~> 1.12.0', require: false, feature_category: :tooling
|
||||
end
|
||||
|
||||
gem 'octokit', '~> 6.0' # rubocop:todo Gemfile/MissingFeatureCategory
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@
|
|||
{"name":"gitlab-styles","version":"11.0.0","platform":"ruby","checksum":"0dd8ec066ce9955ac51d3616c6bfded30f75bb526f39ff392ece6f43d5b9406b"},
|
||||
{"name":"gitlab_chronic_duration","version":"0.12.0","platform":"ruby","checksum":"0d766944d415b5c831f176871ee8625783fc0c5bfbef2d79a3a616f207ffc16d"},
|
||||
{"name":"gitlab_omniauth-ldap","version":"2.2.0","platform":"ruby","checksum":"bb4d20acb3b123ed654a8f6a47d3fac673ece7ed0b6992edb92dca14bad2838c"},
|
||||
{"name":"gitlab_quality-test_tooling","version":"1.11.0","platform":"ruby","checksum":"2146dbaddc5ffcaf4c6e876e6e9d9eb83bae25f378e0c9e5fca8d996ace3d02a"},
|
||||
{"name":"gitlab_quality-test_tooling","version":"1.12.0","platform":"ruby","checksum":"6d687db96777bd8c87264253a7cc9ce1d71851d2b20a64d594770c35555630b1"},
|
||||
{"name":"globalid","version":"1.1.0","platform":"ruby","checksum":"b337e1746f0c8cb0a6c918234b03a1ddeb4966206ce288fbb57779f59b2d154f"},
|
||||
{"name":"gon","version":"6.4.0","platform":"ruby","checksum":"e3a618d659392890f1aa7db420f17c75fd7d35aeb5f8fe003697d02c4b88d2f0"},
|
||||
{"name":"google-apis-androidpublisher_v3","version":"0.34.0","platform":"ruby","checksum":"d7e1d7dd92f79c498fe2082222a1740d788e022e660c135564b3fd299cab5425"},
|
||||
|
|
|
|||
|
|
@ -729,7 +729,7 @@ GEM
|
|||
omniauth (>= 1.3, < 3)
|
||||
pyu-ruby-sasl (>= 0.0.3.3, < 0.1)
|
||||
rubyntlm (~> 0.5)
|
||||
gitlab_quality-test_tooling (1.11.0)
|
||||
gitlab_quality-test_tooling (1.12.0)
|
||||
activesupport (>= 6.1, < 7.2)
|
||||
amatch (~> 0.4.1)
|
||||
gitlab (~> 4.19)
|
||||
|
|
@ -1910,7 +1910,7 @@ DEPENDENCIES
|
|||
gitlab-utils!
|
||||
gitlab_chronic_duration (~> 0.12)
|
||||
gitlab_omniauth-ldap (~> 2.2.0)
|
||||
gitlab_quality-test_tooling (~> 1.11.0)
|
||||
gitlab_quality-test_tooling (~> 1.12.0)
|
||||
gon (~> 6.4.0)
|
||||
google-apis-androidpublisher_v3 (~> 0.34.0)
|
||||
google-apis-cloudbilling_v1 (~> 0.21.0)
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ export const i18n = {
|
|||
cancel: __('Cancel'),
|
||||
defaultScope: __('All (default)'),
|
||||
deleteVariable: s__('CiVariables|Delete variable'),
|
||||
description: __('Description'),
|
||||
descriptionHelpText: s__("CiVariables|The description of the variable's value or usage."),
|
||||
editVariable: s__('CiVariables|Edit variable'),
|
||||
saveVariable: __('Save changes'),
|
||||
environments: __('Environments'),
|
||||
|
|
@ -459,6 +461,21 @@ export default {
|
|||
</p>
|
||||
</gl-form-checkbox>
|
||||
</gl-form-group>
|
||||
<gl-form-group
|
||||
label-for="ci-variable-description"
|
||||
:label="$options.i18n.description"
|
||||
class="gl-border-none gl-mb-n5"
|
||||
data-testid="ci-variable-description-label"
|
||||
:description="$options.i18n.descriptionHelpText"
|
||||
optional
|
||||
>
|
||||
<gl-form-input
|
||||
id="ci-variable-description"
|
||||
v-model="variable.description"
|
||||
class="gl-border-none"
|
||||
data-testid="ci-variable-description"
|
||||
/>
|
||||
</gl-form-group>
|
||||
<gl-form-combobox
|
||||
v-model="variable.key"
|
||||
:token-list="$options.awsTokenList"
|
||||
|
|
|
|||
|
|
@ -278,35 +278,40 @@ export default {
|
|||
<col v-for="field in scope.fields" :key="field.key" :style="field.customStyle" />
|
||||
</template>
|
||||
<template #cell(key)="{ item }">
|
||||
<div
|
||||
class="gl-display-flex gl-align-items-flex-start gl-justify-content-end gl-md-justify-content-start gl-mr-n3"
|
||||
>
|
||||
<span
|
||||
:id="`ci-variable-key-${item.id}`"
|
||||
class="gl-display-inline-block gl-max-w-full gl-word-break-word"
|
||||
>{{ item.key }}</span
|
||||
<div data-testid="ci-variable-table-row-variable">
|
||||
<div
|
||||
class="gl-display-flex gl-align-items-flex-start gl-justify-content-end gl-md-justify-content-start gl-mr-n3"
|
||||
>
|
||||
<gl-button
|
||||
v-gl-tooltip
|
||||
category="tertiary"
|
||||
icon="copy-to-clipboard"
|
||||
class="gl-my-n2 gl-ml-2"
|
||||
size="small"
|
||||
:title="__('Copy key')"
|
||||
:data-clipboard-text="item.key"
|
||||
:aria-label="__('Copy to clipboard')"
|
||||
/>
|
||||
</div>
|
||||
<div data-testid="ci-variable-table-row-attributes" class="gl-mt-2">
|
||||
<gl-badge
|
||||
v-for="attribute in item.attributes"
|
||||
:key="`${item.key}-${attribute}`"
|
||||
class="gl-mr-2"
|
||||
variant="info"
|
||||
size="sm"
|
||||
>
|
||||
{{ attribute }}
|
||||
</gl-badge>
|
||||
<span
|
||||
:id="`ci-variable-key-${item.id}`"
|
||||
class="gl-display-inline-block gl-max-w-full gl-word-break-word"
|
||||
>{{ item.key }}</span
|
||||
>
|
||||
<gl-button
|
||||
v-gl-tooltip
|
||||
category="tertiary"
|
||||
icon="copy-to-clipboard"
|
||||
class="gl-my-n2 gl-ml-2"
|
||||
size="small"
|
||||
:title="__('Copy key')"
|
||||
:data-clipboard-text="item.key"
|
||||
:aria-label="__('Copy to clipboard')"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="item.description" class="gl-mt-2 gl-text-secondary gl-font-sm">
|
||||
{{ item.description }}
|
||||
</div>
|
||||
<div data-testid="ci-variable-table-row-attributes" class="gl-mt-2">
|
||||
<gl-badge
|
||||
v-for="attribute in item.attributes"
|
||||
:key="`${item.key}-${attribute}`"
|
||||
class="gl-mr-2"
|
||||
variant="info"
|
||||
size="sm"
|
||||
>
|
||||
{{ attribute }}
|
||||
</gl-badge>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="!isInheritedGroupVars" #cell(value)="{ item }">
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ export const variableOptions = [
|
|||
];
|
||||
|
||||
export const defaultVariableState = {
|
||||
description: null,
|
||||
environmentScope: '*',
|
||||
key: '',
|
||||
masked: false,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
fragment BaseCiGroupVariable on CiGroupVariable {
|
||||
description
|
||||
environmentScope
|
||||
masked
|
||||
protected
|
||||
raw
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
fragment BaseCiInstanceVariable on CiInstanceVariable {
|
||||
description
|
||||
protected
|
||||
masked
|
||||
raw
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fragment BaseCiProjectVariable on CiProjectVariable {
|
||||
description
|
||||
environmentScope
|
||||
masked
|
||||
protected
|
||||
raw
|
||||
}
|
||||
|
|
@ -1,14 +1,12 @@
|
|||
#import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql"
|
||||
#import "~/ci/ci_variable_list/graphql/fragments/ci_instance_variable.fragment.graphql"
|
||||
|
||||
mutation addAdminVariable($variable: CiVariable!, $endpoint: String!) {
|
||||
ciVariableMutation: addAdminVariable(variable: $variable, endpoint: $endpoint) @client {
|
||||
ciVariables {
|
||||
nodes {
|
||||
...BaseCiVariable
|
||||
... on CiInstanceVariable {
|
||||
protected
|
||||
masked
|
||||
}
|
||||
...BaseCiInstanceVariable
|
||||
}
|
||||
}
|
||||
errors
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
#import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql"
|
||||
#import "~/ci/ci_variable_list/graphql/fragments/ci_instance_variable.fragment.graphql"
|
||||
|
||||
mutation deleteAdminVariable($variable: CiVariable!, $endpoint: String!) {
|
||||
ciVariableMutation: deleteAdminVariable(variable: $variable, endpoint: $endpoint) @client {
|
||||
ciVariables {
|
||||
nodes {
|
||||
...BaseCiVariable
|
||||
... on CiInstanceVariable {
|
||||
protected
|
||||
masked
|
||||
}
|
||||
...BaseCiInstanceVariable
|
||||
}
|
||||
}
|
||||
errors
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
#import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql"
|
||||
#import "~/ci/ci_variable_list/graphql/fragments/ci_instance_variable.fragment.graphql"
|
||||
|
||||
mutation updateAdminVariable($variable: CiVariable!, $endpoint: String!) {
|
||||
ciVariableMutation: updateAdminVariable(variable: $variable, endpoint: $endpoint) @client {
|
||||
ciVariables {
|
||||
nodes {
|
||||
...BaseCiVariable
|
||||
... on CiInstanceVariable {
|
||||
protected
|
||||
masked
|
||||
}
|
||||
...BaseCiInstanceVariable
|
||||
}
|
||||
}
|
||||
errors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql"
|
||||
#import "~/ci/ci_variable_list/graphql/fragments/ci_group_variable.fragment.graphql"
|
||||
|
||||
mutation addGroupVariable($variable: CiVariable!, $endpoint: String!, $fullPath: ID!, $id: ID!) {
|
||||
ciVariableMutation: addGroupVariable(
|
||||
|
|
@ -12,12 +13,7 @@ mutation addGroupVariable($variable: CiVariable!, $endpoint: String!, $fullPath:
|
|||
ciVariables {
|
||||
nodes {
|
||||
...BaseCiVariable
|
||||
... on CiGroupVariable {
|
||||
environmentScope
|
||||
masked
|
||||
protected
|
||||
raw
|
||||
}
|
||||
...BaseCiGroupVariable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql"
|
||||
#import "~/ci/ci_variable_list/graphql/fragments/ci_group_variable.fragment.graphql"
|
||||
|
||||
mutation deleteGroupVariable($variable: CiVariable!, $endpoint: String!, $fullPath: ID!, $id: ID!) {
|
||||
ciVariableMutation: deleteGroupVariable(
|
||||
|
|
@ -12,12 +13,7 @@ mutation deleteGroupVariable($variable: CiVariable!, $endpoint: String!, $fullPa
|
|||
ciVariables {
|
||||
nodes {
|
||||
...BaseCiVariable
|
||||
... on CiGroupVariable {
|
||||
environmentScope
|
||||
masked
|
||||
protected
|
||||
raw
|
||||
}
|
||||
...BaseCiGroupVariable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql"
|
||||
#import "~/ci/ci_variable_list/graphql/fragments/ci_group_variable.fragment.graphql"
|
||||
|
||||
mutation updateGroupVariable($variable: CiVariable!, $endpoint: String!, $fullPath: ID!, $id: ID!) {
|
||||
ciVariableMutation: updateGroupVariable(
|
||||
|
|
@ -12,12 +13,7 @@ mutation updateGroupVariable($variable: CiVariable!, $endpoint: String!, $fullPa
|
|||
ciVariables {
|
||||
nodes {
|
||||
...BaseCiVariable
|
||||
... on CiGroupVariable {
|
||||
environmentScope
|
||||
masked
|
||||
protected
|
||||
raw
|
||||
}
|
||||
...BaseCiGroupVariable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql"
|
||||
#import "~/ci/ci_variable_list/graphql/fragments/ci_project_variable.fragment.graphql"
|
||||
|
||||
mutation addProjectVariable($variable: CiVariable!, $endpoint: String!, $fullPath: ID!, $id: ID!) {
|
||||
ciVariableMutation: addProjectVariable(
|
||||
|
|
@ -12,12 +13,7 @@ mutation addProjectVariable($variable: CiVariable!, $endpoint: String!, $fullPat
|
|||
ciVariables {
|
||||
nodes {
|
||||
...BaseCiVariable
|
||||
... on CiProjectVariable {
|
||||
environmentScope
|
||||
masked
|
||||
protected
|
||||
raw
|
||||
}
|
||||
...BaseCiProjectVariable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql"
|
||||
#import "~/ci/ci_variable_list/graphql/fragments/ci_project_variable.fragment.graphql"
|
||||
|
||||
mutation deleteProjectVariable(
|
||||
$variable: CiVariable!
|
||||
|
|
@ -17,12 +18,7 @@ mutation deleteProjectVariable(
|
|||
ciVariables {
|
||||
nodes {
|
||||
...BaseCiVariable
|
||||
... on CiProjectVariable {
|
||||
environmentScope
|
||||
masked
|
||||
protected
|
||||
raw
|
||||
}
|
||||
...BaseCiProjectVariable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql"
|
||||
#import "~/ci/ci_variable_list/graphql/fragments/ci_project_variable.fragment.graphql"
|
||||
|
||||
mutation updateProjectVariable(
|
||||
$variable: CiVariable!
|
||||
|
|
@ -17,12 +18,7 @@ mutation updateProjectVariable(
|
|||
ciVariables {
|
||||
nodes {
|
||||
...BaseCiVariable
|
||||
... on CiProjectVariable {
|
||||
environmentScope
|
||||
masked
|
||||
protected
|
||||
raw
|
||||
}
|
||||
...BaseCiProjectVariable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql"
|
||||
#import "~/ci/ci_variable_list/graphql/fragments/ci_group_variable.fragment.graphql"
|
||||
#import "~/graphql_shared/fragments/page_info.fragment.graphql"
|
||||
|
||||
query getGroupVariables(
|
||||
|
|
@ -18,12 +19,7 @@ query getGroupVariables(
|
|||
}
|
||||
nodes {
|
||||
...BaseCiVariable
|
||||
... on CiGroupVariable {
|
||||
environmentScope
|
||||
masked
|
||||
protected
|
||||
raw
|
||||
}
|
||||
...BaseCiGroupVariable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql"
|
||||
#import "~/ci/ci_variable_list/graphql/fragments/ci_project_variable.fragment.graphql"
|
||||
#import "~/graphql_shared/fragments/page_info.fragment.graphql"
|
||||
|
||||
query getProjectVariables(
|
||||
|
|
@ -18,10 +19,7 @@ query getProjectVariables(
|
|||
}
|
||||
nodes {
|
||||
...BaseCiVariable
|
||||
environmentScope
|
||||
masked
|
||||
protected
|
||||
raw
|
||||
...BaseCiProjectVariable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#import "~/ci/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql"
|
||||
#import "~/ci/ci_variable_list/graphql/fragments/ci_instance_variable.fragment.graphql"
|
||||
#import "~/graphql_shared/fragments/page_info.fragment.graphql"
|
||||
|
||||
query getVariables(
|
||||
|
|
@ -14,11 +15,7 @@ query getVariables(
|
|||
}
|
||||
nodes {
|
||||
...BaseCiVariable
|
||||
... on CiInstanceVariable {
|
||||
masked
|
||||
protected
|
||||
raw
|
||||
}
|
||||
...BaseCiInstanceVariable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ query getInheritedCiVariables($after: String, $first: Int, $fullPath: ID!) {
|
|||
nodes {
|
||||
id
|
||||
key
|
||||
description
|
||||
variableType
|
||||
environmentScope
|
||||
groupCiCdSettingsPath
|
||||
|
|
|
|||
|
|
@ -19,7 +19,12 @@ const transform = (el, binding) => {
|
|||
}
|
||||
};
|
||||
|
||||
const clear = (el) => {
|
||||
el.textContent = '';
|
||||
};
|
||||
|
||||
export default {
|
||||
bind: transform,
|
||||
update: transform,
|
||||
unbind: clear,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
# Automatically stages the file and amends the previous commit if the `--amend`
|
||||
# argument is used.
|
||||
|
||||
require_relative '../config/bundler_setup'
|
||||
require 'fileutils'
|
||||
require 'httparty'
|
||||
require 'json'
|
||||
|
|
@ -13,6 +14,7 @@ require 'readline'
|
|||
require 'shellwords'
|
||||
require 'uri'
|
||||
require 'yaml'
|
||||
require 'gitlab/utils/all'
|
||||
|
||||
require_relative '../lib/feature/shared' unless defined?(Feature::Shared)
|
||||
require_relative '../lib/gitlab/popen'
|
||||
|
|
@ -331,6 +333,17 @@ class FeatureFlagOptionParser
|
|||
end
|
||||
end
|
||||
|
||||
def read_ee
|
||||
$stdout.puts
|
||||
$stdout.puts ">> Is this an EE only feature (enter to skip):"
|
||||
|
||||
loop do
|
||||
ee = Readline.readline('?> ', false)&.strip
|
||||
return if ee.empty?
|
||||
return Gitlab::Utils.to_boolean(ee)
|
||||
end
|
||||
end
|
||||
|
||||
def read_url(prompt)
|
||||
$stdout.puts
|
||||
$stdout.puts ">> #{prompt}"
|
||||
|
|
@ -404,6 +417,7 @@ class FeatureFlagCreator
|
|||
options.introduced_by_url ||= FeatureFlagOptionParser.read_introduced_by_url
|
||||
options.milestone ||= FeatureFlagOptionParser.read_milestone
|
||||
options.username ||= FeatureFlagOptionParser.read_username
|
||||
options.ee ||= FeatureFlagOptionParser.read_ee
|
||||
options.rollout_issue_url ||= FeatureFlagOptionParser.read_rollout_issue_url(options)
|
||||
|
||||
$stdout.puts "\e[32mcreate\e[0m #{file_path}"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,20 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoveTmpIdxVulnerabilityOccurrencesOnIdAndScannerId < Gitlab::Database::Migration[2.0]
|
||||
INDEX_NAME = 'tmp_index_vulnerability_occurrences_on_id_and_scanner_id'
|
||||
REPORT_TYPES = { cluster_image_scanning: 7, generic: 99 }.freeze
|
||||
CLAUSE = "report_type IN (#{REPORT_TYPES.values.join(',')})"
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME
|
||||
end
|
||||
|
||||
def down
|
||||
add_concurrent_index :vulnerability_occurrences,
|
||||
[:id, :scanner_id],
|
||||
where: CLAUSE,
|
||||
name: INDEX_NAME
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddRunnerRegistrationEnabledToNamespaceSettings < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :namespace_settings, :runner_registration_enabled, :boolean, default: true
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddAccessLevelToCiJobArtifacts < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_job_artifacts, :accessibility, :integer, default: 0, limit: 2, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddStatusUpdatedAtToContainerRepository < Gitlab::Database::Migration[2.0]
|
||||
def change
|
||||
add_column :container_repositories, :status_updated_at, :datetime_with_timezone
|
||||
end
|
||||
end
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreatePackageMetadata < Gitlab::Database::Migration[2.0]
|
||||
def change
|
||||
create_table :pm_packages do |t|
|
||||
t.integer :purl_type, null: false, limit: 2
|
||||
t.text :name, null: false, limit: 255
|
||||
t.index [:purl_type, :name], unique: true, name: 'i_pm_packages_purl_type_and_name'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreatePackageMetadataVersions < Gitlab::Database::Migration[2.0]
|
||||
def change
|
||||
create_table :pm_package_versions do |t|
|
||||
t.references :pm_package, foreign_key: { to_table: :pm_packages, on_delete: :cascade }
|
||||
t.text :version, null: false, limit: 255
|
||||
t.index [:pm_package_id, :version], unique: true, name: 'i_pm_package_versions_on_package_id_and_version'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreatePackageMetadataLicenses < Gitlab::Database::Migration[2.0]
|
||||
def change
|
||||
create_table :pm_licenses do |t|
|
||||
t.text :spdx_identifier, null: false, limit: 50
|
||||
t.index [:spdx_identifier], unique: true, name: 'i_pm_licenses_on_spdx_identifier'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreatePackageMetadataPackageVersionLicenses < Gitlab::Database::Migration[2.0]
|
||||
INDEX_NAME = 'i_pm_package_version_licenses_on_version_and_license_ids'
|
||||
|
||||
def change
|
||||
create_table :pm_package_version_licenses, primary_key: [:pm_package_version_id, :pm_license_id] do |t|
|
||||
t.references :pm_package_version, foreign_key: { on_delete: :cascade }, null: false
|
||||
t.references :pm_license, foreign_key: { on_delete: :cascade }, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class IndexEnvironmentsForNameSearchWithinFolder < Gitlab::Database::Migration[2.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
INDEX_NAME = 'index_environments_for_name_search_within_folder'
|
||||
|
||||
def up
|
||||
add_concurrent_index :environments,
|
||||
"project_id, lower(ltrim(name, environment_type || '/')) varchar_pattern_ops, state", name: INDEX_NAME
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index_by_name :environments, INDEX_NAME
|
||||
end
|
||||
end
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateDependencyProxyManifestStates < Gitlab::Database::Migration[2.0]
|
||||
DEPENDENCY_PROXY_MANIFEST_INDEX_NAME = "index_manifest_states_on_dependency_proxy_manifest_id"
|
||||
VERIFICATION_STATE_INDEX_NAME = "index_manifest_states_on_verification_state"
|
||||
PENDING_VERIFICATION_INDEX_NAME = "index_manifest_states_pending_verification"
|
||||
FAILED_VERIFICATION_INDEX_NAME = "index_manifest_states_failed_verification"
|
||||
NEEDS_VERIFICATION_INDEX_NAME = "index_manifest_states_needs_verification"
|
||||
|
||||
enable_lock_retries!
|
||||
|
||||
def up
|
||||
create_table :dependency_proxy_manifest_states, id: false do |t|
|
||||
t.datetime_with_timezone :verification_started_at
|
||||
t.datetime_with_timezone :verification_retry_at
|
||||
t.datetime_with_timezone :verified_at
|
||||
t.references :dependency_proxy_manifest,
|
||||
primary_key: true,
|
||||
index: { name: DEPENDENCY_PROXY_MANIFEST_INDEX_NAME },
|
||||
default: nil,
|
||||
foreign_key: { on_delete: :cascade }
|
||||
t.integer :verification_state, default: 0, limit: 2, null: false
|
||||
t.integer :verification_retry_count, limit: 2, default: 0, null: false
|
||||
t.binary :verification_checksum, using: 'verification_checksum::bytea'
|
||||
t.text :verification_failure, limit: 255
|
||||
|
||||
t.index :verification_state, name: VERIFICATION_STATE_INDEX_NAME
|
||||
t.index :verified_at,
|
||||
where: "(verification_state = 0)",
|
||||
order: { verified_at: 'ASC NULLS FIRST' },
|
||||
name: PENDING_VERIFICATION_INDEX_NAME
|
||||
t.index :verification_retry_at,
|
||||
where: "(verification_state = 3)",
|
||||
order: { verification_retry_at: 'ASC NULLS FIRST' },
|
||||
name: FAILED_VERIFICATION_INDEX_NAME
|
||||
t.index :verification_state,
|
||||
where: "(verification_state = 0 OR verification_state = 3)",
|
||||
name: NEEDS_VERIFICATION_INDEX_NAME
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :dependency_proxy_manifest_states
|
||||
end
|
||||
end
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateDastPreScanVerification < Gitlab::Database::Migration[2.0]
|
||||
def up
|
||||
create_table :dast_pre_scan_verifications do |t|
|
||||
t.references :dast_profile, null: false, foreign_key: { on_delete: :cascade },
|
||||
index: { name: 'index_dast_pre_scan_verifications_on_dast_profile_id' }
|
||||
|
||||
t.bigint :ci_pipeline_id, null: false
|
||||
|
||||
t.timestamps_with_timezone
|
||||
|
||||
t.integer :status, default: 0, limit: 2, null: false
|
||||
|
||||
t.index :ci_pipeline_id, unique: true, name: :index_dast_pre_scan_verifications_on_ci_pipeline_id
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :dast_pre_scan_verifications
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddAcceptedReviewersToMergeRequestPredictions < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :merge_request_predictions, :accepted_reviewers, :jsonb, null: false, default: {}
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPartitionIdToCiUnitTestFailures < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_unit_test_failures, :partition_id, :bigint, default: 100, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPartitionIdToCiSourcesPipelines < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_sources_pipelines, :partition_id, :bigint, default: 100, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPartitionIdToCiBuildPendingStates < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_build_pending_states, :partition_id, :bigint, default: 100, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPartitionIdToCiBuildTraceChunks < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_build_trace_chunks, :partition_id, :bigint, default: 100, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPartitionIdToCiBuildReportResults < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_build_report_results, :partition_id, :bigint, default: 100, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPartitionIdToCiBuildNeeds < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_build_needs, :partition_id, :bigint, default: 100, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPartitionIdToCiBuildsRunnerSession < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_builds_runner_session, :partition_id, :bigint, default: 100, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPartitionIdToCiPendingBuilds < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_pending_builds, :partition_id, :bigint, default: 100, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPartitionIdToCiBuildTraceMetadata < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_build_trace_metadata, :partition_id, :bigint, default: 100, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPartitionIdToCiRunningBuilds < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_running_builds, :partition_id, :bigint, default: 100, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPartitionIdToCiJobVariables < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_job_variables, :partition_id, :bigint, default: 100, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddDashboardFieldsToNamespaceDetails < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :namespace_details, :dashboard_notification_at, :datetime_with_timezone
|
||||
add_column :namespace_details, :dashboard_enforcement_at, :datetime_with_timezone
|
||||
end
|
||||
end
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddOnboardingInProgressToUsers < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
# rubocop:disable Migration/AddColumnsToWideTables
|
||||
def up
|
||||
add_column :users, :onboarding_in_progress, :boolean, default: false, null: false
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :users, :onboarding_in_progress
|
||||
end
|
||||
# rubocop:enable Migration/AddColumnsToWideTables
|
||||
end
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddOnboardingStepUrlToUserDetails < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
# rubocop:disable Migration/AddLimitToTextColumns
|
||||
# limit is added in 20221111123148_add_text_limit_to_onboarding_step_url.rb
|
||||
def up
|
||||
add_column :user_details, :onboarding_step_url, :text
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :user_details, :onboarding_step_url
|
||||
end
|
||||
# rubocop:enable Migration/AddLimitToTextColumns
|
||||
end
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddTextLimitToOnboardingStepUrl < Gitlab::Database::Migration[2.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_text_limit :user_details, :onboarding_step_url, 2000
|
||||
end
|
||||
|
||||
def down
|
||||
remove_text_limit :user_details, :onboarding_step_url
|
||||
end
|
||||
end
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateDependencyListExportsTable < Gitlab::Database::Migration[2.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
create_table :dependency_list_exports do |t|
|
||||
t.timestamps_with_timezone null: false
|
||||
t.bigint :project_id, null: false
|
||||
t.bigint :user_id
|
||||
t.integer :file_store
|
||||
t.integer :status, default: 0, null: false, limit: 2
|
||||
t.text :file, limit: 255
|
||||
|
||||
t.index :user_id
|
||||
t.index :project_id
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :dependency_list_exports
|
||||
end
|
||||
end
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddHierarchyRestrictions < Gitlab::Database::Migration[2.0]
|
||||
UNIQUE_INDEX_NAME = 'index_work_item_hierarchy_restrictions_on_parent_and_child'
|
||||
|
||||
def up
|
||||
create_table :work_item_hierarchy_restrictions do |t|
|
||||
t.references :parent_type, index: true, null: false,
|
||||
foreign_key: { on_delete: :cascade, to_table: :work_item_types }
|
||||
t.references :child_type, index: true, null: false,
|
||||
foreign_key: { on_delete: :cascade, to_table: :work_item_types }
|
||||
t.integer :maximum_depth, limit: 2
|
||||
|
||||
t.index [:parent_type_id, :child_type_id], unique: true, name: UNIQUE_INDEX_NAME
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :work_item_hierarchy_restrictions
|
||||
end
|
||||
end
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddShortTitleToAppearances < Gitlab::Database::Migration[2.0]
|
||||
# rubocop:disable Migration/AddLimitToTextColumns
|
||||
# limit is added in 20221115085813_add_limit_to_appereances_short_title.rb
|
||||
def change
|
||||
add_column :appearances, :short_title, :text
|
||||
end
|
||||
# rubocop:enable Migration/AddLimitToTextColumns
|
||||
end
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddLastSeatRefreshAtToGitlabSubscriptions < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
TABLE_NAME = 'gitlab_subscriptions'
|
||||
COLUMN_NAME = 'last_seat_refresh_at'
|
||||
|
||||
def up
|
||||
add_column(TABLE_NAME, COLUMN_NAME, :datetime_with_timezone)
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column(TABLE_NAME, COLUMN_NAME)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddDebugTraceToCiBuildsMetadata < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :p_ci_builds_metadata, :debug_trace_enabled, :boolean, null: false, default: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddLimitToAppereancesShortTitle < Gitlab::Database::Migration[2.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_text_limit :appearances, :short_title, 255
|
||||
end
|
||||
|
||||
def down
|
||||
remove_text_limit :appearances, :short_title
|
||||
end
|
||||
end
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddForeignKeyToDependencyListExports < Gitlab::Database::Migration[2.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_concurrent_foreign_key(
|
||||
:dependency_list_exports,
|
||||
:users,
|
||||
column: :user_id,
|
||||
on_delete: :nullify)
|
||||
add_concurrent_foreign_key(
|
||||
:dependency_list_exports,
|
||||
:projects,
|
||||
column: :project_id,
|
||||
on_delete: :cascade)
|
||||
end
|
||||
|
||||
def down
|
||||
with_lock_retries do
|
||||
remove_foreign_key_if_exists :dependency_list_exports, column: :user_id
|
||||
end
|
||||
with_lock_retries do
|
||||
remove_foreign_key_if_exists :dependency_list_exports, column: :project_id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIndexOnTeamIdAndChatId < Gitlab::Database::Migration[2.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
INDEX_NAME = 'index_chat_names_on_team_id_and_chat_id'
|
||||
|
||||
def up
|
||||
add_concurrent_index(:chat_names, [:team_id, :chat_id], name: INDEX_NAME)
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index_by_name :chat_names, INDEX_NAME
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddEnterpriseBooleanToBulkImports < Gitlab::Database::Migration[2.0]
|
||||
def change
|
||||
add_column :bulk_imports, :source_enterprise, :boolean, default: true, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
class AddProjectsEmailsEnabledColumn < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
def change
|
||||
add_column :project_settings, :emails_enabled, :boolean, default: true, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
class AddNamespacesEmailsEnabledColumn < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :namespace_settings, :emails_enabled, :boolean, default: true, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateMlExperimentMetadataAndMlCandidateMetadata < Gitlab::Database::Migration[2.0]
|
||||
def change
|
||||
create_table :ml_experiment_metadata do |t|
|
||||
t.timestamps_with_timezone null: false
|
||||
t.references :experiment,
|
||||
foreign_key: { to_table: :ml_experiments, on_delete: :cascade },
|
||||
index: false,
|
||||
null: false
|
||||
t.text :name, limit: 255, null: false
|
||||
t.text :value, limit: 5000, null: false
|
||||
|
||||
t.index [:experiment_id, :name], unique: true
|
||||
end
|
||||
|
||||
create_table :ml_candidate_metadata do |t|
|
||||
t.timestamps_with_timezone null: false
|
||||
t.references :candidate,
|
||||
foreign_key: { to_table: :ml_candidates, on_delete: :cascade },
|
||||
index: false,
|
||||
null: false
|
||||
t.text :name, limit: 255, null: false, index: true
|
||||
t.text :value, limit: 5000, null: false
|
||||
|
||||
t.index [:candidate_id, :name], unique: true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddAuthSigningTypeToKeys < Gitlab::Database::Migration[2.0]
|
||||
def change
|
||||
add_column :keys, :usage_type, :integer, limit: 2, null: false, default: 0
|
||||
end
|
||||
end
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddWorkItemProgress < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def up
|
||||
create_table :work_item_progresses, id: false do |t|
|
||||
t.timestamps_with_timezone null: false
|
||||
t.references :issue, primary_key: true, index: false, default: nil,
|
||||
foreign_key: { on_delete: :cascade, to_table: :issues }
|
||||
t.integer :progress, default: 0, limit: 2, null: false
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :work_item_progresses
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPartitionIdToCiResources < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column(:ci_resources, :partition_id, :bigint, default: 100, null: false)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddAllowPipelineTriggerApproveDeploymentToProjectSettings < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :project_settings, :allow_pipeline_trigger_approve_deployment, :boolean, default: false, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class SetEmailConfirmationSettingBeforeRemovingSendUserConfirmationEmailColumn < Gitlab::Database::Migration[2.0]
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
|
||||
class ApplicationSetting < MigrationRecord
|
||||
self.table_name = 'application_settings'
|
||||
end
|
||||
|
||||
def up
|
||||
return unless ApplicationSetting.exists?
|
||||
return unless ApplicationSetting.last.send_user_confirmation_email
|
||||
|
||||
ApplicationSetting.last.update(email_confirmation_setting: 2)
|
||||
end
|
||||
|
||||
def down
|
||||
return unless ApplicationSetting.exists?
|
||||
|
||||
ApplicationSetting.last.update(email_confirmation_setting: 0)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPipelineHierarchySizeToPlanLimits < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
add_column(:plan_limits, :pipeline_hierarchy_size, :integer, default: 1000, null: false)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddSourcePartitionIdToCiSourcesPipeline < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :ci_sources_pipelines, :source_partition_id, :bigint, default: 100, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddDiscordToUserDetails < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
# rubocop:disable Migration/AddLimitToTextColumns
|
||||
# limits are added in 20221128165833_add_discord_field_limit_to_user_details.rb
|
||||
def change
|
||||
add_column :user_details, :discord, :text, default: '', null: false
|
||||
end
|
||||
# rubocop:enable Migration/AddLimitToTextColumns
|
||||
end
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddDiscordFieldLimitToUserDetails < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
USER_DETAILS_FIELD_LIMIT = 500
|
||||
|
||||
def up
|
||||
add_text_limit :user_details, :discord, USER_DETAILS_FIELD_LIMIT
|
||||
end
|
||||
|
||||
def down
|
||||
remove_text_limit :user_details, :discord
|
||||
end
|
||||
end
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class IncreaseSelfHostedAttachmentSizeLimit < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def up
|
||||
change_column_default :application_settings, :max_attachment_size, from: 10, to: 100
|
||||
end
|
||||
|
||||
def down
|
||||
change_column_default :application_settings, :max_attachment_size, from: 100, to: 10
|
||||
end
|
||||
end
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateDastPreScanVerificationStep < Gitlab::Database::Migration[2.1]
|
||||
def up
|
||||
create_table :dast_pre_scan_verification_steps do |t|
|
||||
t.references :dast_pre_scan_verification,
|
||||
null: false, foreign_key: { on_delete: :cascade },
|
||||
index: { name: 'i_dast_pre_scan_verification_steps_on_pre_scan_verification_id' }
|
||||
t.timestamps_with_timezone
|
||||
t.text :name, limit: 255
|
||||
t.text :verification_errors, array: true, default: [], null: false
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :dast_pre_scan_verification_steps
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddPlanLimitsMaxSizeToRequirementsV2Artifact < Gitlab::Database::Migration[2.0]
|
||||
def change
|
||||
add_column :plan_limits, :ci_max_artifact_size_requirements_v2, :integer, null: false, default: 0
|
||||
end
|
||||
end
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateAchievements < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def up
|
||||
create_table :achievements do |t|
|
||||
t.references :namespace,
|
||||
null: false,
|
||||
index: false,
|
||||
foreign_key: { on_delete: :cascade }
|
||||
t.timestamps_with_timezone null: false
|
||||
t.text :name, null: false, limit: 255
|
||||
t.text :avatar, limit: 255
|
||||
t.text :description, limit: 1024
|
||||
t.boolean :revokeable, default: false, null: false
|
||||
t.index 'namespace_id, LOWER(name)', unique: true
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :achievements
|
||||
end
|
||||
end
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
class RemoveIndexICiJobTokenProjectScopeLinksOnSourceAndTargetProject < Gitlab::Database::Migration[2.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
TABLE_NAME = 'ci_job_token_project_scope_links'
|
||||
OLD_INDEX_NAME = 'i_ci_job_token_project_scope_links_on_source_and_target_project'
|
||||
NEW_INDEX_NAME = 'ci_job_token_scope_links_source_and_target_project_direction'
|
||||
NEW_INDEX_COL = %w[source_project_id target_project_id direction]
|
||||
|
||||
def up
|
||||
add_concurrent_index(
|
||||
TABLE_NAME,
|
||||
NEW_INDEX_COL,
|
||||
name: NEW_INDEX_NAME,
|
||||
unique: true
|
||||
)
|
||||
remove_concurrent_index_by_name(TABLE_NAME, OLD_INDEX_NAME)
|
||||
end
|
||||
|
||||
def down
|
||||
# noop: as we can have duplicate records once the unique index is removed
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddCategoryToAbuseReport < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
add_column :abuse_reports, :category, :integer, limit: 2, default: 1, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddDisablePatsToApplicationSettings < Gitlab::Database::Migration[2.0]
|
||||
def change
|
||||
add_column(:application_settings, :disable_personal_access_tokens, :boolean, default: false, null: false)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddUseNewNavigationToUserPreferences < Gitlab::Database::Migration[2.0]
|
||||
enable_lock_retries!
|
||||
|
||||
def change
|
||||
add_column :user_preferences, :use_new_navigation, :boolean, default: nil, null: true
|
||||
end
|
||||
end
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddAuthorizedScopesToSlackIntegration < Gitlab::Database::Migration[2.1]
|
||||
def up
|
||||
create_table :slack_api_scopes do |t|
|
||||
t.text :name, null: false, limit: 100
|
||||
|
||||
t.index :name, name: 'index_slack_api_scopes_on_name', unique: true
|
||||
end
|
||||
|
||||
create_table :slack_integrations_scopes do |t|
|
||||
t.references :slack_api_scope,
|
||||
null: false,
|
||||
index: false, # See composite index
|
||||
foreign_key: {
|
||||
to_table: :slack_api_scopes,
|
||||
on_delete: :cascade
|
||||
}
|
||||
|
||||
t.references :slack_integration,
|
||||
null: false,
|
||||
index: false, # see composite index
|
||||
foreign_key: {
|
||||
to_table: :slack_integrations,
|
||||
on_delete: :cascade
|
||||
}
|
||||
|
||||
t.index [:slack_integration_id, :slack_api_scope_id],
|
||||
unique: true,
|
||||
name: 'index_slack_api_scopes_on_name_and_integration'
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :slack_integrations_scopes, if_exists: true
|
||||
drop_table :slack_api_scopes, if_exists: true
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddReadCodeToMemberRoles < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
add_column :member_roles, :read_code, :boolean, default: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddMaxTerraformStateSizeBytesToApplicationSettings < Gitlab::Database::Migration[2.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
CONSTRAINT_NAME = "app_settings_max_terraform_state_size_bytes_check"
|
||||
|
||||
def up
|
||||
add_column(
|
||||
:application_settings,
|
||||
:max_terraform_state_size_bytes,
|
||||
:integer,
|
||||
null: false,
|
||||
default: 0,
|
||||
if_not_exists: true
|
||||
)
|
||||
|
||||
add_check_constraint :application_settings, "max_terraform_state_size_bytes >= 0", CONSTRAINT_NAME
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :application_settings, :max_terraform_state_size_bytes, if_exists: true
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddBulkImportEnabledToApplicationSettings < Gitlab::Database::Migration[2.1]
|
||||
def change
|
||||
add_column :application_settings, :bulk_import_enabled, :boolean, default: false, null: false
|
||||
end
|
||||
end
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateDastScannerProfilesRunnerTags < Gitlab::Database::Migration[2.1]
|
||||
def up
|
||||
create_table :dast_scanner_profiles_tags do |t|
|
||||
t.references :dast_scanner_profile, null: false, foreign_key: { on_delete: :cascade },
|
||||
index: { name: 'i_dast_scanner_profiles_tags_on_scanner_profiles_id' }
|
||||
|
||||
t.bigint :tag_id, null: false
|
||||
|
||||
t.index :tag_id, name: :index_dast_scanner_profiles_tags_on_tag_id
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :dast_scanner_profiles_tags
|
||||
end
|
||||
end
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoveConstraintsFromCiResourcesForPartitionId < Gitlab::Database::Migration[2.1]
|
||||
enable_lock_retries!
|
||||
|
||||
def up
|
||||
change_column_null :ci_resources, :partition_id, true
|
||||
end
|
||||
|
||||
def down
|
||||
# no-op
|
||||
# Adding back the not null constraint requires a long exclusive lock.
|
||||
# Also depending on when it gets called, it might not even be possible to
|
||||
# execute because the application could have inserted null values.
|
||||
end
|
||||
end
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class UpdateImportSourcesOnApplicationSettings < Gitlab::Database::Migration[2.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
|
||||
class ApplicationSetting < MigrationRecord
|
||||
end
|
||||
|
||||
def up
|
||||
return if import_sources.empty?
|
||||
|
||||
new_sources = import_sources - ['google_code']
|
||||
ApplicationSetting.update_all(import_sources: new_sources.to_yaml)
|
||||
end
|
||||
|
||||
def down
|
||||
## a reversion is not needed as google_code is no longer a supported import source
|
||||
# and attempting to save it as one will result in a ActiveRecord error.
|
||||
end
|
||||
|
||||
def import_sources
|
||||
## the last ApplicationSetting record is used to determine application settings
|
||||
import_sources = ApplicationSetting.last&.import_sources
|
||||
import_sources.nil? ? [] : YAML.safe_load(import_sources)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# This fixes 20221209110934_update_import_sources_on_application_settings.rb, which
|
||||
# previously serialized a YAML column into a string.
|
||||
class FixUpdateImportSourcesOnApplicationSettings < Gitlab::Database::Migration[2.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
|
||||
class ApplicationSetting < MigrationRecord
|
||||
end
|
||||
|
||||
def up
|
||||
sources = ApplicationSetting.last&.import_sources
|
||||
|
||||
return unless sources.is_a?(String)
|
||||
return if sources.start_with?('---')
|
||||
|
||||
sources = YAML.safe_load(sources)
|
||||
|
||||
ApplicationSetting.update_all(import_sources: sources.to_yaml)
|
||||
end
|
||||
|
||||
def down; end
|
||||
end
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoveSbomOccurrencesUniqueIndex < Gitlab::Database::Migration[2.1]
|
||||
INDEX_NAME = 'index_sbom_occurrences_on_ingestion_attributes'
|
||||
ATTRIBUTES = %i[
|
||||
project_id
|
||||
component_id
|
||||
component_version_id
|
||||
source_id
|
||||
commit_sha
|
||||
].freeze
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
remove_concurrent_index_by_name :sbom_occurrences, name: INDEX_NAME
|
||||
end
|
||||
|
||||
def down
|
||||
add_concurrent_index :sbom_occurrences, ATTRIBUTES, unique: true, name: INDEX_NAME
|
||||
end
|
||||
end
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class TruncateSbomOccurrences < Gitlab::Database::Migration[2.1]
|
||||
def up
|
||||
# Because existing data in the table violates the new
|
||||
# uniqueness constraints, we need to remove the non-distinct rows.
|
||||
# Rather than do an expensive and error-prone batch migration
|
||||
# to find and remove the duplicates, we'll just remove all records
|
||||
# from the table.
|
||||
#
|
||||
# The `cyclonedx_sbom_ingestion` feature flag should
|
||||
# be OFF in all environments to avoid having more duplicate records
|
||||
# added between this migration and the one where the new unqiue index
|
||||
# is added.
|
||||
|
||||
# TRUNCATE is a DDL statement (it drops the table and re-creates it), so we want to run the
|
||||
# migration in DDL mode, but we also don't want to execute it against all schemas because
|
||||
# it's considered a write operation. So, we'll manually check and skip the migration if
|
||||
# it's on not `:gitlab_main`.
|
||||
return unless Gitlab::Database.gitlab_schemas_for_connection(connection).include?(:gitlab_main)
|
||||
|
||||
execute('TRUNCATE sbom_occurrences')
|
||||
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