diff --git a/app/controllers/groups/boards_controller.rb b/app/controllers/groups/boards_controller.rb index 6de77450a46..6fac6fcf426 100644 --- a/app/controllers/groups/boards_controller.rb +++ b/app/controllers/groups/boards_controller.rb @@ -11,8 +11,8 @@ class Groups::BoardsController < Groups::ApplicationController push_frontend_feature_flag(:board_multi_select, group, default_enabled: :yaml) push_frontend_feature_flag(:iteration_cadences, group, default_enabled: :yaml) experiment(:prominent_create_board_btn, subject: current_user) do |e| - e.use { } - e.try { } + e.control { } + e.candidate { } end.run end diff --git a/app/controllers/projects/boards_controller.rb b/app/controllers/projects/boards_controller.rb index adaa47b48cb..0170cff6160 100644 --- a/app/controllers/projects/boards_controller.rb +++ b/app/controllers/projects/boards_controller.rb @@ -11,8 +11,8 @@ class Projects::BoardsController < Projects::ApplicationController push_frontend_feature_flag(:board_multi_select, project, default_enabled: :yaml) push_frontend_feature_flag(:iteration_cadences, project&.group, default_enabled: :yaml) experiment(:prominent_create_board_btn, subject: current_user) do |e| - e.use { } - e.try { } + e.control { } + e.candidate { } end.run end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e88d1832480..7acf2220516 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -428,7 +428,7 @@ module ApplicationHelper experiment(:logged_out_marketing_header, actor: nil) do |e| html_class = 'logged-out-marketing-header-candidate' e.candidate { html_class } - e.try(:trial_focused) { html_class } + e.variant(:trial_focused) { html_class } e.control {} e.run end diff --git a/app/helpers/ide_helper.rb b/app/helpers/ide_helper.rb index 4d81aeca37a..bd1571f3956 100644 --- a/app/helpers/ide_helper.rb +++ b/app/helpers/ide_helper.rb @@ -34,7 +34,7 @@ module IdeHelper def enable_environments_guidance? experiment(:in_product_guidance_environments_webide, project: @project) do |e| - e.try { !has_dismissed_ide_environments_callout? } + e.candidate { !has_dismissed_ide_environments_callout? } e.run end diff --git a/app/helpers/learn_gitlab_helper.rb b/app/helpers/learn_gitlab_helper.rb index 6330b8fc829..7dfd9ed47e3 100644 --- a/app/helpers/learn_gitlab_helper.rb +++ b/app/helpers/learn_gitlab_helper.rb @@ -33,8 +33,8 @@ module LearnGitlabHelper actor: current_user, sticky_to: project.namespace ) do |e| - e.use { urls_to_use = action_urls } - e.try { urls_to_use = new_action_urls(project) } + e.control { urls_to_use = action_urls } + e.candidate { urls_to_use = new_action_urls(project) } end urls_to_use.to_h do |action, url| diff --git a/app/services/projects/container_repository/delete_tags_service.rb b/app/services/projects/container_repository/delete_tags_service.rb index 410cf6c624e..b4a57c70111 100644 --- a/app/services/projects/container_repository/delete_tags_service.rb +++ b/app/services/projects/container_repository/delete_tags_service.rb @@ -14,6 +14,7 @@ module Projects @tag_names = params[:tags] return error('not tags specified') if @tag_names.blank? + return error('repository importing') if @container_repository.migration_importing? delete_tags end diff --git a/app/views/projects/_new_project_fields.html.haml b/app/views/projects/_new_project_fields.html.haml index ac238878392..676af85b9d1 100644 --- a/app/views/projects/_new_project_fields.html.haml +++ b/app/views/projects/_new_project_fields.html.haml @@ -63,13 +63,13 @@ = s_('ProjectsNew|Allows you to immediately clone this project’s repository. Skip this if you plan to push up an existing repository.') - experiment(:new_project_sast_enabled, user: current_user) do |e| - - e.try(:candidate) do + - e.variant(:candidate) do = render 'new_project_initialize_with_sast', experiment_name: e.name, track_label: track_label, checked: true, with_free_badge: false - - e.try(:unchecked_candidate) do + - e.variant(:unchecked_candidate) do = render 'new_project_initialize_with_sast', experiment_name: e.name, track_label: track_label, checked: false, with_free_badge: false - - e.try(:free_indicator) do + - e.variant(:free_indicator) do = render 'new_project_initialize_with_sast', experiment_name: e.name, track_label: track_label, checked: true, with_free_badge: true - - e.try(:unchecked_free_indicator) do + - e.variant(:unchecked_free_indicator) do = render 'new_project_initialize_with_sast', experiment_name: e.name, track_label: track_label, checked: false, with_free_badge: true = f.submit _('Create project'), class: "btn gl-button btn-confirm", data: { track_label: "#{track_label}", track_action: "click_button", track_property: "create_project", track_value: "" } diff --git a/db/post_migrate/20220204053655_remove_index_epic_issues_on_epic_id.rb b/db/post_migrate/20220204053655_remove_index_epic_issues_on_epic_id.rb new file mode 100644 index 00000000000..7815829d36a --- /dev/null +++ b/db/post_migrate/20220204053655_remove_index_epic_issues_on_epic_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveIndexEpicIssuesOnEpicId < Gitlab::Database::Migration[1.0] + INDEX = 'index_epic_issues_on_epic_id' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :epic_issues, name: INDEX + end + + def down + add_concurrent_index :epic_issues, :epic_id, name: INDEX + end +end diff --git a/db/schema_migrations/20220204053655 b/db/schema_migrations/20220204053655 new file mode 100644 index 00000000000..e096dae0c07 --- /dev/null +++ b/db/schema_migrations/20220204053655 @@ -0,0 +1 @@ +d6b7fa6e5be83aa67bb479604bf6ddb9d8caae82fc8ea1ab7f34d5c534174ecf \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index a1cd7a08125..dad5942f213 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -26245,8 +26245,6 @@ CREATE UNIQUE INDEX index_epic_board_list_preferences_on_user_and_list ON boards CREATE UNIQUE INDEX index_epic_board_recent_visits_on_user_group_and_board ON boards_epic_board_recent_visits USING btree (user_id, group_id, epic_board_id); -CREATE INDEX index_epic_issues_on_epic_id ON epic_issues USING btree (epic_id); - CREATE INDEX index_epic_issues_on_epic_id_and_issue_id ON epic_issues USING btree (epic_id, issue_id); CREATE UNIQUE INDEX index_epic_issues_on_issue_id ON epic_issues USING btree (issue_id); diff --git a/doc/user/project/index.md b/doc/user/project/index.md index bee097cdcbe..801c2520bda 100644 --- a/doc/user/project/index.md +++ b/doc/user/project/index.md @@ -105,7 +105,6 @@ Projects include the following [features](https://about.gitlab.com/features/): - [License Compliance](../compliance/license_compliance/index.md): Approve and deny licenses for projects. **(ULTIMATE)** - [Dependency List](../application_security/dependency_list/index.md): View project dependencies. **(ULTIMATE)** - [Requirements](requirements/index.md): Create criteria to check your products against. **(ULTIMATE)** -- [Static Site Editor](static_site_editor/index.md): Edit content on static websites without prior knowledge of the codebase or Git commands. - [Code Intelligence](code_intelligence.md): Navigate code. ## Project integrations diff --git a/doc/user/project/static_site_editor/index.md b/doc/user/project/static_site_editor/index.md index 50b1a3a929d..072f5bf1927 100644 --- a/doc/user/project/static_site_editor/index.md +++ b/doc/user/project/static_site_editor/index.md @@ -12,6 +12,14 @@ description: "The static site editor enables users to edit content on static web > - WYSIWYG editor [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/214559) in GitLab 13.0. > - Non-Markdown content blocks not editable on the WYSIWYG mode [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/216836) in GitLab 13.3. > - Formatting Markdown [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49052) in GitLab 13.7. +> - [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77246) in GitLab 14.7. + +WARNING: +This feature is in its end-of-life process. It is +[deprecated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77246) +for use in GitLab 14.7, and is planned for +[removal](https://gitlab.com/groups/gitlab-org/-/epics/7351) in GitLab 15.0. +Users should instead use the [Web Editor](../repository/web_editor.md) or [Web IDE](../web_ide/index.md). Static Site Editor (SSE) enables users to edit content on static websites without prior knowledge of the underlying templating language, site architecture, or diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index b07b9c79858..a6491d23bf5 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -435,10 +435,6 @@ module Gitlab @utc_date_regex ||= /\A[0-9]{4}-[0-9]{2}-[0-9]{2}\z/.freeze end - def merge_request_wip - /(?i)(\[WIP\]\s*|WIP:\s*|\AWIP\z)/ - end - def merge_request_draft /\A(?i)(\[draft\]|\(draft\)|draft:)/ end diff --git a/spec/experiments/application_experiment_spec.rb b/spec/experiments/application_experiment_spec.rb index 7c2b5382c42..8e06c06a5d1 100644 --- a/spec/experiments/application_experiment_spec.rb +++ b/spec/experiments/application_experiment_spec.rb @@ -359,8 +359,8 @@ RSpec.describe ApplicationExperiment, :experiment do end it "returns an assigned name" do - application_experiment.try(:variant1) {} - application_experiment.try(:variant2) {} + application_experiment.variant(:variant1) {} + application_experiment.variant(:variant2) {} expect(application_experiment.variant.name).to eq('variant2') end @@ -395,8 +395,8 @@ RSpec.describe ApplicationExperiment, :experiment do cache.clear(key: application_experiment.name) - application_experiment.use { } # setup the control - application_experiment.try { } # setup the candidate + application_experiment.control { } + application_experiment.candidate { } end it "caches the variant determined by the variant resolver" do diff --git a/spec/features/gitlab_experiments_spec.rb b/spec/features/gitlab_experiments_spec.rb index ca772680ff6..af14b6e2e95 100644 --- a/spec/features/gitlab_experiments_spec.rb +++ b/spec/features/gitlab_experiments_spec.rb @@ -21,8 +21,8 @@ RSpec.describe "Gitlab::Experiment", :js do allow_next_instance_of(Admin::AbuseReportsController) do |instance| allow(instance).to receive(:index).and_wrap_original do |original| instance.experiment(:null_hypothesis, user: instance.current_user) do |e| - e.use { original.call } - e.try { original.call } + e.control { original.call } + e.candidate { original.call } end end end diff --git a/spec/services/projects/container_repository/delete_tags_service_spec.rb b/spec/services/projects/container_repository/delete_tags_service_spec.rb index 94037d6de1e..246ca301cfa 100644 --- a/spec/services/projects/container_repository/delete_tags_service_spec.rb +++ b/spec/services/projects/container_repository/delete_tags_service_spec.rb @@ -14,7 +14,7 @@ RSpec.describe Projects::ContainerRepository::DeleteTagsService do ] end - RSpec.shared_examples 'logging a success response' do + shared_examples 'logging a success response' do it 'logs an info message' do expect(service).to receive(:log_info).with( service_class: 'Projects::ContainerRepository::DeleteTagsService', @@ -28,7 +28,7 @@ RSpec.describe Projects::ContainerRepository::DeleteTagsService do end end - RSpec.shared_examples 'logging an error response' do |message: 'could not delete tags', extra_log: {}| + shared_examples 'logging an error response' do |message: 'could not delete tags', extra_log: {}| it 'logs an error message' do log_data = { service_class: 'Projects::ContainerRepository::DeleteTagsService', @@ -45,7 +45,7 @@ RSpec.describe Projects::ContainerRepository::DeleteTagsService do end end - RSpec.shared_examples 'calling the correct delete tags service' do |expected_service_class| + shared_examples 'calling the correct delete tags service' do |expected_service_class| let(:service_response) { { status: :success, deleted: tags } } let(:excluded_service_class) { available_service_classes.excluding(expected_service_class).first } @@ -69,7 +69,7 @@ RSpec.describe Projects::ContainerRepository::DeleteTagsService do end end - RSpec.shared_examples 'handling invalid params' do + shared_examples 'handling invalid params' do context 'with invalid params' do before do expect(::Projects::ContainerRepository::Gitlab::DeleteTagsService).not_to receive(:new) @@ -91,7 +91,7 @@ RSpec.describe Projects::ContainerRepository::DeleteTagsService do end end - RSpec.shared_examples 'supporting fast delete' do + shared_examples 'supporting fast delete' do context 'when the registry supports fast delete' do before do allow(repository.client).to receive(:supports_tag_delete?).and_return(true) @@ -155,6 +155,14 @@ RSpec.describe Projects::ContainerRepository::DeleteTagsService do it_behaves_like 'handling invalid params' end + + context 'when the repository is importing' do + before do + repository.update_columns(migration_state: 'importing', migration_import_started_at: Time.zone.now) + end + + it { is_expected.to include(status: :error, message: 'repository importing') } + end end context 'without user' do diff --git a/spec/support/shared_contexts/services/projects/container_repository/delete_tags_service_shared_context.rb b/spec/support/shared_contexts/services/projects/container_repository/delete_tags_service_shared_context.rb index 21be989d697..e26b8cd8b37 100644 --- a/spec/support/shared_contexts/services/projects/container_repository/delete_tags_service_shared_context.rb +++ b/spec/support/shared_contexts/services/projects/container_repository/delete_tags_service_shared_context.rb @@ -3,7 +3,7 @@ RSpec.shared_context 'container repository delete tags service shared context' do let_it_be(:user) { create(:user) } let_it_be(:project, reload: true) { create(:project, :private) } - let_it_be(:repository) { create(:container_repository, :root, project: project) } + let_it_be_with_reload(:repository) { create(:container_repository, :root, project: project) } let(:params) { { tags: tags } }