diff --git a/.rubocop_todo/layout/first_array_element_indentation.yml b/.rubocop_todo/layout/first_array_element_indentation.yml index c4604dbe948..e3bbf9dc25a 100644 --- a/.rubocop_todo/layout/first_array_element_indentation.yml +++ b/.rubocop_todo/layout/first_array_element_indentation.yml @@ -281,7 +281,6 @@ Layout/FirstArrayElementIndentation: - 'spec/models/ci/pipeline_spec.rb' - 'spec/models/ci/unit_test_spec.rb' - 'spec/models/clusters/applications/cert_manager_spec.rb' - - 'spec/models/clusters/applications/elastic_stack_spec.rb' - 'spec/models/clusters/platforms/kubernetes_spec.rb' - 'spec/models/commit_collection_spec.rb' - 'spec/models/compare_spec.rb' diff --git a/.rubocop_todo/layout/space_inside_block_braces.yml b/.rubocop_todo/layout/space_inside_block_braces.yml index ee78265ce26..4f9e7086d6a 100644 --- a/.rubocop_todo/layout/space_inside_block_braces.yml +++ b/.rubocop_todo/layout/space_inside_block_braces.yml @@ -264,7 +264,6 @@ Layout/SpaceInsideBlockBraces: - 'lib/gitlab/contributions_calendar.rb' - 'lib/gitlab/database/migrations/test_background_runner.rb' - 'lib/gitlab/database/postgres_hll/buckets.rb' - - 'lib/gitlab/elasticsearch/logs/lines.rb' - 'lib/gitlab/email/message/in_product_marketing/helper.rb' - 'lib/gitlab/issues/rebalancing/state.rb' - 'lib/gitlab/profiler.rb' @@ -552,7 +551,6 @@ Layout/SpaceInsideBlockBraces: - 'spec/models/ci/pipeline_schedule_spec.rb' - 'spec/models/ci/pipeline_spec.rb' - 'spec/models/ci/runner_spec.rb' - - 'spec/models/clusters/applications/elastic_stack_spec.rb' - 'spec/models/clusters/cluster_spec.rb' - 'spec/models/commit_status_spec.rb' - 'spec/models/concerns/chronic_duration_attribute_spec.rb' diff --git a/.rubocop_todo/rails/file_path.yml b/.rubocop_todo/rails/file_path.yml index 10e82ea44ae..467073eb2db 100644 --- a/.rubocop_todo/rails/file_path.yml +++ b/.rubocop_todo/rails/file_path.yml @@ -8,7 +8,6 @@ Rails/FilePath: - 'app/controllers/help_controller.rb' - 'app/helpers/startupjs_helper.rb' - 'app/models/clusters/applications/cert_manager.rb' - - 'app/models/clusters/applications/elastic_stack.rb' - 'app/models/clusters/concerns/application_data.rb' - 'app/models/concerns/cross_database_modification.rb' - 'app/models/release_highlight.rb' diff --git a/.rubocop_todo/rails/inverse_of.yml b/.rubocop_todo/rails/inverse_of.yml index 7a757ec8a9d..98d116c3319 100644 --- a/.rubocop_todo/rails/inverse_of.yml +++ b/.rubocop_todo/rails/inverse_of.yml @@ -31,7 +31,6 @@ Rails/InverseOf: - 'app/models/clusters/applications/runner.rb' - 'app/models/clusters/cluster.rb' - 'app/models/clusters/concerns/application_core.rb' - - 'app/models/clusters/integrations/elastic_stack.rb' - 'app/models/clusters/integrations/prometheus.rb' - 'app/models/clusters/project.rb' - 'app/models/commit_signatures/x509_commit_signature.rb' diff --git a/.rubocop_todo/rails/redundant_foreign_key.yml b/.rubocop_todo/rails/redundant_foreign_key.yml index db6e6cedc89..7e394849670 100644 --- a/.rubocop_todo/rails/redundant_foreign_key.yml +++ b/.rubocop_todo/rails/redundant_foreign_key.yml @@ -19,7 +19,6 @@ Rails/RedundantForeignKey: - 'app/models/ci/unit_test_failure.rb' - 'app/models/clusters/applications/runner.rb' - 'app/models/clusters/concerns/application_core.rb' - - 'app/models/clusters/integrations/elastic_stack.rb' - 'app/models/clusters/integrations/prometheus.rb' - 'app/models/commit_signatures/x509_commit_signature.rb' - 'app/models/concerns/analytics/cycle_analytics/stage.rb' diff --git a/.rubocop_todo/rspec/context_wording.yml b/.rubocop_todo/rspec/context_wording.yml index bc0aa3a98d6..7053cc09372 100644 --- a/.rubocop_todo/rspec/context_wording.yml +++ b/.rubocop_todo/rspec/context_wording.yml @@ -2640,7 +2640,6 @@ RSpec/ContextWording: - 'spec/models/clusters/agent_spec.rb' - 'spec/models/clusters/applications/cert_manager_spec.rb' - 'spec/models/clusters/applications/crossplane_spec.rb' - - 'spec/models/clusters/applications/elastic_stack_spec.rb' - 'spec/models/clusters/applications/helm_spec.rb' - 'spec/models/clusters/applications/ingress_spec.rb' - 'spec/models/clusters/applications/jupyter_spec.rb' diff --git a/.rubocop_todo/style/percent_literal_delimiters.yml b/.rubocop_todo/style/percent_literal_delimiters.yml index 3cafeba93fd..cd8a41669bb 100644 --- a/.rubocop_todo/style/percent_literal_delimiters.yml +++ b/.rubocop_todo/style/percent_literal_delimiters.yml @@ -165,8 +165,6 @@ Style/PercentLiteralDelimiters: - 'app/services/merge_requests/update_service.rb' - 'app/services/metrics/dashboard/default_embed_service.rb' - 'app/services/packages/debian/generate_distribution_service.rb' - - 'app/services/pod_logs/base_service.rb' - - 'app/services/pod_logs/elasticsearch_service.rb' - 'app/services/preview_markdown_service.rb' - 'app/services/projects/apple_target_platform_detector_service.rb' - 'app/services/projects/container_repository/cleanup_tags_service.rb' @@ -673,7 +671,6 @@ Style/PercentLiteralDelimiters: - 'spec/factories/ci/runners.rb' - 'spec/factories/clusters/applications/helm.rb' - 'spec/factories/clusters/clusters.rb' - - 'spec/factories/clusters/integrations/elastic_stack.rb' - 'spec/factories/clusters/integrations/prometheus.rb' - 'spec/factories/clusters/providers/aws.rb' - 'spec/factories/deployments.rb' diff --git a/app/assets/stylesheets/page_bundles/project.scss b/app/assets/stylesheets/page_bundles/project.scss index 0bc3cc6678c..eec5ebdb383 100644 --- a/app/assets/stylesheets/page_bundles/project.scss +++ b/app/assets/stylesheets/page_bundles/project.scss @@ -128,10 +128,6 @@ > li { display: inline-block; - &:not(:last-child) { - margin-right: $gl-padding; - } - &.right { vertical-align: top; margin-top: 0; @@ -179,7 +175,6 @@ } .btn { - margin-bottom: $gl-padding-8; padding: $gl-btn-vert-padding $gl-btn-padding; line-height: $gl-btn-line-height; @@ -190,12 +185,6 @@ } } -.project-buttons { - .nav > li:not(:last-child) { - margin-right: $gl-padding-8; - } -} - .git-empty { margin-bottom: 7px; diff --git a/app/helpers/users/callouts_helper.rb b/app/helpers/users/callouts_helper.rb index b8231b02ac1..87c8bf5cb28 100644 --- a/app/helpers/users/callouts_helper.rb +++ b/app/helpers/users/callouts_helper.rb @@ -9,7 +9,6 @@ module Users FEATURE_FLAGS_NEW_VERSION = 'feature_flags_new_version' REGISTRATION_ENABLED_CALLOUT = 'registration_enabled_callout' UNFINISHED_TAG_CLEANUP_CALLOUT = 'unfinished_tag_cleanup_callout' - MINUTE_LIMIT_BANNER = 'minute_limit_banner' SECURITY_NEWSLETTER_CALLOUT = 'security_newsletter_callout' REGISTRATION_ENABLED_CALLOUT_ALLOWED_CONTROLLER_PATHS = [/^root/, /^dashboard\S*/, /^admin\S*/].freeze @@ -61,10 +60,6 @@ module Users !user_dismissed?(SECURITY_NEWSLETTER_CALLOUT) end - def minute_limit_banner_dismissed? - user_dismissed?(MINUTE_LIMIT_BANNER) - end - private def user_dismissed?(feature_name, ignore_dismissal_earlier_than = nil) diff --git a/app/models/users/callout.rb b/app/models/users/callout.rb index 0a1b4d0b783..570e3ae9b3c 100644 --- a/app/models/users/callout.rb +++ b/app/models/users/callout.rb @@ -49,7 +49,9 @@ module Users storage_enforcement_banner_fourth_enforcement_threshold: 46, attention_requests_top_nav: 47, attention_requests_side_nav: 48, - minute_limit_banner: 49, + # 49 was removed with https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91533 + # because the banner was no longer relevant. + # Records will be migrated with https://gitlab.com/gitlab-org/gitlab/-/issues/367293 preview_user_over_limit_free_plan_alert: 50, # EE-only user_reached_limit_free_plan_alert: 51, # EE-only submit_license_usage_data_banner: 52, # EE-only diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 647b4e787c6..63c60f5a89e 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -316,6 +316,7 @@ class WikiPage end def update_front_matter(attrs) + return unless Gitlab::WikiPages::FrontMatterParser.enabled?(container) return unless attrs.has_key?(:front_matter) fm_yaml = serialize_front_matter(attrs[:front_matter]) @@ -326,7 +327,7 @@ class WikiPage def parsed_content strong_memoize(:parsed_content) do - Gitlab::WikiPages::FrontMatterParser.new(raw_content).parse + Gitlab::WikiPages::FrontMatterParser.new(raw_content, container).parse end end diff --git a/app/views/projects/_files.html.haml b/app/views/projects/_files.html.haml index bea5d548e03..cc96a084b03 100644 --- a/app/views/projects/_files.html.haml +++ b/app/views/projects/_files.html.haml @@ -16,7 +16,7 @@ #js-code-owners - if is_project_overview - .project-buttons.gl-mb-3.js-show-on-project-root + .project-buttons.gl-mb-5.js-show-on-project-root = render 'stat_anchor_list', anchors: @project.statistics_buttons(show_auto_devops_callout: show_auto_devops_callout), project_buttons: true #js-tree-list{ data: vue_file_list_data(project, ref) } diff --git a/app/views/projects/_stat_anchor_list.html.haml b/app/views/projects/_stat_anchor_list.html.haml index 13ff8abe499..4a21cb32c20 100644 --- a/app/views/projects/_stat_anchor_list.html.haml +++ b/app/views/projects/_stat_anchor_list.html.haml @@ -2,7 +2,7 @@ - project_buttons = local_assigns.fetch(:project_buttons, false) - return unless anchors.any? -%ul.nav +%ul.nav.gl-gap-3 - anchors.each do |anchor| %li.nav-item = link_to_if(anchor.link, anchor.label, anchor.link, stat_anchor_attrs(anchor)) do diff --git a/app/views/projects/activity.html.haml b/app/views/projects/activity.html.haml index e69c4f51ec4..6a4760c3954 100644 --- a/app/views/projects/activity.html.haml +++ b/app/views/projects/activity.html.haml @@ -1,5 +1,4 @@ - page_title _("Activity") -= render_if_exists 'shared/minute_limit_banner', namespace: @project = render 'projects/last_push' = render 'projects/activity' diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index d61f359294a..a7dd69a9607 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -5,8 +5,6 @@ - expanded = expanded_by_default? - reduce_visibility_form_id = 'reduce-visibility-form' -= render_if_exists 'shared/minute_limit_banner', namespace: @project - %section.settings.general-settings.no-animate.expanded#js-general-settings .settings-header %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only= _('Naming, topics, avatar') diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml index dd63e854a36..647464b31f8 100644 --- a/app/views/projects/labels/index.html.haml +++ b/app/views/projects/labels/index.html.haml @@ -4,7 +4,6 @@ - subscribed = params[:subscribed] - labels_or_filters = @labels.exists? || @prioritized_labels.exists? || search.present? || subscribed.present? -= render_if_exists 'shared/minute_limit_banner', namespace: @project - if labels_or_filters #js-promote-label-modal = render 'shared/labels/nav', labels_or_filters: labels_or_filters, can_admin_label: can_admin_label diff --git a/app/views/projects/project_members/index.html.haml b/app/views/projects/project_members/index.html.haml index 7e2dfc94bb4..37fe80d2aaf 100644 --- a/app/views/projects/project_members/index.html.haml +++ b/app/views/projects/project_members/index.html.haml @@ -2,7 +2,6 @@ - page_title _("Members") = render_if_exists 'projects/free_user_cap_alert', project: @project -= render_if_exists 'shared/minute_limit_banner', namespace: @project .row.gl-mt-3 .col-lg-12 diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 290ef79f261..1f529849b28 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -7,7 +7,6 @@ = auto_discovery_link_tag(:atom, project_path(@project, rss_url_options), title: "#{@project.name} activity") = render_if_exists 'projects/free_user_cap_alert', project: @project -= render_if_exists 'shared/minute_limit_banner', namespace: @project = render partial: 'flash_messages', locals: { project: @project } = render 'clusters_deprecation_alert' diff --git a/config/feature_flags/development/show_minute_limit_banner.yml b/config/feature_flags/development/show_minute_limit_banner.yml deleted file mode 100644 index ecf9d98bea2..00000000000 --- a/config/feature_flags/development/show_minute_limit_banner.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: show_minute_limit_banner -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/84644 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/358191 -milestone: '14.10' -type: development -group: group::workspace -default_enabled: false diff --git a/config/feature_flags/development/wiki_front_matter.yml b/config/feature_flags/development/wiki_front_matter.yml new file mode 100644 index 00000000000..39196440d17 --- /dev/null +++ b/config/feature_flags/development/wiki_front_matter.yml @@ -0,0 +1,8 @@ +--- +name: wiki_front_matter +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/27706 +rollout_issue_url: +milestone: '12.10' +type: development +group: group::editor +default_enabled: false diff --git a/db/docs/clusters_applications_elastic_stacks.yml b/db/docs/clusters_applications_elastic_stacks.yml deleted file mode 100644 index 97943a9516b..00000000000 --- a/db/docs/clusters_applications_elastic_stacks.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -table_name: clusters_applications_elastic_stacks -classes: -- Clusters::Applications::ElasticStack -feature_categories: -- kubernetes_management -description: (Deprecated) A GitLab managed Elastic Stack installation in a Kubernetes cluster -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18015 -milestone: '12.5' diff --git a/db/docs/clusters_integration_elasticstack.yml b/db/docs/clusters_integration_elasticstack.yml deleted file mode 100644 index 2c2261a53e2..00000000000 --- a/db/docs/clusters_integration_elasticstack.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -table_name: clusters_integration_elasticstack -classes: -- Clusters::Integrations::ElasticStack -feature_categories: -- configure -description: TODO -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61077 -milestone: '13.12' diff --git a/db/post_migrate/20220706065245_remove_foreign_key_in_clusters_applications_elastic_stacks.rb b/db/post_migrate/20220706065245_remove_foreign_key_in_clusters_applications_elastic_stacks.rb new file mode 100644 index 00000000000..bfe60099bfa --- /dev/null +++ b/db/post_migrate/20220706065245_remove_foreign_key_in_clusters_applications_elastic_stacks.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveForeignKeyInClustersApplicationsElasticStacks < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_elastic_stacks, column: :cluster_id) + end + end + + def down + add_concurrent_foreign_key :clusters_applications_elastic_stacks, :clusters, + column: :cluster_id, on_delete: :cascade, name: 'fk_rails_026f219f46' + end +end diff --git a/db/post_migrate/20220706065611_remove_foreign_key_in_clusters_integration_elasticstack.rb b/db/post_migrate/20220706065611_remove_foreign_key_in_clusters_integration_elasticstack.rb new file mode 100644 index 00000000000..eeec465f6b9 --- /dev/null +++ b/db/post_migrate/20220706065611_remove_foreign_key_in_clusters_integration_elasticstack.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveForeignKeyInClustersIntegrationElasticstack < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_integration_elasticstack, column: :cluster_id) + end + end + + def down + add_concurrent_foreign_key :clusters_integration_elasticstack, :clusters, + column: :cluster_id, on_delete: :cascade, name: 'fk_rails_cc5ba8f658' + end +end diff --git a/db/post_migrate/20220706070804_drop_clusters_applications_elastic_stacks_table.rb b/db/post_migrate/20220706070804_drop_clusters_applications_elastic_stacks_table.rb new file mode 100644 index 00000000000..cedf666e428 --- /dev/null +++ b/db/post_migrate/20220706070804_drop_clusters_applications_elastic_stacks_table.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DropClustersApplicationsElasticStacksTable < Gitlab::Database::Migration[2.0] + def up + drop_table :clusters_applications_elastic_stacks + end + + def down + create_table :clusters_applications_elastic_stacks do |t| + t.timestamps_with_timezone null: false + t.references :cluster, type: :bigint, null: false, index: { unique: true } + t.integer :status, null: false + t.string :version, null: false, limit: 255 + t.text :status_reason + end + end +end diff --git a/db/post_migrate/20220706071304_drop_clusters_integration_elasticstack_table.rb b/db/post_migrate/20220706071304_drop_clusters_integration_elasticstack_table.rb new file mode 100644 index 00000000000..206652b5dcf --- /dev/null +++ b/db/post_migrate/20220706071304_drop_clusters_integration_elasticstack_table.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class DropClustersIntegrationElasticstackTable < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_clusters_integration_elasticstack_enabled' + + def up + drop_table :clusters_integration_elasticstack + end + + def down + create_table :clusters_integration_elasticstack, id: false do |t| + t.timestamps_with_timezone null: false + t.references :cluster, primary_key: true, type: :bigint, default: nil, index: false + t.boolean :enabled, null: false, default: false + t.text :chart_version, limit: 10 + end + + add_concurrent_index(:clusters_integration_elasticstack, [:enabled, :created_at, :cluster_id], name: INDEX_NAME) + end +end diff --git a/db/schema_migrations/20220706065245 b/db/schema_migrations/20220706065245 new file mode 100644 index 00000000000..46abcb3e7c8 --- /dev/null +++ b/db/schema_migrations/20220706065245 @@ -0,0 +1 @@ +3583de8dc55a1e9835b64542bb11a94084d34c2409f63cd7e402bd3c5c0009ef \ No newline at end of file diff --git a/db/schema_migrations/20220706065611 b/db/schema_migrations/20220706065611 new file mode 100644 index 00000000000..24b6523f24f --- /dev/null +++ b/db/schema_migrations/20220706065611 @@ -0,0 +1 @@ +eab26142f1314caa9ff6a6f07b6c787d276653d9bf6702bce9355c0e9605a909 \ No newline at end of file diff --git a/db/schema_migrations/20220706070804 b/db/schema_migrations/20220706070804 new file mode 100644 index 00000000000..08943e8fe00 --- /dev/null +++ b/db/schema_migrations/20220706070804 @@ -0,0 +1 @@ +7bf55a7614afcb210b22df1ea38cf16fde9510bbe66d9b19f0fb63d668ac4e72 \ No newline at end of file diff --git a/db/schema_migrations/20220706071304 b/db/schema_migrations/20220706071304 new file mode 100644 index 00000000000..e2e0ba301e5 --- /dev/null +++ b/db/schema_migrations/20220706071304 @@ -0,0 +1 @@ +ed72bfafe1c04826ce57b9068c537df563bc193f231f4f223348b084c68a8bde \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index d958a5b0e2b..10a04c13a76 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -13619,25 +13619,6 @@ CREATE SEQUENCE clusters_applications_crossplane_id_seq ALTER SEQUENCE clusters_applications_crossplane_id_seq OWNED BY clusters_applications_crossplane.id; -CREATE TABLE clusters_applications_elastic_stacks ( - id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - cluster_id bigint NOT NULL, - status integer NOT NULL, - version character varying(255) NOT NULL, - status_reason text -); - -CREATE SEQUENCE clusters_applications_elastic_stacks_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_elastic_stacks_id_seq OWNED BY clusters_applications_elastic_stacks.id; - CREATE TABLE clusters_applications_helm ( id integer NOT NULL, cluster_id integer NOT NULL, @@ -13779,15 +13760,6 @@ CREATE SEQUENCE clusters_id_seq ALTER SEQUENCE clusters_id_seq OWNED BY clusters.id; -CREATE TABLE clusters_integration_elasticstack ( - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - cluster_id bigint NOT NULL, - enabled boolean DEFAULT false NOT NULL, - chart_version text, - CONSTRAINT check_f8d671ce04 CHECK ((char_length(chart_version) <= 10)) -); - CREATE TABLE clusters_integration_prometheus ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, @@ -22925,8 +22897,6 @@ ALTER TABLE ONLY clusters_applications_cilium ALTER COLUMN id SET DEFAULT nextva ALTER TABLE ONLY clusters_applications_crossplane ALTER COLUMN id SET DEFAULT nextval('clusters_applications_crossplane_id_seq'::regclass); -ALTER TABLE ONLY clusters_applications_elastic_stacks ALTER COLUMN id SET DEFAULT nextval('clusters_applications_elastic_stacks_id_seq'::regclass); - ALTER TABLE ONLY clusters_applications_helm ALTER COLUMN id SET DEFAULT nextval('clusters_applications_helm_id_seq'::regclass); ALTER TABLE ONLY clusters_applications_ingress ALTER COLUMN id SET DEFAULT nextval('clusters_applications_ingress_id_seq'::regclass); @@ -24687,9 +24657,6 @@ ALTER TABLE ONLY clusters_applications_cilium ALTER TABLE ONLY clusters_applications_crossplane ADD CONSTRAINT clusters_applications_crossplane_pkey PRIMARY KEY (id); -ALTER TABLE ONLY clusters_applications_elastic_stacks - ADD CONSTRAINT clusters_applications_elastic_stacks_pkey PRIMARY KEY (id); - ALTER TABLE ONLY clusters_applications_helm ADD CONSTRAINT clusters_applications_helm_pkey PRIMARY KEY (id); @@ -24708,9 +24675,6 @@ ALTER TABLE ONLY clusters_applications_prometheus ALTER TABLE ONLY clusters_applications_runners ADD CONSTRAINT clusters_applications_runners_pkey PRIMARY KEY (id); -ALTER TABLE ONLY clusters_integration_elasticstack - ADD CONSTRAINT clusters_integration_elasticstack_pkey PRIMARY KEY (cluster_id); - ALTER TABLE ONLY clusters_integration_prometheus ADD CONSTRAINT clusters_integration_prometheus_pkey PRIMARY KEY (cluster_id); @@ -27812,8 +27776,6 @@ CREATE UNIQUE INDEX index_clusters_applications_cilium_on_cluster_id ON clusters CREATE UNIQUE INDEX index_clusters_applications_crossplane_on_cluster_id ON clusters_applications_crossplane USING btree (cluster_id); -CREATE UNIQUE INDEX index_clusters_applications_elastic_stacks_on_cluster_id ON clusters_applications_elastic_stacks USING btree (cluster_id); - CREATE UNIQUE INDEX index_clusters_applications_helm_on_cluster_id ON clusters_applications_helm USING btree (cluster_id); CREATE UNIQUE INDEX index_clusters_applications_ingress_on_cluster_id ON clusters_applications_ingress USING btree (cluster_id); @@ -27830,8 +27792,6 @@ CREATE UNIQUE INDEX index_clusters_applications_runners_on_cluster_id ON cluster CREATE INDEX index_clusters_applications_runners_on_runner_id ON clusters_applications_runners USING btree (runner_id); -CREATE INDEX index_clusters_integration_elasticstack_enabled ON clusters_integration_elasticstack USING btree (enabled, created_at, cluster_id); - CREATE INDEX index_clusters_integration_prometheus_enabled ON clusters_integration_prometheus USING btree (enabled, created_at, cluster_id); CREATE INDEX index_clusters_kubernetes_namespaces_on_cluster_project_id ON clusters_kubernetes_namespaces USING btree (cluster_project_id); @@ -32514,9 +32474,6 @@ ALTER TABLE ONLY approval_merge_request_rules ALTER TABLE ONLY namespace_statistics ADD CONSTRAINT fk_rails_0062050394 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY clusters_applications_elastic_stacks - ADD CONSTRAINT fk_rails_026f219f46 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; - ALTER TABLE ONLY incident_management_oncall_participants ADD CONSTRAINT fk_rails_032b12996a FOREIGN KEY (oncall_rotation_id) REFERENCES incident_management_oncall_rotations(id) ON DELETE CASCADE; @@ -33777,9 +33734,6 @@ ALTER TABLE ONLY boards_epic_board_positions ALTER TABLE ONLY vulnerability_finding_links ADD CONSTRAINT fk_rails_cbdfde27ce FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; -ALTER TABLE ONLY clusters_integration_elasticstack - ADD CONSTRAINT fk_rails_cc5ba8f658 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; - ALTER TABLE ONLY issues_self_managed_prometheus_alert_events ADD CONSTRAINT fk_rails_cc5d88bbb0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index e93fa43cb03..ed9842870cd 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -20159,7 +20159,6 @@ Name of the feature that the callout is for. | `GEO_MIGRATE_HASHED_STORAGE` | Callout feature name for geo_migrate_hashed_storage. | | `GKE_CLUSTER_INTEGRATION` | Callout feature name for gke_cluster_integration. | | `GOLD_TRIAL_BILLINGS` | Callout feature name for gold_trial_billings. | -| `MINUTE_LIMIT_BANNER` | Callout feature name for minute_limit_banner. | | `MR_EXPERIENCE_SURVEY` | Callout feature name for mr_experience_survey. | | `NEW_USER_SIGNUPS_CAP_REACHED` | Callout feature name for new_user_signups_cap_reached. | | `PERSONAL_ACCESS_TOKEN_EXPIRY` | Callout feature name for personal_access_token_expiry. | diff --git a/doc/development/service_ping/index.md b/doc/development/service_ping/index.md index 0be7097cc31..dd99efc64c8 100644 --- a/doc/development/service_ping/index.md +++ b/doc/development/service_ping/index.md @@ -133,9 +133,7 @@ On GitLab.com, this feature is available. {"name"=>"counts.clusters_platforms_user", "time_elapsed"=>0.06410990096628666}, {"name"=>"counts.clusters_management_project", - "time_elapsed"=>0.24020783510059118}, - {"name"=>"counts.clusters_integrations_elastic_stack", - "time_elapsed"=>0.03484998410567641} + "time_elapsed"=>0.24020783510059118} ] } } diff --git a/doc/development/service_ping/troubleshooting.md b/doc/development/service_ping/troubleshooting.md index 99dab8fb21d..29ab334f867 100644 --- a/doc/development/service_ping/troubleshooting.md +++ b/doc/development/service_ping/troubleshooting.md @@ -26,6 +26,16 @@ You can use [this query](https://gitlab.com/gitlab-org/gitlab/-/issues/347298#no For results about an investigation conducted into an unexpected drop in Service ping Payload events volume, see [this issue](https://gitlab.com/gitlab-data/analytics/-/issues/11071). +### Troubleshoot VersionApp layer + +Check if the [export jobs](https://gitlab.com/gitlab-services/version-gitlab-com#data-export-using-pipeline-schedules) are successful. + +Check [Service Ping errors](https://app.periscopedata.com/app/gitlab/968489/Product-Intelligence---Service-Ping-Health?widget=14609989&udv=0) in the [Service Ping Health Dahsboard](https://app.periscopedata.com/app/gitlab/968489/Product-Intelligence---Service-Ping-Health). + +### Troubleshoot Google Storage layer + +Check if the files are present in [Google Storage](https://console.cloud.google.com/storage/browser/cloudsql-gs-production-efd5e8-cloudsql-exports;tab=objects?project=gs-production-efd5e8&prefix=&forceOnObjectsSortingFiltering=false). + ### Troubleshoot the data warehouse layer Reach out to the [Data team](https://about.gitlab.com/handbook/business-technology/data-team/) to ask about current state of data warehouse. On their handbook page there is a [section with contact details](https://about.gitlab.com/handbook/business-technology/data-team/#how-to-connect-with-us). diff --git a/doc/user/application_security/index.md b/doc/user/application_security/index.md index d685f9328c8..218799ac217 100644 --- a/doc/user/application_security/index.md +++ b/doc/user/application_security/index.md @@ -252,15 +252,6 @@ security issues: - A software license compliance violation. For more details, read [Enabling license approvals within a project](../compliance/license_compliance/index.md#enabling-license-approvals-within-a-project). -### Migration of existing Vulnerability-Check rules - -If your projects have rules that have a security orchestration project, a new MR with -the existing rule's content is created automatically against the default branch belonging -to the security orchestration project. To maintain the same security approval rules you -had before GitLab 15.0, we recommend merging this new MR. - -If your projects have rules without a security orchestration project, a new security orchestration project is created automatically with the content of the existing rule. No additional action is required. - ## Using private Maven repositories If you have a private Apache Maven repository that requires login credentials, diff --git a/lib/gitlab/database/gitlab_schemas.yml b/lib/gitlab/database/gitlab_schemas.yml index 8c2f3be5c19..f443ca92eb2 100644 --- a/lib/gitlab/database/gitlab_schemas.yml +++ b/lib/gitlab/database/gitlab_schemas.yml @@ -133,7 +133,6 @@ cluster_providers_gcp: :gitlab_main clusters_applications_cert_managers: :gitlab_main clusters_applications_cilium: :gitlab_main clusters_applications_crossplane: :gitlab_main -clusters_applications_elastic_stacks: :gitlab_main clusters_applications_helm: :gitlab_main clusters_applications_ingress: :gitlab_main clusters_applications_jupyter: :gitlab_main @@ -141,7 +140,6 @@ clusters_applications_knative: :gitlab_main clusters_applications_prometheus: :gitlab_main clusters_applications_runners: :gitlab_main clusters: :gitlab_main -clusters_integration_elasticstack: :gitlab_main clusters_integration_prometheus: :gitlab_main clusters_kubernetes_namespaces: :gitlab_main commit_user_mentions: :gitlab_main diff --git a/lib/gitlab/wiki_pages/front_matter_parser.rb b/lib/gitlab/wiki_pages/front_matter_parser.rb index ee30fa907f4..071b0dde619 100644 --- a/lib/gitlab/wiki_pages/front_matter_parser.rb +++ b/lib/gitlab/wiki_pages/front_matter_parser.rb @@ -3,6 +3,8 @@ module Gitlab module WikiPages class FrontMatterParser + FEATURE_FLAG = :wiki_front_matter + # We limit the maximum length of text we are prepared to parse as YAML, to # avoid exploitations and attempts to consume memory and CPU. We allow for: # - a title line @@ -28,12 +30,18 @@ module Gitlab end # @param [String] wiki_content - def initialize(wiki_content) + # @param [FeatureGate] feature_gate The scope for feature availability + def initialize(wiki_content, feature_gate) @wiki_content = wiki_content + @feature_gate = feature_gate + end + + def self.enabled?(gate = nil) + Feature.enabled?(FEATURE_FLAG, gate) end def parse - return empty_result unless wiki_content.present? + return empty_result unless enabled? && wiki_content.present? return empty_result(block.error) unless block.valid? Result.new(front_matter: block.data, content: strip_front_matter_block) @@ -86,12 +94,16 @@ module Gitlab private - attr_reader :wiki_content + attr_reader :wiki_content, :feature_gate def empty_result(reason = nil, error = nil) Result.new(content: wiki_content, reason: reason, error: error) end + def enabled? + self.class.enabled?(feature_gate) + end + def block @block ||= parse_front_matter_block end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 2e724f48e71..703359154bd 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -5856,9 +5856,6 @@ msgstr "" msgid "Be careful. Renaming a project's repository can have unintended side effects." msgstr "" -msgid "Before July 1, 2022, all free tier public open source projects must %{enrollment_link} to continue to receive GitLab Ultimate benefits." -msgstr "" - msgid "Before enabling this integration, create a webhook for the room in Google Chat where you want to receive notifications from this project. %{docs_link}" msgstr "" @@ -7532,9 +7529,6 @@ msgstr "" msgid "Changes the title to \"%{title_param}\"." msgstr "" -msgid "Changes to free tier open source projects" -msgstr "" - msgid "Changes to the title have not been saved" msgstr "" @@ -16521,9 +16515,6 @@ msgstr "" msgid "For more information, go to the " msgstr "" -msgid "For more information, see the %{faq_link}." -msgstr "" - msgid "For more information, see the File Hooks documentation." msgstr "" diff --git a/spec/lib/gitlab/wiki_pages/front_matter_parser_spec.rb b/spec/lib/gitlab/wiki_pages/front_matter_parser_spec.rb index c0629c8d795..3152dc2ad2f 100644 --- a/spec/lib/gitlab/wiki_pages/front_matter_parser_spec.rb +++ b/spec/lib/gitlab/wiki_pages/front_matter_parser_spec.rb @@ -3,10 +3,11 @@ require 'spec_helper' RSpec.describe Gitlab::WikiPages::FrontMatterParser do - subject(:parser) { described_class.new(raw_content) } + subject(:parser) { described_class.new(raw_content, gate) } let(:content) { 'This is the content' } let(:end_divider) { '---' } + let(:gate) { stub_feature_flag_gate('Gate') } let(:with_front_matter) do <<~MD @@ -61,6 +62,32 @@ RSpec.describe Gitlab::WikiPages::FrontMatterParser do it { is_expected.to have_attributes(reason: :no_match) } end + context 'the feature flag is disabled' do + let(:raw_content) { with_front_matter } + + before do + stub_feature_flags(Gitlab::WikiPages::FrontMatterParser::FEATURE_FLAG => false) + end + + it { is_expected.to have_attributes(front_matter: be_empty, content: raw_content) } + end + + context 'the feature flag is enabled for the gated object' do + let(:raw_content) { with_front_matter } + + before do + stub_feature_flags(Gitlab::WikiPages::FrontMatterParser::FEATURE_FLAG => gate) + end + + it do + is_expected.to have_attributes( + front_matter: have_correct_front_matter, + content: content + "\n", + reason: be_nil + ) + end + end + context 'the end divider is ...' do let(:end_divider) { '...' } let(:raw_content) { with_front_matter } diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb index 51970064c54..96c396f085c 100644 --- a/spec/models/wiki_page_spec.rb +++ b/spec/models/wiki_page_spec.rb @@ -24,6 +24,14 @@ RSpec.describe WikiPage do container.wiki end + def disable_front_matter + stub_feature_flags(Gitlab::WikiPages::FrontMatterParser::FEATURE_FLAG => false) + end + + def enable_front_matter_for(thing) + stub_feature_flags(Gitlab::WikiPages::FrontMatterParser::FEATURE_FLAG => thing) + end + # Use for groups of tests that do not modify their `subject`. # # include_context 'subject is persisted page', title: 'my title' @@ -40,6 +48,12 @@ RSpec.describe WikiPage do it { expect(wiki_page).to have_attributes(front_matter: {}, content: content) } end + shared_examples 'a page with front-matter' do + let(:front_matter) { { title: 'Foo', slugs: %w[slug_a slug_b] } } + + it { expect(wiki_page.front_matter).to eq(front_matter) } + end + context 'the wiki page has front matter' do let(:content) do <<~MD @@ -54,13 +68,27 @@ RSpec.describe WikiPage do MD end - it 'has front-matter' do - expect(wiki_page.front_matter).to eq({ title: 'Foo', slugs: %w[slug_a slug_b] }) - end + it_behaves_like 'a page with front-matter' it 'strips the front matter from the content' do expect(wiki_page.content.strip).to eq('My actual content') end + + context 'the feature flag is off' do + before do + disable_front_matter + end + + it_behaves_like 'a page without front-matter' + + context 'but enabled for the container' do + before do + enable_front_matter_for(container) + end + + it_behaves_like 'a page with front-matter' + end + end end context 'the wiki page does not have front matter' do @@ -443,6 +471,29 @@ RSpec.describe WikiPage do end end + context 'the front-matter feature flag is not enabled' do + before do + disable_front_matter + end + + it 'does not update the front-matter' do + content = subject.content + subject.update(front_matter: { slugs: ['x'] }) + + page = wiki.find_page(subject.title) + + expect([subject, page]).to all(have_attributes(front_matter: be_empty, content: content)) + end + + context 'but it is enabled for the container' do + before do + enable_front_matter_for(container) + end + + it_behaves_like 'able to update front-matter' + end + end + it 'updates the wiki-page front-matter and content together' do content = 'totally new content' subject.update(content: content, front_matter: { slugs: ['x'] }) diff --git a/spec/support/shared_examples/models/clusters/elastic_stack_client_shared.rb b/spec/support/shared_examples/models/clusters/elastic_stack_client_shared.rb deleted file mode 100644 index 744262d79ea..00000000000 --- a/spec/support/shared_examples/models/clusters/elastic_stack_client_shared.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true - -# Input -# - factory: [:clusters_applications_elastic_stack, :clusters_integrations_elastic_stack] -RSpec.shared_examples 'cluster-based #elasticsearch_client' do |factory| - describe '#elasticsearch_client' do - context 'cluster is nil' do - subject { build(factory, cluster: nil) } - - it 'returns nil' do - expect(subject.cluster).to be_nil - expect(subject.elasticsearch_client).to be_nil - end - end - - context "cluster doesn't have kubeclient" do - let(:cluster) { create(:cluster) } - - subject { create(factory, cluster: cluster) } - - it 'returns nil' do - expect(subject.elasticsearch_client).to be_nil - end - end - - context 'cluster has kubeclient' do - let(:cluster) { create(:cluster, :project, :provided_by_gcp) } - let(:kubernetes_url) { subject.cluster.platform_kubernetes.api_url } - let(:kube_client) { subject.cluster.kubeclient.core_client } - - subject { create(factory, cluster: cluster) } - - before do - subject.cluster.platform_kubernetes.namespace = 'a-namespace' - stub_kubeclient_discover(cluster.platform_kubernetes.api_url) - - create(:cluster_kubernetes_namespace, - cluster: cluster, - cluster_project: cluster.cluster_project, - project: cluster.cluster_project.project) - end - - it 'creates proxy elasticsearch_client' do - expect(subject.elasticsearch_client).to be_instance_of(Elasticsearch::Transport::Client) - end - - it 'copies proxy_url, options and headers from kube client to elasticsearch_client' do - expect(Elasticsearch::Client) - .to(receive(:new)) - .with(url: a_valid_url, adapter: :net_http) - .and_call_original - - client = subject.elasticsearch_client - faraday_connection = client.transport.connections.first.connection - - expect(faraday_connection.headers["Authorization"]).to eq(kube_client.headers[:Authorization]) - expect(faraday_connection.ssl.cert_store).to be_instance_of(OpenSSL::X509::Store) - expect(faraday_connection.ssl.verify).to eq(1) - expect(faraday_connection.options.timeout).to be_nil - end - - context 'when cluster is not reachable' do - before do - allow(kube_client).to receive(:proxy_url).and_raise(Kubeclient::HttpError.new(401, 'Unauthorized', nil)) - end - - it 'returns nil' do - expect(subject.elasticsearch_client).to be_nil - end - end - - context 'when timeout is provided' do - it 'sets timeout in elasticsearch_client' do - client = subject.elasticsearch_client(timeout: 123) - faraday_connection = client.transport.connections.first.connection - - expect(faraday_connection.options.timeout).to eq(123) - end - end - end - end -end diff --git a/spec/tooling/danger/project_helper_spec.rb b/spec/tooling/danger/project_helper_spec.rb index f48ca5b8f8c..af3b5f62ee9 100644 --- a/spec/tooling/danger/project_helper_spec.rb +++ b/spec/tooling/danger/project_helper_spec.rb @@ -229,7 +229,6 @@ RSpec.describe Tooling::Danger::ProjectHelper do 'app/serializers/jira_connect/app_data_serializer.rb' | [:integrations_be, :backend] 'lib/api/github/entities.rb' | [:integrations_be, :backend] 'lib/api/v3/github.rb' | [:integrations_be, :backend] - 'app/models/clusters/integrations/elastic_stack.rb' | [:backend] 'app/controllers/clusters/integrations_controller.rb' | [:backend] 'app/services/clusters/integrations/prometheus_health_check_service.rb' | [:backend] 'app/graphql/types/alert_management/integration_type.rb' | [:backend]