diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 062225a75ff..1d730d42ac0 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -154,8 +154,6 @@ Performance/Count: - 'app/helpers/groups_helper.rb' - 'app/services/merge_requests/add_context_service.rb' - 'ee/lib/gitlab/graphql/aggregations/epics/epic_node.rb' - - 'ee/spec/controllers/projects/feature_flags_controller_spec.rb' - - 'ee/spec/requests/api/feature_flags_spec.rb' - 'lib/gitlab/sidekiq_status.rb' - 'spec/lib/gitlab/conflict/file_spec.rb' - 'spec/lib/gitlab/git/tree_spec.rb' @@ -167,7 +165,6 @@ Performance/Count: Performance/Detect: Exclude: - 'ee/spec/controllers/projects/dependencies_controller_spec.rb' - - 'ee/spec/controllers/projects/feature_flags_controller_spec.rb' - 'spec/lib/gitlab/git/tree_spec.rb' - 'spec/lib/gitlab/import_export/project/tree_restorer_spec.rb' - 'spec/models/event_spec.rb' diff --git a/app/assets/javascripts/commit/pipelines/pipelines_bundle.js b/app/assets/javascripts/commit/pipelines/pipelines_bundle.js index 340a93e4e66..c8168afbcb0 100644 --- a/app/assets/javascripts/commit/pipelines/pipelines_bundle.js +++ b/app/assets/javascripts/commit/pipelines/pipelines_bundle.js @@ -3,9 +3,10 @@ import commitPipelinesTable from './pipelines_table.vue'; /** * Used in: - * - Commit details View > Pipelines Tab > Pipelines Table. - * - Merge Request details View > Pipelines Tab > Pipelines Table. - * - New Merge Request View > Pipelines Tab > Pipelines Table. + * - Project Pipelines List (projects:pipelines:index) + * - Commit details View > Pipelines Tab > Pipelines Table (projects:commit:pipelines) + * - Merge Request details View > Pipelines Tab > Pipelines Table (projects:merge_requests:show) + * - New Merge Request View > Pipelines Tab > Pipelines Table (projects:merge_requests:creations:new) */ const CommitPipelinesTable = Vue.extend(commitPipelinesTable); diff --git a/app/assets/javascripts/commit/pipelines/pipelines_table.vue b/app/assets/javascripts/commit/pipelines/pipelines_table.vue index 188d958ba86..fe32868e6d8 100644 --- a/app/assets/javascripts/commit/pipelines/pipelines_table.vue +++ b/app/assets/javascripts/commit/pipelines/pipelines_table.vue @@ -193,7 +193,7 @@ export default { " /> -
diff --git a/app/assets/stylesheets/framework/buttons.scss b/app/assets/stylesheets/framework/buttons.scss
index 94d0f7c999f..a8cc685d880 100644
--- a/app/assets/stylesheets/framework/buttons.scss
+++ b/app/assets/stylesheets/framework/buttons.scss
@@ -244,15 +244,20 @@
}
&.btn-text-field {
- color: $gray-500;
- justify-content: start;
width: 100%;
text-align: left;
+ padding: 6px 16px;
+ border-color: $border-color;
+ color: $gray-darkest;
+ background-color: $white;
&:hover,
&:active,
&:focus {
cursor: text;
+ box-shadow: none;
+ border-color: lighten($blue-300, 20%);
+ color: $gray-darkest;
}
}
diff --git a/app/assets/stylesheets/page_bundles/pipelines.scss b/app/assets/stylesheets/page_bundles/pipelines.scss
new file mode 100644
index 00000000000..8fcfde6b32b
--- /dev/null
+++ b/app/assets/stylesheets/page_bundles/pipelines.scss
@@ -0,0 +1,66 @@
+@import 'mixins_and_variables_and_functions';
+
+/**
+ * Pipelines Bundle
+ *
+ * Styles of pipeline lists
+ *
+ * Should affect pipelines table components rendered by:
+ * app/assets/javascripts/commit/pipelines/pipelines_bundle.js
+ */
+
+.pipelines {
+ .badge {
+ margin-bottom: 3px;
+ }
+
+ .pipeline-actions {
+ min-width: 170px; //Guarantees buttons don't break in several lines.
+
+ .btn-default {
+ color: $gl-text-color-secondary;
+ }
+
+ .btn.btn-retry:hover,
+ .btn.btn-retry:focus {
+ border-color: $dropdown-toggle-active-border-color;
+ background-color: $white-normal;
+ }
+
+ svg path {
+ fill: $gl-text-color-secondary;
+ }
+
+ .dropdown-menu {
+ max-height: $dropdown-max-height;
+ overflow-y: auto;
+ }
+
+ .dropdown-toggle,
+ .dropdown-menu {
+ color: $gl-text-color-secondary;
+
+ .fa {
+ color: $gl-text-color-secondary;
+ font-size: 14px;
+ }
+ }
+
+ .btn-group.open .btn-default {
+ background-color: $white-normal;
+ border-color: $border-white-normal;
+ }
+
+ .btn .text-center {
+ display: inline;
+ }
+
+ .tooltip {
+ white-space: nowrap;
+ }
+ }
+
+ .pipeline-tags .label-container {
+ white-space: normal;
+ }
+}
diff --git a/app/assets/stylesheets/pages/pipelines.scss b/app/assets/stylesheets/pages/pipelines.scss
index 48d37ead8e2..0f68c393187 100644
--- a/app/assets/stylesheets/pages/pipelines.scss
+++ b/app/assets/stylesheets/pages/pipelines.scss
@@ -1,92 +1,3 @@
-.pipelines {
- .stage {
- max-width: 90px;
- width: 90px;
- text-align: center;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .table-holder {
- overflow: unset;
- width: 100%;
- }
-
- .commit-title {
- margin: 0;
- white-space: normal;
-
- @include media-breakpoint-down(sm) {
- justify-content: flex-end;
- }
- }
-
- .ci-table {
- .badge {
- margin-bottom: 3px;
- }
-
- .pipeline-id {
- color: $black;
- }
-
- .pipelines-time-ago {
- text-align: right;
- }
-
- .pipeline-actions {
- min-width: 170px; //Guarantees buttons don't break in several lines.
-
- .btn-default {
- color: $gl-text-color-secondary;
- }
-
- .btn.btn-retry:hover,
- .btn.btn-retry:focus {
- border-color: $dropdown-toggle-active-border-color;
- background-color: $white-normal;
- }
-
- svg path {
- fill: $gl-text-color-secondary;
- }
-
- .dropdown-menu {
- max-height: $dropdown-max-height;
- overflow-y: auto;
- }
-
- .dropdown-toggle,
- .dropdown-menu {
- color: $gl-text-color-secondary;
-
- .fa {
- color: $gl-text-color-secondary;
- font-size: 14px;
- }
- }
-
- .btn-group.open .btn-default {
- background-color: $white-normal;
- border-color: $border-white-normal;
- }
-
- .btn .text-center {
- display: inline;
- }
-
- .tooltip {
- white-space: nowrap;
- }
- }
-
- .pipeline-tags .label-container {
- white-space: normal;
- }
- }
-}
-
@include media-breakpoint-down(md) {
.content-list {
&.builds-content-list {
@@ -246,11 +157,6 @@
}
}
-// Pipeline visualization
-.pipeline-actions {
- border-bottom: 0;
-}
-
.ci-build-text,
.ci-status-text {
font-weight: 200;
diff --git a/app/controllers/projects/feature_flags_clients_controller.rb b/app/controllers/projects/feature_flags_clients_controller.rb
new file mode 100644
index 00000000000..02c9d9ab8fb
--- /dev/null
+++ b/app/controllers/projects/feature_flags_clients_controller.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+class Projects::FeatureFlagsClientsController < Projects::ApplicationController
+ before_action :authorize_admin_feature_flags_client!
+ before_action :feature_flags_client
+
+ def reset_token
+ feature_flags_client.reset_token!
+
+ respond_to do |format|
+ format.json do
+ render json: feature_flags_client_token_json, status: :ok
+ end
+ end
+ end
+
+ private
+
+ def feature_flags_client
+ project.operations_feature_flags_client || not_found
+ end
+
+ def feature_flags_client_token_json
+ FeatureFlagsClientSerializer.new
+ .represent_token(feature_flags_client)
+ end
+end
diff --git a/app/controllers/projects/feature_flags_controller.rb b/app/controllers/projects/feature_flags_controller.rb
new file mode 100644
index 00000000000..4452b61508b
--- /dev/null
+++ b/app/controllers/projects/feature_flags_controller.rb
@@ -0,0 +1,172 @@
+# frozen_string_literal: true
+
+class Projects::FeatureFlagsController < Projects::ApplicationController
+ respond_to :html
+
+ before_action :authorize_read_feature_flag!
+ before_action :authorize_create_feature_flag!, only: [:new, :create]
+ before_action :authorize_update_feature_flag!, only: [:edit, :update]
+ before_action :authorize_destroy_feature_flag!, only: [:destroy]
+
+ before_action :feature_flag, only: [:edit, :update, :destroy]
+
+ before_action :ensure_legacy_flags_writable!, only: [:update]
+
+ before_action do
+ push_frontend_feature_flag(:feature_flag_permissions)
+ push_frontend_feature_flag(:feature_flags_new_version, project, default_enabled: true)
+ push_frontend_feature_flag(:feature_flags_legacy_read_only, project, default_enabled: true)
+ push_frontend_feature_flag(:feature_flags_legacy_read_only_override, project)
+ end
+
+ def index
+ @feature_flags = FeatureFlagsFinder
+ .new(project, current_user, scope: params[:scope])
+ .execute
+ .page(params[:page])
+ .per(30)
+
+ respond_to do |format|
+ format.html
+ format.json do
+ Gitlab::PollingInterval.set_header(response, interval: 10_000)
+
+ render json: { feature_flags: feature_flags_json }.merge(summary_json)
+ end
+ end
+ end
+
+ def new
+ end
+
+ def show
+ respond_to do |format|
+ format.json do
+ Gitlab::PollingInterval.set_header(response, interval: 10_000)
+
+ render_success_json(feature_flag)
+ end
+ end
+ end
+
+ def create
+ result = FeatureFlags::CreateService.new(project, current_user, create_params).execute
+
+ if result[:status] == :success
+ respond_to do |format|
+ format.json { render_success_json(result[:feature_flag]) }
+ end
+ else
+ respond_to do |format|
+ format.json { render_error_json(result[:message]) }
+ end
+ end
+ end
+
+ def edit
+ end
+
+ def update
+ result = FeatureFlags::UpdateService.new(project, current_user, update_params).execute(feature_flag)
+
+ if result[:status] == :success
+ respond_to do |format|
+ format.json { render_success_json(result[:feature_flag]) }
+ end
+ else
+ respond_to do |format|
+ format.json { render_error_json(result[:message]) }
+ end
+ end
+ end
+
+ def destroy
+ result = FeatureFlags::DestroyService.new(project, current_user).execute(feature_flag)
+
+ if result[:status] == :success
+ respond_to do |format|
+ format.html { redirect_to_index(notice: _('Feature flag was successfully removed.')) }
+ format.json { render_success_json(feature_flag) }
+ end
+ else
+ respond_to do |format|
+ format.html { redirect_to_index(alert: _('Feature flag was not removed.')) }
+ format.json { render_error_json(result[:message]) }
+ end
+ end
+ end
+
+ protected
+
+ def feature_flag
+ @feature_flag ||= @noteable = if new_version_feature_flags_enabled?
+ project.operations_feature_flags.find_by_iid!(params[:iid])
+ else
+ project.operations_feature_flags.legacy_flag.find_by_iid!(params[:iid])
+ end
+ end
+
+ def new_version_feature_flags_enabled?
+ ::Feature.enabled?(:feature_flags_new_version, project, default_enabled: true)
+ end
+
+ def ensure_legacy_flags_writable!
+ if ::Feature.enabled?(:feature_flags_legacy_read_only, project, default_enabled: true) &&
+ ::Feature.disabled?(:feature_flags_legacy_read_only_override, project) &&
+ feature_flag.legacy_flag?
+ render_error_json(['Legacy feature flags are read-only'])
+ end
+ end
+
+ def create_params
+ params.require(:operations_feature_flag)
+ .permit(:name, :description, :active, :version,
+ scopes_attributes: [:environment_scope, :active,
+ strategies: [:name, parameters: [:groupId, :percentage, :userIds]]],
+ strategies_attributes: [:name, :user_list_id,
+ parameters: [:groupId, :percentage, :userIds, :rollout, :stickiness],
+ scopes_attributes: [:environment_scope]])
+ end
+
+ def update_params
+ params.require(:operations_feature_flag)
+ .permit(:name, :description, :active,
+ scopes_attributes: [:id, :environment_scope, :active, :_destroy,
+ strategies: [:name, parameters: [:groupId, :percentage, :userIds]]],
+ strategies_attributes: [:id, :name, :user_list_id, :_destroy,
+ parameters: [:groupId, :percentage, :userIds, :rollout, :stickiness],
+ scopes_attributes: [:id, :environment_scope, :_destroy]])
+ end
+
+ def feature_flag_json(feature_flag)
+ FeatureFlagSerializer
+ .new(project: @project, current_user: @current_user)
+ .represent(feature_flag)
+ end
+
+ def feature_flags_json
+ FeatureFlagSerializer
+ .new(project: @project, current_user: @current_user)
+ .with_pagination(request, response)
+ .represent(@feature_flags)
+ end
+
+ def summary_json
+ FeatureFlagSummarySerializer
+ .new(project: @project, current_user: @current_user)
+ .represent(@project)
+ end
+
+ def redirect_to_index(**args)
+ redirect_to project_feature_flags_path(@project), status: :found, **args
+ end
+
+ def render_success_json(feature_flag)
+ render json: feature_flag_json(feature_flag), status: :ok
+ end
+
+ def render_error_json(messages)
+ render json: { message: messages },
+ status: :bad_request
+ end
+end
diff --git a/app/controllers/projects/feature_flags_user_lists_controller.rb b/app/controllers/projects/feature_flags_user_lists_controller.rb
new file mode 100644
index 00000000000..5427a892bff
--- /dev/null
+++ b/app/controllers/projects/feature_flags_user_lists_controller.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class Projects::FeatureFlagsUserListsController < Projects::ApplicationController
+ before_action :authorize_admin_feature_flags_user_lists!
+ before_action :user_list, only: [:edit, :show]
+
+ def new
+ end
+
+ def edit
+ end
+
+ def show
+ end
+
+ private
+
+ def user_list
+ @user_list = project.operations_feature_flags_user_lists.find_by_iid!(params[:iid])
+ end
+end
diff --git a/app/helpers/user_callouts_helper.rb b/app/helpers/user_callouts_helper.rb
index b0cfda67ad4..0cdf53d6174 100644
--- a/app/helpers/user_callouts_helper.rb
+++ b/app/helpers/user_callouts_helper.rb
@@ -9,6 +9,7 @@ module UserCalloutsHelper
TABS_POSITION_HIGHLIGHT = 'tabs_position_highlight'
WEBHOOKS_MOVED = 'webhooks_moved'
CUSTOMIZE_HOMEPAGE = 'customize_homepage'
+ FEATURE_FLAGS_NEW_VERSION = 'feature_flags_new_version'
def show_admin_integrations_moved?
!user_dismissed?(ADMIN_INTEGRATIONS_MOVED)
@@ -50,6 +51,10 @@ module UserCalloutsHelper
customize_homepage && !user_dismissed?(CUSTOMIZE_HOMEPAGE)
end
+ def show_feature_flags_new_version?
+ !user_dismissed?(FEATURE_FLAGS_NEW_VERSION)
+ end
+
private
def user_dismissed?(feature_name, ignore_dismissal_earlier_than = nil)
diff --git a/app/models/blob_viewer/markup.rb b/app/models/blob_viewer/markup.rb
index f525180048e..c899ac514d3 100644
--- a/app/models/blob_viewer/markup.rb
+++ b/app/models/blob_viewer/markup.rb
@@ -9,5 +9,15 @@ module BlobViewer
self.extensions = Gitlab::MarkupHelper::EXTENSIONS
self.file_types = %i(readme)
self.binary = false
+
+ def banzai_render_context
+ {}.tap do |h|
+ h[:rendered] = blob.rendered_markup if blob.respond_to?(:rendered_markup)
+
+ if Feature.enabled?(:cached_markdown_blob, blob.project)
+ h[:cache_key] = ['blob', blob.id, 'commit', blob.commit_id]
+ end
+ end
+ end
end
end
diff --git a/app/presenters/packages/detail/package_presenter.rb b/app/presenters/packages/detail/package_presenter.rb
index bdb2e34854e..e8223d6498b 100644
--- a/app/presenters/packages/detail/package_presenter.rb
+++ b/app/presenters/packages/detail/package_presenter.rb
@@ -8,10 +8,13 @@ module Packages
end
def detail_view
+ name = @package.name
+ name = @package.conan_recipe if @package.conan?
+
package_detail = {
id: @package.id,
created_at: @package.created_at,
- name: @package.name,
+ name: name,
package_files: @package.package_files.map { |pf| build_package_file_view(pf) },
package_type: @package.package_type,
project_id: @package.project_id,
@@ -20,6 +23,7 @@ module Packages
version: @package.version
}
+ package_detail[:conan_package_name] = @package.name if @package.conan?
package_detail[:maven_metadatum] = @package.maven_metadatum if @package.maven_metadatum
package_detail[:nuget_metadatum] = @package.nuget_metadatum if @package.nuget_metadatum
package_detail[:composer_metadatum] = @package.composer_metadatum if @package.composer_metadatum
diff --git a/app/services/ci/create_downstream_pipeline_service.rb b/app/services/ci/create_downstream_pipeline_service.rb
index 0394cfb6119..809c478b8c7 100644
--- a/app/services/ci/create_downstream_pipeline_service.rb
+++ b/app/services/ci/create_downstream_pipeline_service.rb
@@ -33,7 +33,7 @@ module Ci
pipeline_params.fetch(:target_revision))
downstream_pipeline = service.execute(
- pipeline_params.fetch(:source), pipeline_params[:execute_params]) do |pipeline|
+ pipeline_params.fetch(:source), **pipeline_params[:execute_params]) do |pipeline|
pipeline.variables.build(@bridge.downstream_variables)
end
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb
index 3f1a2d1350d..e7ede98fea4 100644
--- a/app/services/ci/create_pipeline_service.rb
+++ b/app/services/ci/create_pipeline_service.rb
@@ -70,7 +70,7 @@ module Ci
push_options: params[:push_options] || {},
chat_data: params[:chat_data],
bridge: bridge,
- **extra_options(options))
+ **extra_options(**options))
# Ensure we never persist the pipeline when dry_run: true
@pipeline.readonly! if command.dry_run?
diff --git a/app/services/notification_recipients/build_service.rb b/app/services/notification_recipients/build_service.rb
index 0fe0d26d7b2..040ecc29d3a 100644
--- a/app/services/notification_recipients/build_service.rb
+++ b/app/services/notification_recipients/build_service.rb
@@ -13,8 +13,8 @@ module NotificationRecipients
NotificationRecipient.new(user, *args).notifiable?
end
- def self.build_recipients(*args)
- ::NotificationRecipients::Builder::Default.new(*args).notification_recipients
+ def self.build_recipients(target, current_user, **args)
+ ::NotificationRecipients::Builder::Default.new(target, current_user, **args).notification_recipients
end
def self.build_new_note_recipients(*args)
@@ -25,8 +25,8 @@ module NotificationRecipients
::NotificationRecipients::Builder::MergeRequestUnmergeable.new(*args).notification_recipients
end
- def self.build_project_maintainers_recipients(*args)
- ::NotificationRecipients::Builder::ProjectMaintainers.new(*args).notification_recipients
+ def self.build_project_maintainers_recipients(target, **args)
+ ::NotificationRecipients::Builder::ProjectMaintainers.new(target, **args).notification_recipients
end
def self.build_new_release_recipients(*args)
diff --git a/app/views/projects/blob/viewers/_markup.html.haml b/app/views/projects/blob/viewers/_markup.html.haml
index 8134adcbc32..703ffa8896e 100644
--- a/app/views/projects/blob/viewers/_markup.html.haml
+++ b/app/views/projects/blob/viewers/_markup.html.haml
@@ -1,4 +1,3 @@
- blob = viewer.blob
-- context = blob.respond_to?(:rendered_markup) ? { rendered: blob.rendered_markup } : {}
.file-content.md
- = markup(blob.name, blob.data, context)
+ = markup(blob.name, blob.data, viewer.banzai_render_context)
diff --git a/app/views/projects/commit/pipelines.html.haml b/app/views/projects/commit/pipelines.html.haml
index f8c27f4c026..0dbd6e53212 100644
--- a/app/views/projects/commit/pipelines.html.haml
+++ b/app/views/projects/commit/pipelines.html.haml
@@ -1,4 +1,5 @@
- page_title _('Pipelines'), "#{@commit.title} (#{@commit.short_id})", _('Commits')
+- add_page_specific_style 'page_bundles/pipelines'
= render 'commit_box'
= render 'ci_menu'
diff --git a/app/views/projects/feature_flags/edit.html.haml b/app/views/projects/feature_flags/edit.html.haml
index 67b1a8398d3..028595aba0b 100644
--- a/app/views/projects/feature_flags/edit.html.haml
+++ b/app/views/projects/feature_flags/edit.html.haml
@@ -9,7 +9,7 @@
feature_flags_path: project_feature_flags_path(@project),
environments_endpoint: search_project_environments_path(@project, format: :json),
user_callouts_path: user_callouts_path,
- user_callout_id: UserCalloutsHelper::FEATURE_FLAGS_NEW_VERISION,
+ user_callout_id: UserCalloutsHelper::FEATURE_FLAGS_NEW_VERSION,
show_user_callout: show_feature_flags_new_version?.to_s,
strategy_type_docs_page_path: help_page_path('operations/feature_flags', anchor: 'feature-flag-strategies'),
environments_scope_docs_path: help_page_path('ci/environments', anchor: 'scoping-environments-with-specs'),
diff --git a/app/views/projects/feature_flags/new.html.haml b/app/views/projects/feature_flags/new.html.haml
index a7388361da5..3bad1d9773c 100644
--- a/app/views/projects/feature_flags/new.html.haml
+++ b/app/views/projects/feature_flags/new.html.haml
@@ -7,7 +7,7 @@
feature_flags_path: project_feature_flags_path(@project),
environments_endpoint: search_project_environments_path(@project, format: :json),
user_callouts_path: user_callouts_path,
- user_callout_id: UserCalloutsHelper::FEATURE_FLAGS_NEW_VERISION,
+ user_callout_id: UserCalloutsHelper::FEATURE_FLAGS_NEW_VERSION,
show_user_callout: show_feature_flags_new_version?.to_s,
strategy_type_docs_page_path: help_page_path('operations/feature_flags', anchor: 'feature-flag-strategies'),
environments_scope_docs_path: help_page_path('ci/environments', anchor: 'scoping-environments-with-specs'),
diff --git a/app/views/projects/merge_requests/creations/new.html.haml b/app/views/projects/merge_requests/creations/new.html.haml
index ad4980fa57f..4c968c8e8eb 100644
--- a/app/views/projects/merge_requests/creations/new.html.haml
+++ b/app/views/projects/merge_requests/creations/new.html.haml
@@ -1,6 +1,7 @@
- add_to_breadcrumbs _("Merge Requests"), project_merge_requests_path(@project)
- breadcrumb_title _("New")
- page_title _("New Merge Request")
+- add_page_specific_style 'page_bundles/pipelines'
- if @merge_request.can_be_created && !params[:change_branches]
= render 'new_submit'
diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml
index 84b108d69ad..06513d56221 100644
--- a/app/views/projects/merge_requests/show.html.haml
+++ b/app/views/projects/merge_requests/show.html.haml
@@ -8,6 +8,7 @@
- suggest_changes_help_path = help_page_path('user/discussions/index.md', anchor: 'suggest-changes')
- number_of_pipelines = @pipelines.size
- mr_action = j(params[:tab].presence || 'show')
+- add_page_specific_style 'page_bundles/pipelines'
.merge-request{ data: { mr_action: mr_action, url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project), lock_version: @merge_request.lock_version } }
= render "projects/merge_requests/mr_title"
diff --git a/app/views/projects/pipelines/index.html.haml b/app/views/projects/pipelines/index.html.haml
index 05f8a126a02..ca07f33136b 100644
--- a/app/views/projects/pipelines/index.html.haml
+++ b/app/views/projects/pipelines/index.html.haml
@@ -1,4 +1,5 @@
- page_title _('Pipelines')
+- add_page_specific_style 'page_bundles/pipelines'
= render_if_exists "shared/shared_runners_minutes_limit_flash_message"
diff --git a/changelogs/unreleased/229727-drop-type-on-audit-events.yml b/changelogs/unreleased/229727-drop-type-on-audit-events.yml
new file mode 100644
index 00000000000..0abfc00444b
--- /dev/null
+++ b/changelogs/unreleased/229727-drop-type-on-audit-events.yml
@@ -0,0 +1,5 @@
+---
+title: Remove type column on audit_events table
+merge_request: 43703
+author:
+type: other
diff --git a/changelogs/unreleased/233627-fj-restore-snippets-in-backups.yml b/changelogs/unreleased/233627-fj-restore-snippets-in-backups.yml
new file mode 100644
index 00000000000..0737cec3d89
--- /dev/null
+++ b/changelogs/unreleased/233627-fj-restore-snippets-in-backups.yml
@@ -0,0 +1,5 @@
+---
+title: Restore snippet repositories from backups
+merge_request: 43696
+author:
+type: changed
diff --git a/changelogs/unreleased/239130-package-presenter-conan.yml b/changelogs/unreleased/239130-package-presenter-conan.yml
new file mode 100644
index 00000000000..8f8ad152966
--- /dev/null
+++ b/changelogs/unreleased/239130-package-presenter-conan.yml
@@ -0,0 +1,5 @@
+---
+title: Display conan recipe as package name on package detail page
+merge_request: 44294
+author:
+type: changed
diff --git a/changelogs/unreleased/241058-migrate-bootstrap-button-to-gitlab-ui-glbutton-in-app-assets-javas.yml b/changelogs/unreleased/241058-migrate-bootstrap-button-to-gitlab-ui-glbutton-in-app-assets-javas.yml
deleted file mode 100644
index cb99207fffe..00000000000
--- a/changelogs/unreleased/241058-migrate-bootstrap-button-to-gitlab-ui-glbutton-in-app-assets-javas.yml
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: Replacing deprecated Bootstrap button with GlButton and updating btn-text-field
- class to align with styles
-merge_request: 41430
-author:
-type: other
diff --git a/changelogs/unreleased/262051-design-thumbnail-image-is-not-updated-after-uploading-an-image-wit.yml b/changelogs/unreleased/262051-design-thumbnail-image-is-not-updated-after-uploading-an-image-wit.yml
new file mode 100644
index 00000000000..b6e597bfc97
--- /dev/null
+++ b/changelogs/unreleased/262051-design-thumbnail-image-is-not-updated-after-uploading-an-image-wit.yml
@@ -0,0 +1,5 @@
+---
+title: Update Design thumbnail after uploading an image with the same filename
+merge_request: 44305
+author:
+type: fixed
diff --git a/changelogs/unreleased/42782-move-beforescript-into-script.yml b/changelogs/unreleased/42782-move-beforescript-into-script.yml
new file mode 100644
index 00000000000..5d649838a8c
--- /dev/null
+++ b/changelogs/unreleased/42782-move-beforescript-into-script.yml
@@ -0,0 +1,5 @@
+---
+title: Move before_script into script for CQ template
+merge_request: 42782
+author: Vicken Simonian @vicken.papaya
+type: fixed
diff --git a/changelogs/unreleased/adding-hcl.yml b/changelogs/unreleased/adding-hcl.yml
new file mode 100644
index 00000000000..4b0d750474f
--- /dev/null
+++ b/changelogs/unreleased/adding-hcl.yml
@@ -0,0 +1,5 @@
+---
+title: IDE editor - Adding syntax highlighting for terraform / hcl
+merge_request: 44056
+author:
+type: added
diff --git a/changelogs/unreleased/id-required-sections.yml b/changelogs/unreleased/id-required-sections.yml
new file mode 100644
index 00000000000..b24baa719c0
--- /dev/null
+++ b/changelogs/unreleased/id-required-sections.yml
@@ -0,0 +1,5 @@
+---
+title: Introduce required_code_owners_sections table
+merge_request: 43573
+author:
+type: added
diff --git a/config/application.rb b/config/application.rb
index 411c136e7d4..798deada81b 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -182,6 +182,7 @@ module Gitlab
config.assets.precompile << "page_bundles/merge_conflicts.css"
config.assets.precompile << "page_bundles/milestone.css"
config.assets.precompile << "page_bundles/pipeline.css"
+ config.assets.precompile << "page_bundles/pipelines.css"
config.assets.precompile << "page_bundles/todos.css"
config.assets.precompile << "page_bundles/xterm.css"
config.assets.precompile << "lazy_bundles/cropper.css"
diff --git a/config/feature_flags/development/cached_markdown_blob.yml b/config/feature_flags/development/cached_markdown_blob.yml
new file mode 100644
index 00000000000..f125f598698
--- /dev/null
+++ b/config/feature_flags/development/cached_markdown_blob.yml
@@ -0,0 +1,7 @@
+---
+name: cached_markdown_blob
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44300
+rollout_issue_url:
+type: development
+group: group::source code
+default_enabled: false
diff --git a/config/feature_flags/development/ci_dynamic_child_pipeline.yml b/config/feature_flags/development/ci_dynamic_child_pipeline.yml
index ac2afe77743..c568e9392b2 100644
--- a/config/feature_flags/development/ci_dynamic_child_pipeline.yml
+++ b/config/feature_flags/development/ci_dynamic_child_pipeline.yml
@@ -1,7 +1,7 @@
---
name: ci_dynamic_child_pipeline
-introduced_by_url:
-rollout_issue_url:
-group:
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23790
+rollout_issue_url:
+group: group::continuous integration
type: development
default_enabled: true
diff --git a/config/feature_flags/development/ci_lint_creates_pipeline_with_dry_run.yml b/config/feature_flags/development/ci_lint_creates_pipeline_with_dry_run.yml
index 8abb52486b6..5f23d038998 100644
--- a/config/feature_flags/development/ci_lint_creates_pipeline_with_dry_run.yml
+++ b/config/feature_flags/development/ci_lint_creates_pipeline_with_dry_run.yml
@@ -1,7 +1,7 @@
---
name: ci_lint_creates_pipeline_with_dry_run
-introduced_by_url:
-rollout_issue_url:
-group:
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37828
+rollout_issue_url:
+group: group::continuous integration
type: development
default_enabled: true
diff --git a/config/feature_flags/development/ci_raise_job_rules_without_workflow_rules_warning.yml b/config/feature_flags/development/ci_raise_job_rules_without_workflow_rules_warning.yml
index d2e25e7bf11..c2cd1d62734 100644
--- a/config/feature_flags/development/ci_raise_job_rules_without_workflow_rules_warning.yml
+++ b/config/feature_flags/development/ci_raise_job_rules_without_workflow_rules_warning.yml
@@ -1,7 +1,7 @@
---
name: ci_raise_job_rules_without_workflow_rules_warning
-introduced_by_url:
-rollout_issue_url:
-group:
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38387
+rollout_issue_url:
+group: group::continuous integration
type: development
default_enabled: true
diff --git a/config/feature_flags/development/ci_store_pipeline_messages.yml b/config/feature_flags/development/ci_store_pipeline_messages.yml
index c7235ab2196..35cbfad0efa 100644
--- a/config/feature_flags/development/ci_store_pipeline_messages.yml
+++ b/config/feature_flags/development/ci_store_pipeline_messages.yml
@@ -1,7 +1,7 @@
---
name: ci_store_pipeline_messages
-introduced_by_url:
-rollout_issue_url:
-group:
+introduced_by_url:
+rollout_issue_url:
+group: group::continuous integration
type: development
default_enabled: true
diff --git a/config/feature_flags/development/ci_yaml_limit_size.yml b/config/feature_flags/development/ci_yaml_limit_size.yml
index 06229c08af5..0ebd29d0ba5 100644
--- a/config/feature_flags/development/ci_yaml_limit_size.yml
+++ b/config/feature_flags/development/ci_yaml_limit_size.yml
@@ -1,7 +1,7 @@
---
name: ci_yaml_limit_size
-introduced_by_url:
-rollout_issue_url:
-group:
+introduced_by_url:
+rollout_issue_url:
+group: group::continuous integration
type: development
default_enabled: true
diff --git a/config/feature_flags/development/efficient_counter_attribute.yml b/config/feature_flags/development/efficient_counter_attribute.yml
index a1b16be7ce8..1b12c166c53 100644
--- a/config/feature_flags/development/efficient_counter_attribute.yml
+++ b/config/feature_flags/development/efficient_counter_attribute.yml
@@ -1,7 +1,7 @@
---
name: efficient_counter_attribute
-introduced_by_url:
-rollout_issue_url:
-group:
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35878
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/238535
+group: group::continuous integration
type: development
default_enabled: false
diff --git a/config/feature_flags/development/feature_flag_api.yml b/config/feature_flags/development/feature_flag_api.yml
new file mode 100644
index 00000000000..326cfa83433
--- /dev/null
+++ b/config/feature_flags/development/feature_flag_api.yml
@@ -0,0 +1,7 @@
+---
+name: feature_flag_api
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18198
+rollout_issue_url:
+group: group::progressive delivery
+type: development
+default_enabled: false
diff --git a/config/feature_flags/development/feature_flag_permissions.yml b/config/feature_flags/development/feature_flag_permissions.yml
new file mode 100644
index 00000000000..2eb5b513743
--- /dev/null
+++ b/config/feature_flags/development/feature_flag_permissions.yml
@@ -0,0 +1,7 @@
+---
+name: feature_flag_permissions
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/10096
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/254981
+group: group::progressive delivery
+type: development
+default_enabled: false
diff --git a/config/feature_flags/development/feature_flags_legacy_read_only.yml b/config/feature_flags/development/feature_flags_legacy_read_only.yml
new file mode 100644
index 00000000000..b790e466093
--- /dev/null
+++ b/config/feature_flags/development/feature_flags_legacy_read_only.yml
@@ -0,0 +1,7 @@
+---
+name: feature_flags_legacy_read_only
+introduced_by_url:
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/240985
+group: group::progressive delivery
+type: development
+default_enabled: true
diff --git a/config/feature_flags/development/feature_flags_legacy_read_only_override.yml b/config/feature_flags/development/feature_flags_legacy_read_only_override.yml
new file mode 100644
index 00000000000..14acde1b8fc
--- /dev/null
+++ b/config/feature_flags/development/feature_flags_legacy_read_only_override.yml
@@ -0,0 +1,7 @@
+---
+name: feature_flags_legacy_read_only_override
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40431
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/240985
+group: group::progressive delivery
+type: development
+default_enabled: false
diff --git a/config/routes/project.rb b/config/routes/project.rb
index c8fd5dc7e9e..2c681b3cbe7 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -373,9 +373,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
- resources :feature_flags, param: :iid do
- resources :feature_flag_issues, only: [:index, :create, :destroy], as: 'issues', path: 'issues'
- end
+ resources :feature_flags, param: :iid
resource :feature_flags_client, only: [] do
post :reset_token
end
diff --git a/db/migrate/20200928131934_create_required_code_owners_sections.rb b/db/migrate/20200928131934_create_required_code_owners_sections.rb
new file mode 100644
index 00000000000..f2dfd4007e5
--- /dev/null
+++ b/db/migrate/20200928131934_create_required_code_owners_sections.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+class CreateRequiredCodeOwnersSections < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ create_table :required_code_owners_sections, if_not_exists: true do |t|
+ t.references :protected_branch, null: false, foreign_key: { on_delete: :cascade }
+ t.text :name, null: false
+ end
+ end
+
+ add_text_limit :required_code_owners_sections, :name, 1024
+ end
+
+ def down
+ with_lock_retries do
+ drop_table :required_code_owners_sections, if_exists: true
+ end
+ end
+end
diff --git a/db/migrate/20200928164807_add_index_on_vulnerabilities_state_case.rb b/db/migrate/20200928164807_add_index_on_vulnerabilities_state_case.rb
new file mode 100644
index 00000000000..7bfae7377d7
--- /dev/null
+++ b/db/migrate/20200928164807_add_index_on_vulnerabilities_state_case.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class AddIndexOnVulnerabilitiesStateCase < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'index_vulnerabilities_on_state_case_id'
+ STATE_ORDER_ARRAY_POSITION = 'ARRAY_POSITION(ARRAY[1, 4, 3, 2]::smallint[], state)'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :vulnerabilities, "#{STATE_ORDER_ARRAY_POSITION}, id DESC", name: INDEX_NAME
+ add_concurrent_index :vulnerabilities, "#{STATE_ORDER_ARRAY_POSITION} DESC, id DESC", name: "#{INDEX_NAME}_desc"
+ end
+
+ def down
+ remove_concurrent_index_by_name :vulnerabilities, "#{INDEX_NAME}_desc"
+ remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20200929113254_remove_type_from_audit_events.rb b/db/post_migrate/20200929113254_remove_type_from_audit_events.rb
new file mode 100644
index 00000000000..000dc0d2865
--- /dev/null
+++ b/db/post_migrate/20200929113254_remove_type_from_audit_events.rb
@@ -0,0 +1,125 @@
+# frozen_string_literal: true
+
+class RemoveTypeFromAuditEvents < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::SchemaHelpers
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ SOURCE_TABLE_NAME = 'audit_events'
+ PARTITIONED_TABLE_NAME = 'audit_events_part_5fc467ac26'
+ TRIGGER_FUNCTION_NAME = 'table_sync_function_2be879775d'
+
+ def up
+ with_lock_retries do
+ remove_column SOURCE_TABLE_NAME, :type
+
+ create_trigger_function(TRIGGER_FUNCTION_NAME, replace: true) do
+ <<~SQL
+ IF (TG_OP = 'DELETE') THEN
+ DELETE FROM #{PARTITIONED_TABLE_NAME} where id = OLD.id;
+ ELSIF (TG_OP = 'UPDATE') THEN
+ UPDATE #{PARTITIONED_TABLE_NAME}
+ SET author_id = NEW.author_id,
+ entity_id = NEW.entity_id,
+ entity_type = NEW.entity_type,
+ details = NEW.details,
+ ip_address = NEW.ip_address,
+ author_name = NEW.author_name,
+ entity_path = NEW.entity_path,
+ target_details = NEW.target_details,
+ target_type = NEW.target_type,
+ target_id = NEW.target_id,
+ created_at = NEW.created_at
+ WHERE #{PARTITIONED_TABLE_NAME}.id = NEW.id;
+ ELSIF (TG_OP = 'INSERT') THEN
+ INSERT INTO #{PARTITIONED_TABLE_NAME} (id,
+ author_id,
+ entity_id,
+ entity_type,
+ details,
+ ip_address,
+ author_name,
+ entity_path,
+ target_details,
+ target_type,
+ target_id,
+ created_at)
+ VALUES (NEW.id,
+ NEW.author_id,
+ NEW.entity_id,
+ NEW.entity_type,
+ NEW.details,
+ NEW.ip_address,
+ NEW.author_name,
+ NEW.entity_path,
+ NEW.target_details,
+ NEW.target_type,
+ NEW.target_id,
+ NEW.created_at);
+ END IF;
+ RETURN NULL;
+ SQL
+ end
+
+ remove_column PARTITIONED_TABLE_NAME, :type
+ end
+ end
+
+ def down
+ with_lock_retries do
+ add_column SOURCE_TABLE_NAME, :type, :string
+ add_column PARTITIONED_TABLE_NAME, :type, :string
+
+ create_trigger_function(TRIGGER_FUNCTION_NAME, replace: true) do
+ <<~SQL
+ IF (TG_OP = 'DELETE') THEN
+ DELETE FROM #{PARTITIONED_TABLE_NAME} where id = OLD.id;
+ ELSIF (TG_OP = 'UPDATE') THEN
+ UPDATE #{PARTITIONED_TABLE_NAME}
+ SET author_id = NEW.author_id,
+ type = NEW.type,
+ entity_id = NEW.entity_id,
+ entity_type = NEW.entity_type,
+ details = NEW.details,
+ ip_address = NEW.ip_address,
+ author_name = NEW.author_name,
+ entity_path = NEW.entity_path,
+ target_details = NEW.target_details,
+ target_type = NEW.target_type,
+ target_id = NEW.target_id,
+ created_at = NEW.created_at
+ WHERE #{PARTITIONED_TABLE_NAME}.id = NEW.id;
+ ELSIF (TG_OP = 'INSERT') THEN
+ INSERT INTO #{PARTITIONED_TABLE_NAME} (id,
+ author_id,
+ type,
+ entity_id,
+ entity_type,
+ details,
+ ip_address,
+ author_name,
+ entity_path,
+ target_details,
+ target_type,
+ target_id,
+ created_at)
+ VALUES (NEW.id,
+ NEW.author_id,
+ NEW.type,
+ NEW.entity_id,
+ NEW.entity_type,
+ NEW.details,
+ NEW.ip_address,
+ NEW.author_name,
+ NEW.entity_path,
+ NEW.target_details,
+ NEW.target_type,
+ NEW.target_id,
+ NEW.created_at);
+ END IF;
+ RETURN NULL;
+ SQL
+ end
+ end
+ end
+end
diff --git a/db/schema_migrations/20200928131934 b/db/schema_migrations/20200928131934
new file mode 100644
index 00000000000..952e2121d35
--- /dev/null
+++ b/db/schema_migrations/20200928131934
@@ -0,0 +1 @@
+106757b0f30d3c89fcafa13be92271090fa107831fd538ee087d7ce212842492
\ No newline at end of file
diff --git a/db/schema_migrations/20200928164807 b/db/schema_migrations/20200928164807
new file mode 100644
index 00000000000..3efd3c56402
--- /dev/null
+++ b/db/schema_migrations/20200928164807
@@ -0,0 +1 @@
+346d0e913212d6e84528d47228ba7e6d0cf4a396e7fc921f7c684acfaaeeedb8
\ No newline at end of file
diff --git a/db/schema_migrations/20200929113254 b/db/schema_migrations/20200929113254
new file mode 100644
index 00000000000..172a6eabd66
--- /dev/null
+++ b/db/schema_migrations/20200929113254
@@ -0,0 +1 @@
+260f392c3ff257960dc7b198473056e7bf9b9a668403d2f05391d2b7989cf83c
\ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 038fcd4120e..f027deb56bc 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -19,7 +19,6 @@ IF (TG_OP = 'DELETE') THEN
ELSIF (TG_OP = 'UPDATE') THEN
UPDATE audit_events_part_5fc467ac26
SET author_id = NEW.author_id,
- type = NEW.type,
entity_id = NEW.entity_id,
entity_type = NEW.entity_type,
details = NEW.details,
@@ -34,7 +33,6 @@ ELSIF (TG_OP = 'UPDATE') THEN
ELSIF (TG_OP = 'INSERT') THEN
INSERT INTO audit_events_part_5fc467ac26 (id,
author_id,
- type,
entity_id,
entity_type,
details,
@@ -47,7 +45,6 @@ ELSIF (TG_OP = 'INSERT') THEN
created_at)
VALUES (NEW.id,
NEW.author_id,
- NEW.type,
NEW.entity_id,
NEW.entity_type,
NEW.details,
@@ -69,7 +66,6 @@ COMMENT ON FUNCTION table_sync_function_2be879775d() IS 'Partitioning migration:
CREATE TABLE audit_events_part_5fc467ac26 (
id bigint NOT NULL,
author_id integer NOT NULL,
- type character varying,
entity_id integer NOT NULL,
entity_type character varying NOT NULL,
details text,
@@ -9541,7 +9537,6 @@ ALTER SEQUENCE atlassian_identities_user_id_seq OWNED BY atlassian_identities.us
CREATE TABLE audit_events (
id integer NOT NULL,
author_id integer NOT NULL,
- type character varying,
entity_id integer NOT NULL,
entity_type character varying NOT NULL,
details text,
@@ -15451,6 +15446,22 @@ CREATE TABLE repository_languages (
share double precision NOT NULL
);
+CREATE TABLE required_code_owners_sections (
+ id bigint NOT NULL,
+ protected_branch_id bigint NOT NULL,
+ name text NOT NULL,
+ CONSTRAINT check_e58d53741e CHECK ((char_length(name) <= 1024))
+);
+
+CREATE SEQUENCE required_code_owners_sections_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE required_code_owners_sections_id_seq OWNED BY required_code_owners_sections.id;
+
CREATE TABLE requirements (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -17749,6 +17760,8 @@ ALTER TABLE ONLY releases ALTER COLUMN id SET DEFAULT nextval('releases_id_seq':
ALTER TABLE ONLY remote_mirrors ALTER COLUMN id SET DEFAULT nextval('remote_mirrors_id_seq'::regclass);
+ALTER TABLE ONLY required_code_owners_sections ALTER COLUMN id SET DEFAULT nextval('required_code_owners_sections_id_seq'::regclass);
+
ALTER TABLE ONLY requirements ALTER COLUMN id SET DEFAULT nextval('requirements_id_seq'::regclass);
ALTER TABLE ONLY requirements_management_test_reports ALTER COLUMN id SET DEFAULT nextval('requirements_management_test_reports_id_seq'::regclass);
@@ -19030,6 +19043,9 @@ ALTER TABLE ONLY releases
ALTER TABLE ONLY remote_mirrors
ADD CONSTRAINT remote_mirrors_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY required_code_owners_sections
+ ADD CONSTRAINT required_code_owners_sections_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY requirements_management_test_reports
ADD CONSTRAINT requirements_management_test_reports_pkey PRIMARY KEY (id);
@@ -21207,6 +21223,8 @@ CREATE INDEX index_remote_mirrors_on_project_id ON remote_mirrors USING btree (p
CREATE UNIQUE INDEX index_repository_languages_on_project_and_languages_id ON repository_languages USING btree (project_id, programming_language_id);
+CREATE INDEX index_required_code_owners_sections_on_protected_branch_id ON required_code_owners_sections USING btree (protected_branch_id);
+
CREATE INDEX index_requirements_management_test_reports_on_author_id ON requirements_management_test_reports USING btree (author_id);
CREATE INDEX index_requirements_management_test_reports_on_build_id ON requirements_management_test_reports USING btree (build_id);
@@ -21603,6 +21621,10 @@ CREATE INDEX index_vulnerabilities_on_resolved_by_id ON vulnerabilities USING bt
CREATE INDEX index_vulnerabilities_on_start_date_sourcing_milestone_id ON vulnerabilities USING btree (start_date_sourcing_milestone_id);
+CREATE INDEX index_vulnerabilities_on_state_case_id ON vulnerabilities USING btree (array_position(ARRAY[(1)::smallint, (4)::smallint, (3)::smallint, (2)::smallint], state), id DESC);
+
+CREATE INDEX index_vulnerabilities_on_state_case_id_desc ON vulnerabilities USING btree (array_position(ARRAY[(1)::smallint, (4)::smallint, (3)::smallint, (2)::smallint], state) DESC, id DESC);
+
CREATE INDEX index_vulnerabilities_on_updated_by_id ON vulnerabilities USING btree (updated_by_id);
CREATE INDEX index_vulnerability_exports_on_author_id ON vulnerability_exports USING btree (author_id);
@@ -23310,6 +23332,9 @@ ALTER TABLE ONLY clusters_kubernetes_namespaces
ALTER TABLE ONLY approval_merge_request_rules_users
ADD CONSTRAINT fk_rails_80e6801803 FOREIGN KEY (approval_merge_request_rule_id) REFERENCES approval_merge_request_rules(id) ON DELETE CASCADE;
+ALTER TABLE ONLY required_code_owners_sections
+ ADD CONSTRAINT fk_rails_817708cf2d FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY dast_site_profiles
ADD CONSTRAINT fk_rails_83e309d69e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
diff --git a/doc/administration/geo/disaster_recovery/index.md b/doc/administration/geo/disaster_recovery/index.md
index dc46c0756db..c2a59ade7e4 100644
--- a/doc/administration/geo/disaster_recovery/index.md
+++ b/doc/administration/geo/disaster_recovery/index.md
@@ -142,7 +142,7 @@ In GitLab 13.2 and later versions, promoting a secondary node to a primary while
If you have already run the [preflight checks](planned_failover.md#preflight-checks) separately or don't want to run them, you can skip preflight checks with:
```shell
- gitlab-ctl promote-to-primary-node --skip-preflight-check
+ gitlab-ctl promote-to-primary-node --skip-preflight-checks
```
You can also promote the secondary node to primary **without any further confirmation**, even when preflight checks fail:
diff --git a/doc/administration/raketasks/check.md b/doc/administration/raketasks/check.md
index d13e6328b2f..f4c8bc9e989 100644
--- a/doc/administration/raketasks/check.md
+++ b/doc/administration/raketasks/check.md
@@ -171,9 +171,7 @@ Checking integrity of Uploads
Done!
```
-To delete these references to remote uploads that were deleted externally, open the [GitLab Rails Console](../troubleshooting/navigating_gitlab_via_rails_console.md#starting-a-rails-console-session)
-and run:
-[Rails Console](../troubleshooting/navigating_gitlab_via_rails_console.md#starting-a-rails-console-session):
+To delete these references to remote uploads that were deleted externally, open the [GitLab Rails Console](../troubleshooting/navigating_gitlab_via_rails_console.md#starting-a-rails-console-session) and run:
```ruby
uploads_deleted=0
diff --git a/doc/api/graphql/reference/gitlab_schema.graphql b/doc/api/graphql/reference/gitlab_schema.graphql
index 4866cd9f4a0..4fcd608af5c 100644
--- a/doc/api/graphql/reference/gitlab_schema.graphql
+++ b/doc/api/graphql/reference/gitlab_schema.graphql
@@ -15888,6 +15888,11 @@ type Requirement {
"""
iid: ID!
+ """
+ Indicates if latest test report was created by user
+ """
+ lastTestReportManuallyCreated: Boolean
+
"""
Latest requirement test report state
"""
@@ -20153,7 +20158,7 @@ type Vulnerability implements Noteable {
severity: VulnerabilitySeverity
"""
- State of the vulnerability (DETECTED, DISMISSED, RESOLVED, CONFIRMED)
+ State of the vulnerability (DETECTED, CONFIRMED, RESOLVED, DISMISSED)
"""
state: VulnerabilityState
@@ -20815,6 +20820,16 @@ enum VulnerabilitySort {
"""
severity_desc
+ """
+ State in ascending order
+ """
+ state_asc
+
+ """
+ State in descending order
+ """
+ state_desc
+
"""
Title in ascending order
"""
diff --git a/doc/api/graphql/reference/gitlab_schema.json b/doc/api/graphql/reference/gitlab_schema.json
index ec247a09c97..7c96df4ad19 100644
--- a/doc/api/graphql/reference/gitlab_schema.json
+++ b/doc/api/graphql/reference/gitlab_schema.json
@@ -45944,6 +45944,20 @@
"isDeprecated": false,
"deprecationReason": null
},
+ {
+ "name": "lastTestReportManuallyCreated",
+ "description": "Indicates if latest test report was created by user",
+ "args": [
+
+ ],
+ "type": {
+ "kind": "SCALAR",
+ "name": "Boolean",
+ "ofType": null
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
{
"name": "lastTestReportState",
"description": "Latest requirement test report state",
@@ -58489,7 +58503,7 @@
},
{
"name": "state",
- "description": "State of the vulnerability (DETECTED, DISMISSED, RESOLVED, CONFIRMED)",
+ "description": "State of the vulnerability (DETECTED, CONFIRMED, RESOLVED, DISMISSED)",
"args": [
],
@@ -60468,6 +60482,18 @@
"description": "Report Type in ascending order",
"isDeprecated": false,
"deprecationReason": null
+ },
+ {
+ "name": "state_desc",
+ "description": "State in descending order",
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
+ {
+ "name": "state_asc",
+ "description": "State in ascending order",
+ "isDeprecated": false,
+ "deprecationReason": null
}
],
"possibleTypes": null
@@ -60487,7 +60513,7 @@
"deprecationReason": null
},
{
- "name": "DISMISSED",
+ "name": "CONFIRMED",
"description": null,
"isDeprecated": false,
"deprecationReason": null
@@ -60499,7 +60525,7 @@
"deprecationReason": null
},
{
- "name": "CONFIRMED",
+ "name": "DISMISSED",
"description": null,
"isDeprecated": false,
"deprecationReason": null
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index 77387a180b2..0f7769c44ec 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -2135,6 +2135,7 @@ Represents a requirement.
| `descriptionHtml` | String | The GitLab Flavored Markdown rendering of `description` |
| `id` | ID! | ID of the requirement |
| `iid` | ID! | Internal ID of the requirement |
+| `lastTestReportManuallyCreated` | Boolean | Indicates if latest test report was created by user |
| `lastTestReportState` | TestReportState | Latest requirement test report state |
| `project` | Project! | Project to which the requirement belongs |
| `state` | RequirementState! | State of the requirement |
@@ -2820,7 +2821,7 @@ Represents a vulnerability.
| `resolvedOnDefaultBranch` | Boolean! | Indicates whether the vulnerability is fixed on the default branch or not |
| `scanner` | VulnerabilityScanner | Scanner metadata for the vulnerability. |
| `severity` | VulnerabilitySeverity | Severity of the vulnerability (INFO, UNKNOWN, LOW, MEDIUM, HIGH, CRITICAL) |
-| `state` | VulnerabilityState | State of the vulnerability (DETECTED, DISMISSED, RESOLVED, CONFIRMED) |
+| `state` | VulnerabilityState | State of the vulnerability (DETECTED, CONFIRMED, RESOLVED, DISMISSED) |
| `title` | String | Title of the vulnerability |
| `userNotesCount` | Int! | Number of user notes attached to the vulnerability |
| `userPermissions` | VulnerabilityPermissions! | Permissions for the current user on the resource |
@@ -3766,6 +3767,8 @@ Vulnerability sort values.
| `report_type_desc` | Report Type in descending order |
| `severity_asc` | Severity in ascending order |
| `severity_desc` | Severity in descending order |
+| `state_asc` | State in ascending order |
+| `state_desc` | State in descending order |
| `title_asc` | Title in ascending order |
| `title_desc` | Title in descending order |
diff --git a/doc/development/migration_style_guide.md b/doc/development/migration_style_guide.md
index 268770193f9..ae01571ae4b 100644
--- a/doc/development/migration_style_guide.md
+++ b/doc/development/migration_style_guide.md
@@ -364,17 +364,7 @@ standard Rails migration helper methods. Calling more than one migration
helper is not a problem if they're executed on the same table.
Using the `with_lock_retries` helper method is advised when a database
-migration involves one of the high-traffic tables:
-
-- `users`
-- `projects`
-- `namespaces`
-- `gitlab_subscriptions`
-- `issues`
-- `merge_requests`
-- `ci_pipelines`
-- `ci_builds`
-- `notes`
+migration involves one of the [high-traffic tables](https://gitlab.com/gitlab-org/gitlab/-/blob/master/rubocop/rubocop-migrations.yml#L3).
Example changes:
diff --git a/doc/gitlab-basics/add-file.md b/doc/gitlab-basics/add-file.md
index c5b57d4623d..659cab299aa 100644
--- a/doc/gitlab-basics/add-file.md
+++ b/doc/gitlab-basics/add-file.md
@@ -29,16 +29,16 @@ to the desired destination:
cd