Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-06 21:14:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-06 21:14:09 +0300
commita15c9bc9eb04dcee1369c5fd6248c6352915ad21 (patch)
tree3f40f6f76615d85a7bfa45d5b1045d2fbe22860f
parent55242833f832095a6fcff00b1ccacbc5900ee52a (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.gitlab/ci/rules.gitlab-ci.yml3
-rw-r--r--.gitlab/issue_templates/Feature Proposal - lean.md2
-rw-r--r--app/assets/javascripts/notes/components/noteable_discussion.vue17
-rw-r--r--app/assets/javascripts/notes/components/noteable_note.vue13
-rw-r--r--app/assets/javascripts/repository/components/last_commit.vue2
-rw-r--r--app/assets/javascripts/repository/index.js2
-rw-r--r--app/assets/javascripts/user_lists/components/add_user_modal.vue2
-rw-r--r--app/controllers/projects/forks_controller.rb2
-rw-r--r--app/controllers/projects/google_cloud/service_accounts_controller.rb2
-rw-r--r--app/graphql/types/repository/blob_type.rb6
-rw-r--r--app/helpers/sorting_helper.rb25
-rw-r--r--app/models/ci/build.rb3
-rw-r--r--app/models/ci/pipeline.rb2
-rw-r--r--app/models/commit_status.rb4
-rw-r--r--app/models/merge_request.rb2
-rw-r--r--app/presenters/blob_presenter.rb7
-rw-r--r--app/presenters/ci/pipeline_presenter.rb7
-rw-r--r--app/presenters/merge_request_presenter.rb7
-rw-r--r--app/serializers/ci/pipeline_entity.rb2
-rw-r--r--app/serializers/merge_requests/pipeline_entity.rb4
-rw-r--r--app/services/projects/destroy_service.rb2
-rw-r--r--app/views/projects/_files.html.haml5
-rw-r--r--app/views/projects/forks/index.html.haml44
-rw-r--r--app/views/shared/_milestone_expired.html.haml6
-rw-r--r--app/views/shared/milestones/_milestone.html.haml6
-rw-r--r--doc/administration/package_information/supported_os.md6
-rw-r--r--doc/administration/uploads.md6
-rw-r--r--doc/api/branches.md10
-rw-r--r--doc/api/graphql/reference/index.md1
-rw-r--r--doc/api/import.md2
-rw-r--r--doc/development/application_slis/index.md2
-rw-r--r--doc/development/backend/ruby_style_guide.md2
-rw-r--r--doc/development/database/loose_foreign_keys.md2
-rw-r--r--doc/development/feature_flags/controls.md24
-rw-r--r--doc/development/merge_request_performance_guidelines.md2
-rw-r--r--doc/development/performance.md4
-rw-r--r--doc/development/rails_update.md2
-rw-r--r--doc/development/ruby_upgrade.md4
-rw-r--r--doc/development/stage_group_dashboards.md4
-rw-r--r--doc/development/testing_guide/best_practices.md6
-rw-r--r--doc/development/testing_guide/review_apps.md1
-rw-r--r--doc/install/aws/gitlab_hybrid_on_aws.md4
-rw-r--r--doc/install/aws/gitlab_sre_for_aws.md6
-rw-r--r--doc/install/aws/manual_install_aws.md6
-rw-r--r--doc/install/docker.md8
-rw-r--r--doc/raketasks/backup_restore.md11
-rw-r--r--doc/update/plan_your_upgrade.md2
-rw-r--r--doc/user/application_security/container_scanning/index.md23
-rw-r--r--lib/gitlab/ci/badge/coverage/report.rb2
-rw-r--r--locale/gitlab.pot9
-rw-r--r--package.json2
-rw-r--r--qa/qa/resource/base.rb14
-rw-r--r--qa/spec/resource/base_spec.rb11
-rw-r--r--spec/frontend/repository/components/__snapshots__/last_commit_spec.js.snap4
-rw-r--r--spec/graphql/types/repository/blob_type_spec.rb1
-rw-r--r--spec/helpers/sorting_helper_spec.rb73
-rw-r--r--spec/models/ci/build_spec.rb6
-rw-r--r--spec/models/ci/pipeline_spec.rb8
-rw-r--r--spec/models/merge_request_spec.rb2
-rw-r--r--spec/presenters/blob_presenter_spec.rb4
-rw-r--r--spec/presenters/ci/pipeline_presenter_spec.rb24
-rw-r--r--spec/presenters/merge_request_presenter_spec.rb24
-rw-r--r--spec/serializers/ci/pipeline_entity_spec.rb12
-rw-r--r--spec/serializers/merge_requests/pipeline_entity_spec.rb5
-rw-r--r--spec/support/matchers/background_migrations_matchers.rb6
-rwxr-xr-xtooling/bin/qa/check_if_qa_only_spec_changes12
-rw-r--r--yarn.lock8
67 files changed, 397 insertions, 145 deletions
diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml
index 19fb8ced4ab..bb937bcc31a 100644
--- a/.gitlab/ci/rules.gitlab-ci.yml
+++ b/.gitlab/ci/rules.gitlab-ci.yml
@@ -11,7 +11,7 @@
if: '$CI_PROJECT_NAME != "gitlab-foss" && $CI_PROJECT_NAME != "gitlab-ce" && $CI_PROJECT_NAME != "gitlabhq"'
.if-jh: &if-jh
- if: '$CI_PROJECT_PATH == "gitlab-jh/gitlab"'
+ if: '$CI_PROJECT_PATH =~ /^gitlab-(jh|cn)\/.*/'
.if-default-refs: &if-default-refs
if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/ || $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/ || $CI_COMMIT_REF_NAME =~ /^security\// || $CI_MERGE_REQUEST_IID || $CI_COMMIT_TAG || $FORCE_GITLAB_CI'
@@ -1582,7 +1582,6 @@
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
- - <<: *if-dot-com-gitlab-org-schedule
.review:rules:review-build-cng:
rules:
diff --git a/.gitlab/issue_templates/Feature Proposal - lean.md b/.gitlab/issue_templates/Feature Proposal - lean.md
index 504bfbb03d8..05376ac60fa 100644
--- a/.gitlab/issue_templates/Feature Proposal - lean.md
+++ b/.gitlab/issue_templates/Feature Proposal - lean.md
@@ -40,7 +40,7 @@ Personas are described at https://about.gitlab.com/handbook/marketing/product-ma
### Metrics
-<!-- How are you going to track uage of this feature? Think about user behavior and their interaction with the product. What indicates someone is getting value from it?
+<!-- How are you going to track usage of this feature? Think about user behavior and their interaction with the product. What indicates someone is getting value from it?
Create tracking issue using the Snowplow event tracking template. See https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/issue_templates/Snowplow%20event%20tracking.md
diff --git a/app/assets/javascripts/notes/components/noteable_discussion.vue b/app/assets/javascripts/notes/components/noteable_discussion.vue
index de9c695de2e..8e32c3b3073 100644
--- a/app/assets/javascripts/notes/components/noteable_discussion.vue
+++ b/app/assets/javascripts/notes/components/noteable_discussion.vue
@@ -223,17 +223,20 @@ export default {
})
.catch((err) => {
this.removePlaceholderNotes();
- const msg = __(
- 'Your comment could not be submitted! Please check your network connection and try again.',
- );
- createFlash({
- message: msg,
- parent: this.$el,
- });
+ this.handleSaveError(err); // The 'err' parameter is being used in JH, don't remove it
this.$refs.noteForm.note = noteText;
callback(err);
});
},
+ handleSaveError() {
+ const msg = __(
+ 'Your comment could not be submitted! Please check your network connection and try again.',
+ );
+ createFlash({
+ message: msg,
+ parent: this.$el,
+ });
+ },
deleteNoteHandler(note) {
this.$emit('noteDeleted', this.discussion, note);
},
diff --git a/app/assets/javascripts/notes/components/noteable_note.vue b/app/assets/javascripts/notes/components/noteable_note.vue
index e74d4deeaec..3250a4818c7 100644
--- a/app/assets/javascripts/notes/components/noteable_note.vue
+++ b/app/assets/javascripts/notes/components/noteable_note.vue
@@ -331,17 +331,20 @@ export default {
this.isEditing = true;
this.setSelectedCommentPositionHover();
this.$nextTick(() => {
- const msg = __('Something went wrong while editing your comment. Please try again.');
- createFlash({
- message: msg,
- parent: this.$el,
- });
+ this.handleUpdateError(response); // The 'response' parameter is being used in JH, don't remove it
this.recoverNoteContent(noteText);
callback();
});
}
});
},
+ handleUpdateError() {
+ const msg = __('Something went wrong while editing your comment. Please try again.');
+ createFlash({
+ message: msg,
+ parent: this.$el,
+ });
+ },
formCancelHandler({ shouldConfirm, isDirty }) {
if (shouldConfirm && isDirty) {
// eslint-disable-next-line no-alert
diff --git a/app/assets/javascripts/repository/components/last_commit.vue b/app/assets/javascripts/repository/components/last_commit.vue
index 62066973ee6..43e114a91d3 100644
--- a/app/assets/javascripts/repository/components/last_commit.vue
+++ b/app/assets/javascripts/repository/components/last_commit.vue
@@ -111,7 +111,7 @@ export default {
</script>
<template>
- <div class="info-well d-none d-sm-flex project-last-commit commit p-3">
+ <div class="well-segment commit gl-p-5 gl-w-full">
<gl-loading-icon v-if="isLoading" size="md" color="dark" class="m-auto" />
<template v-else-if="commit">
<user-avatar-link
diff --git a/app/assets/javascripts/repository/index.js b/app/assets/javascripts/repository/index.js
index 45e026ad695..197b19387cf 100644
--- a/app/assets/javascripts/repository/index.js
+++ b/app/assets/javascripts/repository/index.js
@@ -188,5 +188,5 @@ export default function setupVueRepositoryList() {
},
});
- return { router, data: dataset };
+ return { router, data: dataset, apolloProvider, projectPath };
}
diff --git a/app/assets/javascripts/user_lists/components/add_user_modal.vue b/app/assets/javascripts/user_lists/components/add_user_modal.vue
index a8dde1f681e..e982d10f63b 100644
--- a/app/assets/javascripts/user_lists/components/add_user_modal.vue
+++ b/app/assets/javascripts/user_lists/components/add_user_modal.vue
@@ -19,7 +19,7 @@ export default {
modalOptions: {
actionPrimary: {
text: s__('UserLists|Add'),
- attributes: [{ 'data-testid': 'confirm-add-user-ids' }],
+ attributes: [{ 'data-testid': 'confirm-add-user-ids', variant: 'confirm' }],
},
actionCancel: {
text: s__('UserLists|Cancel'),
diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb
index 5154f145b46..ba83f8dad35 100644
--- a/app/controllers/projects/forks_controller.rb
+++ b/app/controllers/projects/forks_controller.rb
@@ -22,6 +22,8 @@ class Projects::ForksController < Projects::ApplicationController
end
def index
+ @sort = params[:sort]
+
@total_forks_count = project.forks.size
@public_forks_count = project.forks.public_only.size
@private_forks_count = @total_forks_count - project.forks.public_and_internal_only.size
diff --git a/app/controllers/projects/google_cloud/service_accounts_controller.rb b/app/controllers/projects/google_cloud/service_accounts_controller.rb
index d5db4fabf88..a69a744154c 100644
--- a/app/controllers/projects/google_cloud/service_accounts_controller.rb
+++ b/app/controllers/projects/google_cloud/service_accounts_controller.rb
@@ -54,7 +54,7 @@ class Projects::GoogleCloud::ServiceAccountsController < Projects::GoogleCloud::
return if is_token_valid
- return_url = project_google_cloud_service_accounts_path(project)
+ return_url = project_google_cloud_index_path(project)
state = generate_session_key_redirect(request.url, return_url)
@authorize_url = GoogleApi::CloudPlatform::Client.new(nil,
callback_google_api_auth_url,
diff --git a/app/graphql/types/repository/blob_type.rb b/app/graphql/types/repository/blob_type.rb
index cd4993ea86d..3265c14bdca 100644
--- a/app/graphql/types/repository/blob_type.rb
+++ b/app/graphql/types/repository/blob_type.rb
@@ -71,6 +71,10 @@ module Types
field :pipeline_editor_path, GraphQL::Types::String, null: true,
description: 'Web path to edit .gitlab-ci.yml file.'
+ field :code_owners, [Types::UserType], null: true,
+ description: 'List of code owners for the blob.',
+ calls_gitaly: true
+
field :file_type, GraphQL::Types::String, null: true,
description: 'Expected format of the blob based on the extension.'
@@ -104,3 +108,5 @@ module Types
end
end
end
+
+Types::Repository::BlobType.prepend_mod_with('Types::Repository::BlobType')
diff --git a/app/helpers/sorting_helper.rb b/app/helpers/sorting_helper.rb
index b28e5ff39b2..fb30e8ca059 100644
--- a/app/helpers/sorting_helper.rb
+++ b/app/helpers/sorting_helper.rb
@@ -70,6 +70,15 @@ module SortingHelper
options
end
+ def forks_sort_options_hash
+ {
+ sort_value_recently_created => sort_title_created_date,
+ sort_value_oldest_created => sort_title_created_date,
+ sort_value_latest_activity => sort_title_latest_activity,
+ sort_value_oldest_activity => sort_title_latest_activity
+ }
+ end
+
def projects_sort_option_titles
# Only used for the project filter search bar
projects_sort_options_hash.merge({
@@ -93,6 +102,15 @@ module SortingHelper
}
end
+ def forks_reverse_sort_options_hash
+ {
+ sort_value_recently_created => sort_value_oldest_created,
+ sort_value_oldest_created => sort_value_recently_created,
+ sort_value_latest_activity => sort_value_oldest_activity,
+ sort_value_oldest_activity => sort_value_latest_activity
+ }
+ end
+
def groups_sort_options_hash
{
sort_value_name => sort_title_name,
@@ -303,6 +321,13 @@ module SortingHelper
sort_direction_button(url, reverse_sort, sort_value)
end
+
+ def forks_sort_direction_button(sort_value, without = [:state, :scope, :label_name, :milestone_id, :assignee_id, :author_id])
+ reverse_sort = forks_reverse_sort_options_hash[sort_value]
+ url = page_filter_path(sort: reverse_sort, without: without)
+
+ sort_direction_button(url, reverse_sort, sort_value)
+ end
end
SortingHelper.prepend_mod_with('SortingHelper')
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index e0126373864..7a2224c0dcf 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -190,8 +190,6 @@ module Ci
scope :without_coverage, -> { where(coverage: nil) }
scope :with_coverage_regex, -> { where.not(coverage_regex: nil) }
- scope :for_project, -> (project_id) { where(project_id: project_id) }
-
acts_as_taggable
add_authentication_token_field :token, encrypted: :required
@@ -288,6 +286,7 @@ module Ci
build.run_after_commit do
BuildQueueWorker.perform_async(id)
+ BuildHooksWorker.perform_async(id)
end
end
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 6a924c1b576..edf1191e2ab 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -648,7 +648,7 @@ module Ci
def coverage
coverage_array = latest_statuses.map(&:coverage).compact
if coverage_array.size >= 1
- '%.2f' % (coverage_array.reduce(:+) / coverage_array.size)
+ coverage_array.reduce(:+) / coverage_array.size
end
end
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index d80b2fe37dc..9054a25fdb5 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -53,6 +53,7 @@ class CommitStatus < Ci::ApplicationRecord
scope :before_stage, -> (index) { where('stage_idx < ?', index) }
scope :for_stage, -> (index) { where(stage_idx: index) }
scope :after_stage, -> (index) { where('stage_idx > ?', index) }
+ scope :for_project, -> (project_id) { where(project_id: project_id) }
scope :for_ref, -> (ref) { where(ref: ref) }
scope :by_name, -> (name) { where(name: name) }
scope :in_pipelines, ->(pipelines) { where(pipeline: pipelines) }
@@ -68,7 +69,8 @@ class CommitStatus < Ci::ApplicationRecord
# Pluck is used to split this query. Splitting the query is required for database decomposition for `ci_*` tables.
# https://docs.gitlab.com/ee/development/database/transaction_guidelines.html#database-decomposition-and-sharding
project_ids = Project.where_full_path_in(Array(paths)).pluck(:id)
- where(project: project_ids)
+
+ for_project(project_ids)
end
scope :with_preloads, -> do
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 8bc4a9db20a..3e94043234e 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -1802,7 +1802,7 @@ class MergeRequest < ApplicationRecord
def pipeline_coverage_delta
if base_pipeline&.coverage && head_pipeline&.coverage
- '%.2f' % (head_pipeline.coverage.to_f - base_pipeline.coverage.to_f)
+ head_pipeline.coverage - base_pipeline.coverage
end
end
diff --git a/app/presenters/blob_presenter.rb b/app/presenters/blob_presenter.rb
index 3555c6c3d0c..b310f8fff15 100644
--- a/app/presenters/blob_presenter.rb
+++ b/app/presenters/blob_presenter.rb
@@ -66,6 +66,11 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
project_ci_pipeline_editor_path(project, branch_name: blob.commit_id) if can_collaborate_with_project?(project) && blob.path == project.ci_config_path_or_default
end
+ # Will be overridden in EE
+ def code_owners
+ []
+ end
+
def fork_and_edit_path
fork_path_for_current_user(project, edit_blob_path)
end
@@ -147,3 +152,5 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
blob.data
end
end
+
+BlobPresenter.prepend_mod_with('BlobPresenter')
diff --git a/app/presenters/ci/pipeline_presenter.rb b/app/presenters/ci/pipeline_presenter.rb
index e0cb899c9d3..00820e00863 100644
--- a/app/presenters/ci/pipeline_presenter.rb
+++ b/app/presenters/ci/pipeline_presenter.rb
@@ -62,6 +62,13 @@ module Ci
localized_names.fetch(pipeline.merge_request_event_type, s_('Pipeline|Pipeline'))
end
+ delegator_override :coverage
+ def coverage
+ return unless pipeline.coverage.present?
+
+ '%.2f' % pipeline.coverage
+ end
+
def ref_text
if pipeline.detached_merge_request_pipeline?
_("for %{link_to_merge_request} with %{link_to_merge_request_source_branch}")
diff --git a/app/presenters/merge_request_presenter.rb b/app/presenters/merge_request_presenter.rb
index 380ed5d7bed..eeb94a8e657 100644
--- a/app/presenters/merge_request_presenter.rb
+++ b/app/presenters/merge_request_presenter.rb
@@ -254,6 +254,13 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
end
end
+ delegator_override :pipeline_coverage_delta
+ def pipeline_coverage_delta
+ return unless merge_request.pipeline_coverage_delta.present?
+
+ '%.2f' % merge_request.pipeline_coverage_delta
+ end
+
private
def cached_can_be_reverted?
diff --git a/app/serializers/ci/pipeline_entity.rb b/app/serializers/ci/pipeline_entity.rb
index a5af543f49f..d97c92ce993 100644
--- a/app/serializers/ci/pipeline_entity.rb
+++ b/app/serializers/ci/pipeline_entity.rb
@@ -4,7 +4,7 @@ class Ci::PipelineEntity < Grape::Entity
include RequestAwareEntity
include Gitlab::Utils::StrongMemoize
- delegate :name, :failure_reason, to: :presented_pipeline
+ delegate :name, :failure_reason, :coverage, to: :presented_pipeline
expose :id
expose :iid
diff --git a/app/serializers/merge_requests/pipeline_entity.rb b/app/serializers/merge_requests/pipeline_entity.rb
index bdf5cb160b2..f4fb01604d0 100644
--- a/app/serializers/merge_requests/pipeline_entity.rb
+++ b/app/serializers/merge_requests/pipeline_entity.rb
@@ -43,7 +43,9 @@ class MergeRequests::PipelineEntity < Grape::Entity
# Coverage isn't always necessary (e.g. when displaying project pipelines in
# the UI). Instead of creating an entirely different entity we just allow the
# disabling of this specific field whenever necessary.
- expose :coverage, unless: proc { options[:disable_coverage] }
+ expose :coverage, unless: proc { options[:disable_coverage] } do |pipeline|
+ pipeline.present.coverage
+ end
expose :ref do
expose :branch?, as: :branch
diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb
index b7ed9202b01..3a9418f1dfa 100644
--- a/app/services/projects/destroy_service.rb
+++ b/app/services/projects/destroy_service.rb
@@ -150,7 +150,7 @@ module Projects
::Ci::DestroyPipelineService.new(project, current_user).execute(pipeline)
end
- deleted_count = project.commit_statuses.delete_all
+ deleted_count = ::CommitStatus.for_project(project).delete_all
Gitlab::AppLogger.info(
class: 'Projects::DestroyService',
diff --git a/app/views/projects/_files.html.haml b/app/views/projects/_files.html.haml
index cdcc98552f9..2f4a61865f8 100644
--- a/app/views/projects/_files.html.haml
+++ b/app/views/projects/_files.html.haml
@@ -10,10 +10,11 @@
.nav-block.gl-display-flex.gl-xs-flex-direction-column.gl-align-items-stretch
= render 'projects/tree/tree_header', tree: @tree
- #js-last-commit
- .info-well.gl-display-none.gl-sm-display-flex.project-last-commit
+ .info-well.gl-display-none.gl-sm-display-flex.project-last-commit.gl-flex-direction-column
+ #js-last-commit.gl-m-auto
.gl-spinner-container.m-auto
= loading_icon(size: 'md', color: 'dark', css_class: 'align-text-bottom')
+ #js-code-owners
- if is_project_overview
.project-buttons.gl-mb-3.js-show-on-project-root
diff --git a/app/views/projects/forks/index.html.haml b/app/views/projects/forks/index.html.haml
index ba4e40a8675..d6f421e8ad6 100644
--- a/app/views/projects/forks/index.html.haml
+++ b/app/views/projects/forks/index.html.haml
@@ -1,40 +1,36 @@
+- sort_value = @sort || sort_value_recently_created
+- sort_title = forks_sort_options_hash[sort_value]
+
.top-area
.nav-text
- full_count_title = "#{@public_forks_count} public, #{@internal_forks_count} internal, and #{@private_forks_count} private"
#{pluralize(@total_forks_count, 'fork')}: #{full_count_title}
- .nav-controls
- = form_tag request.original_url, method: :get, class: 'project-filter-form', id: 'project-filter-form' do |f|
- = search_field_tag :filter_projects, nil, placeholder: _('Search forks'), class: 'projects-list-filter project-filter-form-field form-control input-short',
+ .gl-display-flex.gl-sm-flex-direction-column.gl-md-align-items-center
+ = form_tag request.original_url, method: :get, class: 'project-filter-form gl-display-flex gl-mt-3 gl-md-mt-0', id: 'project-filter-form' do |f|
+ = search_field_tag :filter_projects, nil, placeholder: _('Search forks'), class: 'projects-list-filter project-filter-form-field form-control input-short gl-flex-grow-1',
spellcheck: false, data: { 'filter-selector' => 'span.namespace-name' }
- .dropdown
- %button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' }
- %span.light= _("sort:")
- - if @sort.present?
- = sort_options_hash[@sort]
- - else
- = sort_title_recently_created
- = sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon gl-top-3')
- %ul.dropdown-menu.dropdown-menu-right
- %li
- - excluded_filters = [:state, :scope, :label_name, :milestone_id, :assignee_id, :author_id]
- = link_to page_filter_path(sort: sort_value_recently_created, without: excluded_filters) do
- = sort_title_recently_created
- = link_to page_filter_path(sort: sort_value_oldest_created, without: excluded_filters) do
- = sort_title_oldest_created
- = link_to page_filter_path(sort: sort_value_recently_updated, without: excluded_filters) do
- = sort_title_recently_updated
- = link_to page_filter_path(sort: sort_value_oldest_updated, without: excluded_filters) do
- = sort_title_oldest_updated
+ .dropdown.gl-display-inline.gl-md-ml-3.issue-sort-dropdown.gl-mt-3.gl-md-mt-0
+ .btn-group{ role: 'group' }
+ .btn-group{ role: 'group' }
+ %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'gl-button btn btn-default' }
+ = sort_title
+ = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3")
+ %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort
+ %li
+ - excluded_filters = [:state, :scope, :label_name, :milestone_id, :assignee_id, :author_id]
+ = sortable_item(sort_title_created_date, page_filter_path(sort: sort_value_recently_created, without: excluded_filters), sort_title)
+ = sortable_item(sort_title_latest_activity, page_filter_path(sort: sort_value_latest_activity, without: excluded_filters), sort_title)
+ = forks_sort_direction_button(sort_value)
- if current_user && can?(current_user, :fork_project, @project)
- if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2
- = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: _('Go to your fork'), class: 'btn gl-button btn-confirm' do
+ = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: _('Go to your fork'), class: 'btn gl-button btn-confirm gl-md-ml-3' do
= sprite_icon('fork', size: 12)
%span= _('Fork')
- else
- = link_to new_project_fork_path(@project), title: _("Fork project"), class: 'btn gl-button btn-confirm' do
+ = link_to new_project_fork_path(@project), title: _("Fork project"), class: 'btn gl-button btn-confirm gl-md-ml-3 gl-mt-3 gl-md-mt-0' do
= sprite_icon('fork', size: 12)
%span= _('Fork')
diff --git a/app/views/shared/_milestone_expired.html.haml b/app/views/shared/_milestone_expired.html.haml
index 925344ab2f7..8c84f96932c 100644
--- a/app/views/shared/_milestone_expired.html.haml
+++ b/app/views/shared/_milestone_expired.html.haml
@@ -1,6 +1,6 @@
- if milestone.expired? && !milestone.closed?
- .gl-badge.badge-warning.badge-pill.gl-mb-2= _('Expired')
+ = gl_badge_tag _('Expired'), { variant: :warning }, { class: "gl-mb-2" }
- if milestone.upcoming?
- .gl-badge.badge-primary.badge-pill.gl-mb-2= _('Upcoming')
+ = gl_badge_tag _('Upcoming'), { variant: :info }, { class: "gl-mb-2" }
- if milestone.closed?
- .gl-badge.badge-danger.badge-pill.gl-mb-2= _('Closed')
+ = gl_badge_tag _('Closed'), { variant: :danger }, { class: "gl-mb-2" }
diff --git a/app/views/shared/milestones/_milestone.html.haml b/app/views/shared/milestones/_milestone.html.haml
index 44934a12559..4e06b7902bd 100644
--- a/app/views/shared/milestones/_milestone.html.haml
+++ b/app/views/shared/milestones/_milestone.html.haml
@@ -33,11 +33,9 @@
%div
= render('shared/milestone_expired', milestone: milestone)
- if milestone.group_milestone?
- .gl-badge.badge-info.badge-pill
- = milestone.group.full_name
+ = gl_badge_tag milestone.group.full_name, variant: :info
- if milestone.project_milestone?
- .gl-badge.badge-muted.badge-pill
- = milestone.project.full_name
+ = gl_badge_tag milestone.project.full_name, variant: :muted
.col-sm-4.milestone-progress
= milestone_progress_bar(milestone)
diff --git a/doc/administration/package_information/supported_os.md b/doc/administration/package_information/supported_os.md
index d3465ae43a7..3c62ab79920 100644
--- a/doc/administration/package_information/supported_os.md
+++ b/doc/administration/package_information/supported_os.md
@@ -1,10 +1,10 @@
---
stage: Enablement
group: Distribution
-info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
-# Supported Operating Systems
+# Supported operating systems **(FREE SELF)**
GitLab officially supports LTS versions of operating systems. While OSs like
Ubuntu have a clear distinction between LTS and non-LTS versions, there are
@@ -57,7 +57,7 @@ WARNING:
There are currently still some [known issues and limitation](https://gitlab.com/groups/gitlab-org/-/epics/4397)
running GitLab on ARM.
-## OS Versions that are no longer supported **(FREE SELF)**
+## OS Versions that are no longer supported
GitLab provides omnibus packages for operating systems only until their
EOL (End-Of-Life). After the EOL date of the OS, GitLab will stop releasing
diff --git a/doc/administration/uploads.md b/doc/administration/uploads.md
index 15ef024647c..feb02cf4f91 100644
--- a/doc/administration/uploads.md
+++ b/doc/administration/uploads.md
@@ -51,12 +51,6 @@ _The uploads are stored by default in
## Using object storage **(FREE SELF)**
-> **Notes:**
->
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/3867) in GitLab 10.5.
-> - [Moved](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17358) from GitLab Premium to GitLab Free in 10.7.
-> - Since version 11.1, we support direct_upload to S3.
-
If you don't want to use the local disk where GitLab is installed to store the
uploads, you can use an object storage provider like AWS S3 instead.
This configuration relies on valid AWS credentials to be configured already.
diff --git a/doc/api/branches.md b/doc/api/branches.md
index 7b9354f3264..4e2a0306845 100644
--- a/doc/api/branches.md
+++ b/doc/api/branches.md
@@ -40,14 +40,14 @@ Example response:
```json
[
{
- "name": "master",
+ "name": "main",
"merged": false,
"protected": true,
"default": true,
"developers_can_push": false,
"developers_can_merge": false,
"can_push": true,
- "web_url": "https://gitlab.example.com/my-group/my-project/-/tree/master",
+ "web_url": "https://gitlab.example.com/my-group/my-project/-/tree/main",
"commit": {
"author_email": "john@example.com",
"author_name": "John Smith",
@@ -89,7 +89,7 @@ Parameters:
Example request:
```shell
-curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/branches/master"
+curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/branches/main"
```
Example response:
@@ -103,7 +103,7 @@ Example response:
"developers_can_push": false,
"developers_can_merge": false,
"can_push": true,
- "web_url": "https://gitlab.example.com/my-group/my-project/-/tree/master",
+ "web_url": "https://gitlab.example.com/my-group/my-project/-/tree/main",
"commit": {
"author_email": "john@example.com",
"author_name": "John Smith",
@@ -151,7 +151,7 @@ Parameters:
Example request:
```shell
-curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/branches?branch=newbranch&ref=master"
+curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/branches?branch=newbranch&ref=main"
```
Example response:
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index 92a37a800a7..bf8cf7dcd73 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -14142,6 +14142,7 @@ Returns [`Tree`](#tree).
| ---- | ---- | ----------- |
| <a id="repositoryblobcancurrentuserpushtobranch"></a>`canCurrentUserPushToBranch` | [`Boolean`](#boolean) | Whether the current user can push to the branch. |
| <a id="repositoryblobcanmodifyblob"></a>`canModifyBlob` | [`Boolean`](#boolean) | Whether the current user can modify the blob. |
+| <a id="repositoryblobcodeowners"></a>`codeOwners` | [`[UserCore!]`](#usercore) | List of code owners for the blob. |
| <a id="repositoryblobeditblobpath"></a>`editBlobPath` | [`String`](#string) | Web path to edit the blob in the old-style editor. |
| <a id="repositoryblobexternalstorageurl"></a>`externalStorageUrl` | [`String`](#string) | Web path to download the raw blob via external storage, if enabled. |
| <a id="repositoryblobfiletype"></a>`fileType` | [`String`](#string) | Expected format of the blob based on the extension. |
diff --git a/doc/api/import.md b/doc/api/import.md
index 18c0eb04fff..1baea5d1500 100644
--- a/doc/api/import.md
+++ b/doc/api/import.md
@@ -4,7 +4,7 @@ group: Import
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
-# Import API
+# Import API **(FREE)**
## Import repository from GitHub
diff --git a/doc/development/application_slis/index.md b/doc/development/application_slis/index.md
index 5bc6fffdb48..87c0bcfede5 100644
--- a/doc/development/application_slis/index.md
+++ b/doc/development/application_slis/index.md
@@ -180,7 +180,7 @@ alerts about the SLI in specified Slack channels. For more information, read the
[alert routing documentation](https://gitlab.com/gitlab-com/runbooks/-/blob/master/docs/uncategorized/alert-routing.md).
In [this project](https://gitlab.com/groups/gitlab-com/gl-infra/-/epics/614)
we are extending this so alerts for SLIs with a `feature_category`
-label in the souce metrics can also be routed.
+label in the source metrics can also be routed.
For any question, please don't hesitate to create an issue in
[the Scalability issue tracker](https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues)
diff --git a/doc/development/backend/ruby_style_guide.md b/doc/development/backend/ruby_style_guide.md
index 461bb9aafde..419db628b0d 100644
--- a/doc/development/backend/ruby_style_guide.md
+++ b/doc/development/backend/ruby_style_guide.md
@@ -9,7 +9,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
This is a GitLab-specific style guide for Ruby code.
-Generally, if a style is not covered by [existing rubocop rules or styleguides](../contributing/style_guides.md#ruby-rails-rspec), it shouldn't be a blocker.
+Generally, if a style is not covered by [existing Rubocop rules or style guides](../contributing/style_guides.md#ruby-rails-rspec), it shouldn't be a blocker.
Before adding a new cop to enforce a given style, make sure to discuss it with your team.
When the style is approved by a backend EM or by a BE staff eng, add a new section to this page to
document the new rule. For every new guideline, add it in a new section and link the discussion from the section's
diff --git a/doc/development/database/loose_foreign_keys.md b/doc/development/database/loose_foreign_keys.md
index fb84a004f23..19f5ccebf74 100644
--- a/doc/development/database/loose_foreign_keys.md
+++ b/doc/development/database/loose_foreign_keys.md
@@ -214,5 +214,5 @@ permission checks.
We considered using these Rails features as an alternative to foreign keys but there are several problems which include:
1. These run on a different connection in the context of a transaction [which we do not allow](multiple_databases.md#removing-cross-database-transactions).
-1. These can lead to severe performance degredation as we load all records from PostgreSQL, loop over them in Ruby, and call individual `DELETE` queries.
+1. These can lead to severe performance degradation as we load all records from PostgreSQL, loop over them in Ruby, and call individual `DELETE` queries.
1. These can miss data as they only cover the case when the `destroy` method is called directly on the model. There are other cases including `delete_all` and cascading deletes from another parent table that could mean these are missed.
diff --git a/doc/development/feature_flags/controls.md b/doc/development/feature_flags/controls.md
index abb100c659e..4843b58c3fd 100644
--- a/doc/development/feature_flags/controls.md
+++ b/doc/development/feature_flags/controls.md
@@ -12,7 +12,8 @@ info: "See the Technical Writers assigned to Development Guidelines: https://abo
To be able to turn on/off features behind feature flags in any of the
GitLab Inc. provided environments such as staging and production, you need to
have access to the [ChatOps](../chatops_on_gitlabcom.md) bot. The ChatOps bot
-is currently running on the ops instance, which is different from <https://gitlab.com> or <https://dev.gitlab.org>.
+is currently running on the ops instance, which is different from
+[GitLab.com](https://gitlab.com) or [`dev.gitlab.org`](https://dev.gitlab.org).
Follow the ChatOps document to [request access](../chatops_on_gitlabcom.md#requesting-access).
@@ -35,12 +36,12 @@ This allows you to separate rolling out a feature from a deploy, making it
easier to measure the impact of both separately.
The GitLab feature library (using
-[Flipper](https://github.com/jnunemaker/flipper), and covered in the [Feature
-Flags process](https://about.gitlab.com/handbook/product-development-flow/feature-flag-lifecycle/) guide) supports rolling out changes to a percentage of
+[Flipper](https://github.com/jnunemaker/flipper), and covered in the
+[Feature Flags process](https://about.gitlab.com/handbook/product-development-flow/feature-flag-lifecycle/) guide) supports rolling out changes to a percentage of
time to users. This in turn can be controlled using [GitLab ChatOps](../../ci/chatops/index.md).
-For an up to date list of feature flag commands please see [the source
-code](https://gitlab.com/gitlab-com/chatops/blob/master/lib/chatops/commands/feature.rb).
+For an up to date list of feature flag commands please see
+[the source code](https://gitlab.com/gitlab-com/chatops/blob/master/lib/chatops/commands/feature.rb).
Note that all the examples in that file must be preceded by
`/chatops run`.
@@ -50,15 +51,16 @@ change feature flags or you do not [have access](#access).
### Enabling a feature for pre-production testing
-As a first step in a feature rollout, you should enable the feature on <https://about.staging.gitlab.com>
-and <https://dev.gitlab.org>.
+As a first step in a feature rollout, you should enable the feature on
+[`about.staging.gitlab.com`](https://about.staging.gitlab.com)
+and [`dev.gitlab.org`](https://dev.gitlab.org).
These two environments have different scopes.
`dev.gitlab.org` is a production CE environment that has internal GitLab Inc.
traffic and is used for some development and other related work.
`staging.gitlab.com` has a smaller subset of GitLab.com database and repositories
and does not have regular traffic. Staging is an EE instance and can give you
-a (very) rough estimate of how your feature will look/behave on GitLab.com.
+a (very) rough estimate of how your feature will look and behave on GitLab.com.
Both of these instances are connected to Sentry so make sure you check the projects
there for any exceptions while testing your feature after enabling the feature flag.
@@ -97,7 +99,7 @@ Guidelines:
#### Process
When enabling a feature flag rollout, the system will automatically block the
-chatops command from succeeding if there are active `"severity::1"` or `~"severity::2"`
+ChatOps command from succeeding if there are active `"severity::1"` or `~"severity::2"`
incidents or in-progress change issues, for example:
```shell
@@ -227,7 +229,7 @@ Note, that if an actor based feature gate is present, switching the
`default_enabled` attribute of the YAML definition from `false` to `true`
will not have any effect. The feature gate must be deleted first.
-For example, a feature flag is set via chatops:
+For example, a feature flag is set via ChatOps:
```shell
/chatops run feature set --project=gitlab-org/gitlab some_feature true
@@ -265,7 +267,7 @@ To disable a feature flag that has been enabled for a specific project you can r
You cannot selectively disable feature flags for a specific project/group/user without applying a [specific method of implementing](index.md#selectively-disable-by-actor) the feature flags.
-If a feature flag is disabled via chatops, that will take precedence over the `default_enabled` value in the YML. In other words, you could have a feature enabled for on-premise installations but not for GitLab.com.
+If a feature flag is disabled via ChatOps, that will take precedence over the `default_enabled` value in the YML. In other words, you could have a feature enabled for on-premise installations but not for GitLab.com.
### Feature flag change logging
diff --git a/doc/development/merge_request_performance_guidelines.md b/doc/development/merge_request_performance_guidelines.md
index 74b1d5680b0..69e9f7d16e3 100644
--- a/doc/development/merge_request_performance_guidelines.md
+++ b/doc/development/merge_request_performance_guidelines.md
@@ -205,7 +205,7 @@ Keeping the old behavior requires marking CTEs with the keyword `MATERIALIZED`.
When building CTE statements, use the `Gitlab::SQL::CTE` class [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56976) in GitLab 13.11.
By default, this `Gitlab::SQL::CTE` class forces materialization through adding the `MATERIALIZED` keyword for PostgreSQL 12 and higher.
`Gitlab::SQL::CTE` automatically omits materialization when PostgreSQL 11 is running
-(this behavior is implemented using a custom arel node `Gitlab::Database::AsWithMaterialized` under the surface).
+(this behavior is implemented using a custom Arel node `Gitlab::Database::AsWithMaterialized` under the surface).
WARNING:
We plan to drop the support for PostgreSQL 11. Upgrading to GitLab 14.0 requires PostgreSQL 12 or higher.
diff --git a/doc/development/performance.md b/doc/development/performance.md
index e59f7fb154b..b5294c8359d 100644
--- a/doc/development/performance.md
+++ b/doc/development/performance.md
@@ -365,7 +365,7 @@ This patch is available by default for
[GCK](https://gitlab.com/gitlab-org/gitlab-compose-kit/-/merge_requests/149)
and can additionally be enabled for [GDK](https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/advanced.md#apply-custom-patches-for-ruby).
-This patch provides the following metrics that make it easier to understand efficiency of memory use for a given codepath:
+This patch provides the following metrics that make it easier to understand efficiency of memory use for a given code path:
- `mem_total_bytes`: the number of bytes consumed both due to new objects being allocated into existing object slots
plus additional memory allocated for large objects (that is, `mem_bytes + slot_size * mem_objects`).
@@ -384,7 +384,7 @@ and `100M mem_bytes`. You can view the current usage on [GitLab.com](https://log
There are two ways of measuring your own code:
1. Review `api_json.log`, `development_json.log`, `sidekiq.log` that includes memory allocation counters.
-1. Use `Gitlab::Memory::Instrumentation.with_memory_allocations` for a given codeblock and log it.
+1. Use `Gitlab::Memory::Instrumentation.with_memory_allocations` for a given code block and log it.
1. Use [Measuring module](service_measurement.md)
```json
diff --git a/doc/development/rails_update.md b/doc/development/rails_update.md
index f25d68a8900..1a30e606c17 100644
--- a/doc/development/rails_update.md
+++ b/doc/development/rails_update.md
@@ -71,7 +71,7 @@ To efficiently and quickly find which Rails change caused the spec failure you c
gem 'rails', ENV['RAILS_VERSION'], path: ENV['RAILS_FOLDER']
```
-1. Set the `RAILS_FOLDER` env variable with the folder you cloned Rails into:
+1. Set the `RAILS_FOLDER` environment variable with the folder you cloned Rails into:
```shell
export RAILS_FOLDER="<GDK_FOLDER>/rails"
diff --git a/doc/development/ruby_upgrade.md b/doc/development/ruby_upgrade.md
index 064cb8daf98..2102a256645 100644
--- a/doc/development/ruby_upgrade.md
+++ b/doc/development/ruby_upgrade.md
@@ -190,7 +190,7 @@ via `gdk update`.
This pause is a good time to assess the risk of this upgrade for GitLab SaaS.
For Ruby upgrades that are high risk, such as major version upgrades, it is recommended to
coordinate the changes with the infrastructure team through a [change management request](https://about.gitlab.com/handbook/engineering/infrastructure/change-management/).
-Create this issue early to give everyone enough time to schedule and prepare changes.
+Create this issue early to give everyone enough time to schedule and prepare changes.
### Make it the default Ruby
@@ -205,7 +205,7 @@ in that repository. This change is only necessary when the minor or major versio
([example](https://gitlab.com/gitlab-org/gitlab-compose-kit/-/merge_requests/176).)
As mentioned above, if the impact of the Ruby upgrade on SaaS availability is uncertain, it is
-prudent to skip this step until you have verified that it runs smootly in production via a staged
+prudent to skip this step until you have verified that it runs smoothly in production via a staged
rollout. In this case, go to the next step first, and then, after the verification period has passed, promote
the new Ruby to be the new default.
diff --git a/doc/development/stage_group_dashboards.md b/doc/development/stage_group_dashboards.md
index a887558e473..88e9141574e 100644
--- a/doc/development/stage_group_dashboards.md
+++ b/doc/development/stage_group_dashboards.md
@@ -60,8 +60,8 @@ component can have 2 indicators:
We're working on making this target configurable per endpoint in [this
project](https://gitlab.com/groups/gitlab-com/gl-infra/-/epics/525). Learn
- how to [customize the request
- apdex](application_slis/rails_request_apdex.md), this new apdex
+ how to
+ [customize the request Apdex](application_slis/rails_request_apdex.md), this new Apdex
measurement is not yet part of the error budget.
For Sidekiq job execution, the threshold depends on the [job
diff --git a/doc/development/testing_guide/best_practices.md b/doc/development/testing_guide/best_practices.md
index fab75581855..0f768a51b66 100644
--- a/doc/development/testing_guide/best_practices.md
+++ b/doc/development/testing_guide/best_practices.md
@@ -964,7 +964,7 @@ creates and deletes indices between examples to ensure a clean index, so that th
for polluting the tests with nonessential data.
Most tests for Elasticsearch logic relate to:
-- Creating data in Postgres and waiting for it to be indexed in Elasticsearch.
+- Creating data in PostgreSQL and waiting for it to be indexed in Elasticsearch.
- Searching for that data.
- Ensuring that the test gives the expected result.
@@ -980,7 +980,7 @@ You do NOT need to add `:clean_gitlab_redis_shared_state` manually.
Specs using Elasticsearch require that you:
-- Create data in Postgres and then index it into Elasticsearch.
+- Create data in PostgreSQL and then index it into Elasticsearch.
- Enable Application Settings for Elasticsearch (which is disabled by default).
To do so, use:
@@ -994,7 +994,7 @@ end
Additionally, you can use the `ensure_elasticsearch_index!` method to overcome the asynchronous nature of Elasticsearch.
It uses the [Elasticsearch Refresh API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html#refresh-api-desc)
to make sure all operations performed on an index since the last refresh are available for search. This method is typically
-called after loading data into Postgres to ensure the data is indexed and searchable.
+called after loading data into PostgreSQL to ensure the data is indexed and searchable.
#### Test Snowplow events
diff --git a/doc/development/testing_guide/review_apps.md b/doc/development/testing_guide/review_apps.md
index cfdb3ad0d62..c948b906ce0 100644
--- a/doc/development/testing_guide/review_apps.md
+++ b/doc/development/testing_guide/review_apps.md
@@ -15,7 +15,6 @@ For any of the following scenarios, the `start-review-app-pipeline` job would be
- for merge requests with CI config changes
- for merge requests with frontend changes
- for merge requests with QA changes
-- for scheduled pipelines
- the MR has the `pipeline:run-review-app` label set
## QA runs on Review Apps
diff --git a/doc/install/aws/gitlab_hybrid_on_aws.md b/doc/install/aws/gitlab_hybrid_on_aws.md
index 377b78b27f9..dbd23ff2b30 100644
--- a/doc/install/aws/gitlab_hybrid_on_aws.md
+++ b/doc/install/aws/gitlab_hybrid_on_aws.md
@@ -131,7 +131,7 @@ Some services, such as log aggregation, outbound email are not specified by GitL
- TBD
**Deploy Now**
- Deploy Now links leverage the AWS Quick Start automation and only prepopulate the number of instances and instance types for the Quick Start based on the Bill of Meterials below. You must provide appropriate input for all other parameters by following the guidance in the [Quick Start documentation's Deployment steps](https://aws-quickstart.github.io/quickstart-eks-gitlab/#_deployment_steps) section.
+ Deploy Now links leverage the AWS Quick Start automation and only pre-populate the number of instances and instance types for the Quick Start based on the Bill of Materials below. You must provide appropriate input for all other parameters by following the guidance in the [Quick Start documentation's Deployment steps](https://aws-quickstart.github.io/quickstart-eks-gitlab/#_deployment_steps) section.
- **Deploy Now: AWS Quick Start for 2 AZs**
- **Deploy Now: AWS Quick Start for 3 AZs**
@@ -184,7 +184,7 @@ If EKS node autoscaling is employed, it is likely that your average loading will
**Deploy Now**
-Deploy Now links leverage the AWS Quick Start automation and only prepopulate the number of instances and instance types for the Quick Start based on the Bill of Meterials below. You must provide appropriate input for all other parameters by following the guidance in the [Quick Start documentation's Deployment steps](https://aws-quickstart.github.io/quickstart-eks-gitlab/#_deployment_steps) section.
+Deploy Now links leverage the AWS Quick Start automation and only pre-populate the number of instances and instance types for the Quick Start based on the Bill of Materials below. You must provide appropriate input for all other parameters by following the guidance in the [Quick Start documentation's Deployment steps](https://aws-quickstart.github.io/quickstart-eks-gitlab/#_deployment_steps) section.
- **[Deploy Now: AWS Quick Start for 2 AZs](https://us-east-2.console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/quickcreate?templateUrl=https://aws-quickstart.s3.us-east-1.amazonaws.com/quickstart-eks-gitlab/templates/gitlab-entry-new-vpc.template.yaml&stackName=Gitlab-EKS-3K-Users-2AZs&param_NumberOfAZs=2&param_NodeInstanceType=c5.2xlarge&param_NumberOfNodes=3&param_MaxNumberOfNodes=3&param_DBInstanceClass=db.r6g.xlarge&param_CacheNodes=2&param_CacheNodeType=cache.m6g.large&param_GitalyInstanceType=m5.large&param_NumberOfGitalyReplicas=3&param_PraefectInstanceType=c5.large&param_NumberOfPraefectReplicas=3)**
- **[Deploy Now: AWS Quick Start for 3 AZs](https://us-east-2.console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/quickcreate?templateUrl=https://aws-quickstart.s3.us-east-1.amazonaws.com/quickstart-eks-gitlab/templates/gitlab-entry-new-vpc.template.yaml&stackName=Gitlab-EKS-3K-Users-3AZs&param_NumberOfAZs=3&param_NodeInstanceType=c5.2xlarge&param_NumberOfNodes=3&param_MaxNumberOfNodes=3&param_DBInstanceClass=db.r6g.xlarge&param_CacheNodes=3&param_CacheNodeType=cache.m6g.large&param_GitalyInstanceType=m5.large&param_NumberOfGitalyReplicas=3&param_PraefectInstanceType=c5.large&param_NumberOfPraefectReplicas=3)**
diff --git a/doc/install/aws/gitlab_sre_for_aws.md b/doc/install/aws/gitlab_sre_for_aws.md
index faec73801ab..2114ed51128 100644
--- a/doc/install/aws/gitlab_sre_for_aws.md
+++ b/doc/install/aws/gitlab_sre_for_aws.md
@@ -10,7 +10,7 @@ description: Doing SRE for GitLab instances and runners on AWS.
## Gitaly SRE considerations
-Gitaly is an embedded service for Git Repository Storage. Gitaly and Gitaly Cluster have been engineered by GitLab to overcome fundamental challenges with horizontal scaling of the open source Git binaries that must be used on the service side of GitLab. Here is indepth technical reading on the topic:
+Gitaly is an embedded service for Git Repository Storage. Gitaly and Gitaly Cluster have been engineered by GitLab to overcome fundamental challenges with horizontal scaling of the open source Git binaries that must be used on the service side of GitLab. Here is in-depth technical reading on the topic:
### Why Gitaly was built
@@ -66,14 +66,14 @@ All recommendations are for production configurations, including performance tes
#### Network I/O recommendations
-- Use only instance types [from the list of ones that support ENA advanced networking]( https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#instance-type-summary-table) to ensure that cluster replication latency is not due to instance level network I/O bottlenecking.
+- Use only instance types [from the list of ones that support ENA advanced networking]( https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#instance-type-summary-table) to ensure that cluster replication latency is not due to instance level network I/O bottlenecks.
- Choose instances with sizes with more than 10 Gbps - but only if needed and only when having proven a node level network bottleneck with monitoring and/or stress testing.
**To accommodate:**
- Gitaly nodes do the main work of streaming repositories for push and pull operations (to add development endpoints, and to CI/CD).
- Gitaly servers need reasonable low latency between cluster nodes and with Praefect services in order for the cluster to maintain operational and data integrity.
-- Gitaly nodes should be selected with network bottlenecking avoidance as a primary consideration.
+- Gitaly nodes should be selected with network bottleneck avoidance as a primary consideration.
- Gitaly nodes should be monitored for network saturation.
- Not all networking issues can be solved through optimizing the node level networking:
- Gitaly cluster node replication depends on all networking between nodes.
diff --git a/doc/install/aws/manual_install_aws.md b/doc/install/aws/manual_install_aws.md
index 22f89075b3e..a39983b5bcf 100644
--- a/doc/install/aws/manual_install_aws.md
+++ b/doc/install/aws/manual_install_aws.md
@@ -28,7 +28,7 @@ The Infrastructure as Code tooling [GitLab Environment Tool (GET)](https://gitla
### Getting started for production-grade Cloud Native Hybrid GitLab
-For the Cloud Native Hybrid architectures there are two Infrastructure as Code options which are compared in GitLab Cloud Native Hybrid on AWS EKS implementation pattern in the section [Available Infrastructure as Code for GitLab Cloud Native Hybrid](gitlab_hybrid_on_aws.md#available-infrastructure-as-code-for-gitlab-cloud-native-hybrid). It compares the [GitLab Environment Toolkit](https://gitlab.com/gitlab-org/quality/gitlab-environment-toolkit/-/tree/master) to the AWS Quick Start for GitLab Cloud Native Hybrid on EKS which was codeveloped by GitLab and AWS. GET and the AWS Quick Start are both open source so anyone can build on top of them and contribute improvements to them.
+For the Cloud Native Hybrid architectures there are two Infrastructure as Code options which are compared in GitLab Cloud Native Hybrid on AWS EKS implementation pattern in the section [Available Infrastructure as Code for GitLab Cloud Native Hybrid](gitlab_hybrid_on_aws.md#available-infrastructure-as-code-for-gitlab-cloud-native-hybrid). It compares the [GitLab Environment Toolkit](https://gitlab.com/gitlab-org/quality/gitlab-environment-toolkit/-/tree/master) to the AWS Quick Start for GitLab Cloud Native Hybrid on EKS which was co-developed by GitLab and AWS. GET and the AWS Quick Start are both open source so anyone can build on top of them and contribute improvements to them.
## Introduction
@@ -533,7 +533,7 @@ gitlab=# \q
```ruby
# Disable the built-in Postgres
postgresql['enable'] = false
-
+
# Fill in the connection details
gitlab_rails['db_adapter'] = "postgresql"
gitlab_rails['db_encoding'] = "unicode"
@@ -549,7 +549,7 @@ gitlab=# \q
```ruby
# Disable the built-in Redis
redis['enable'] = false
-
+
# Fill in the connection details
gitlab_rails['redis_host'] = "<redis-endpoint>"
gitlab_rails['redis_port'] = 6379
diff --git a/doc/install/docker.md b/doc/install/docker.md
index 00e19e2977b..441da3412b4 100644
--- a/doc/install/docker.md
+++ b/doc/install/docker.md
@@ -199,11 +199,11 @@ configure and deploy your
Docker-based GitLab installation in a swarm cluster.
In swarm mode you can leverage [Docker secrets](https://docs.docker.com/engine/swarm/secrets/)
-and [Docker configs](https://docs.docker.com/engine/swarm/configs/) to efficiently and securely deploy your GitLab instance.
+and [Docker configurations](https://docs.docker.com/engine/swarm/configs/) to efficiently and securely deploy your GitLab instance.
Secrets can be used to securely pass your initial root password without exposing it as an environment variable.
-Configs can help you to keep your GitLab image as generic as possible.
+Configurations can help you to keep your GitLab image as generic as possible.
-Here's an example that deploys GitLab with four runners as a [stack](https://docs.docker.com/get-started/part5/), using secrets and configs:
+Here's an example that deploys GitLab with four runners as a [stack](https://docs.docker.com/get-started/part5/), using secrets and configurations:
1. [Set up a Docker swarm](https://docs.docker.com/engine/swarm/swarm-tutorial/).
1. Create a `docker-compose.yml` file:
@@ -643,4 +643,4 @@ purpose.
### Docker containers exhausts space due to the `json-file`
-Docker's [default logging driver is `json-file`](https://docs.docker.com/config/containers/logging/configure/#configure-the-default-logging-driver), which performs no log rotation by default. As a result of this lack of rotation, log files stored by the `json-file` driver can consume a significant amount of disk space for containers that generate a lot of output. This can lead to disk space exhaustion. To address this, use [journald](https://docs.docker.com/config/containers/logging/journald/) as the logging driver when available, or [another supported driver](https://docs.docker.com/config/containers/logging/configure/#supported-logging-drivers) with native rotation support.
+Docker's [default logging driver is `json-file`](https://docs.docker.com/config/containers/logging/configure/#configure-the-default-logging-driver), which performs no log rotation by default. As a result of this lack of rotation, log files stored by the `json-file` driver can consume a significant amount of disk space for containers that generate a lot of output. This can lead to disk space exhaustion. To address this, use [`journald`](https://docs.docker.com/config/containers/logging/journald/) as the logging driver when available, or [another supported driver](https://docs.docker.com/config/containers/logging/configure/#supported-logging-drivers) with native rotation support.
diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md
index fab5f3ec39d..e86edb886f6 100644
--- a/doc/raketasks/backup_restore.md
+++ b/doc/raketasks/backup_restore.md
@@ -70,7 +70,7 @@ Backups do not include:
- [Mattermost data](https://docs.mattermost.com/administration/config-settings.html#file-storage)
WARNING:
-GitLab does not back up any configuration files (`/etc/gitlab`), SSL certificates, or system
+GitLab does not back up any configuration files (`/etc/gitlab`), TLS keys and certificates, or system
files. You are highly advised to read about [storing configuration files](#storing-configuration-files).
WARNING:
@@ -190,8 +190,9 @@ on a Kubernetes cluster, you must follow the
[Back up the secrets](https://docs.gitlab.com/charts/backup-restore/backup.html#backup-the-secrets)
instructions.
-You may also want to back up any TLS keys and certificates (`/etc/gitlab/ssl`), and your
-[SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079).
+You may also want to back up any TLS keys and certificates (`/etc/gitlab/ssl`, `/etc/gitlab/trusted-certs`), and your
+[SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079)
+to avoid man-in-the-middle attack warnings if you have to perform a full machine restore.
If you use Omnibus GitLab, review additional information to
[backup your configuration](https://docs.gitlab.com/omnibus/settings/backups.html).
@@ -903,7 +904,9 @@ If you fail to restore this encryption key file along with the application data
backup, users with two-factor authentication enabled and GitLab Runner
loses access to your GitLab server.
-You may also want to restore any TLS keys, certificates (`/etc/gitlab/ssl`), or
+You may also want to restore your previous `/etc/gitlab/gitlab.rb` (for Omnibus packages)
+or `/home/git/gitlab/config/gitlab.yml` (for installations from source) and
+any TLS keys, certificates (`/etc/gitlab/ssl`, `/etc/gitlab/trusted-certs`), or
[SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079).
Starting with GitLab 12.9, if an untarred backup (like the ones made with
diff --git a/doc/update/plan_your_upgrade.md b/doc/update/plan_your_upgrade.md
index b6cd4a3c761..cd2de628234 100644
--- a/doc/update/plan_your_upgrade.md
+++ b/doc/update/plan_your_upgrade.md
@@ -71,7 +71,7 @@ comprised of a way to back up the instance and a way to restore it.
### Back up GitLab
-Create a backup of GitLab and all its data (database, repos, uploads, builds,
+Create a backup of GitLab and all its data (database, repositories, uploads, builds,
artifacts, LFS objects, registry, pages). This is vital for making it possible
to roll back GitLab to a working state if there's a problem with the upgrade:
diff --git a/doc/user/application_security/container_scanning/index.md b/doc/user/application_security/container_scanning/index.md
index a1ea9e3bf42..87286a881aa 100644
--- a/doc/user/application_security/container_scanning/index.md
+++ b/doc/user/application_security/container_scanning/index.md
@@ -71,7 +71,9 @@ The included template:
GitLab saves the results as a
[Container Scanning report artifact](../../../ci/yaml/artifacts_reports.md#artifactsreportscontainer_scanning)
that you can download and analyze later. When downloading, you always receive the most-recent
-artifact.
+artifact. If [dependency scan is enabled](#enable-dependency-scan),
+a [Dependency Scanning report artifact](../../../ci/yaml/artifacts_reports.md#artifactsreportsdependency_scanning)
+is also created.
The following is a sample `.gitlab-ci.yml` that builds your Docker image, pushes it to the container
registry, and scans the image:
@@ -146,6 +148,25 @@ include:
DOCKER_PASSWORD: "$AWS_ECR_PASSWORD"
```
+#### Enable dependency scan
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/345434) in GitLab 14.6.
+
+The `CS_DISABLE_DEPENDENCY_SCAN` CI/CD variable controls whether the scan creates a [Dependency List](../dependency_list/)
+report. For the scan to create this report, you must set this variable to `false` (the default value
+is `true`).
+
+For example:
+
+```yaml
+include:
+ - template: Security/Container-Scanning.gitlab-ci.yml
+
+container_scanning:
+ variables:
+ CS_DISABLE_DEPENDENCY_SCAN: "false"
+```
+
#### Available CI/CD variables
You can [configure](#customizing-the-container-scanning-settings) analyzers by using the following CI/CD variables:
diff --git a/lib/gitlab/ci/badge/coverage/report.rb b/lib/gitlab/ci/badge/coverage/report.rb
index 78b51dbdaf0..4d1193176ad 100644
--- a/lib/gitlab/ci/badge/coverage/report.rb
+++ b/lib/gitlab/ci/badge/coverage/report.rb
@@ -30,7 +30,7 @@ module Gitlab::Ci
@coverage ||= raw_coverage
return unless @coverage
- @coverage.to_f.round(2)
+ @coverage.round(2)
end
def metadata
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index cb3d94c246d..007d1d8d54c 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -3758,6 +3758,9 @@ msgstr ""
msgid "An error occurred while loading chart data"
msgstr ""
+msgid "An error occurred while loading code owners."
+msgstr ""
+
msgid "An error occurred while loading commit signatures"
msgstr ""
@@ -31034,6 +31037,9 @@ msgstr ""
msgid "SecurityOrchestration|Scan execution policies can only be created by project owners."
msgstr ""
+msgid "SecurityOrchestration|Scan to be performed %{cadence}"
+msgstr ""
+
msgid "SecurityOrchestration|Scan to be performed %{cadence} on the %{branches}"
msgstr ""
@@ -42224,9 +42230,6 @@ msgstr ""
msgid "smartcn custom analyzer"
msgstr ""
-msgid "sort:"
-msgstr ""
-
msgid "source"
msgstr ""
diff --git a/package.json b/package.json
index 777c630e506..24d628ca947 100644
--- a/package.json
+++ b/package.json
@@ -57,7 +57,7 @@
"@gitlab/favicon-overlay": "2.0.0",
"@gitlab/svgs": "1.225.0",
"@gitlab/tributejs": "1.0.0",
- "@gitlab/ui": "32.42.0",
+ "@gitlab/ui": "32.43.0",
"@gitlab/visual-review-tools": "1.6.1",
"@rails/actioncable": "6.1.4-1",
"@rails/ujs": "6.1.4-1",
diff --git a/qa/qa/resource/base.rb b/qa/qa/resource/base.rb
index 26a2a668cc1..640d2a8f06e 100644
--- a/qa/qa/resource/base.rb
+++ b/qa/qa/resource/base.rb
@@ -80,11 +80,25 @@ module QA
Support::FabricationTracker.start_fabrication
result = yield.tap do
fabrication_time = Time.now - start
+ resource_identifier = begin
+ if resource.respond_to?(:username) && resource.username
+ "with username '#{resource.username}'"
+ elsif resource.respond_to?(:full_path) && resource.full_path
+ "with full_path '#{resource.full_path}'"
+ elsif resource.respond_to?(:name) && resource.name
+ "with name '#{resource.name}'"
+ elsif resource.respond_to?(:id) && resource.id
+ "with id '#{resource.id}'"
+ end
+ rescue QA::Resource::Base::NoValueError
+ nil
+ end
Support::FabricationTracker.save_fabrication(:"#{method}_fabrication", fabrication_time)
Runtime::Logger.debug do
msg = ["==#{'=' * parents.size}>"]
msg << "Built a #{name}"
+ msg << resource_identifier if resource_identifier
msg << "as a dependency of #{parents.last}" if parents.any?
msg << "via #{method}"
msg << "in #{fabrication_time} seconds"
diff --git a/qa/spec/resource/base_spec.rb b/qa/spec/resource/base_spec.rb
index b24ced9e310..2a26a479436 100644
--- a/qa/spec/resource/base_spec.rb
+++ b/qa/spec/resource/base_spec.rb
@@ -3,8 +3,9 @@
RSpec.describe QA::Resource::Base do
include QA::Support::Helpers::StubEnv
- let(:resource) { spy('resource') }
+ let(:resource) { spy('resource', username: 'qa') }
let(:location) { 'http://location' }
+ let(:log_regex) { %r{==> Built a MyResource with username 'qa' via #{method} in [\d.\-e]+ seconds+} }
shared_context 'with fabrication context' do
subject do
@@ -68,6 +69,8 @@ RSpec.describe QA::Resource::Base do
end
context "with debug log level" do
+ let(:method) { 'api' }
+
before do
allow(QA::Runtime::Logger).to receive(:debug)
end
@@ -78,7 +81,7 @@ RSpec.describe QA::Resource::Base do
subject.fabricate_via_api!('something', resource: resource, parents: [])
expect(QA::Runtime::Logger).to have_received(:debug) do |&msg|
- expect(msg.call).to match_regex(/==> Built a MyResource via api in [\d.\-e]+ seconds+/)
+ expect(msg.call).to match_regex(log_regex)
end
end
end
@@ -102,6 +105,8 @@ RSpec.describe QA::Resource::Base do
end
context "with debug log level" do
+ let(:method) { 'browser_ui' }
+
before do
allow(QA::Runtime::Logger).to receive(:debug)
end
@@ -112,7 +117,7 @@ RSpec.describe QA::Resource::Base do
subject.fabricate_via_browser_ui!('something', resource: resource, parents: [])
expect(QA::Runtime::Logger).to have_received(:debug) do |&msg|
- expect(msg.call).to match_regex(/==> Built a MyResource via browser_ui in [\d.\-e]+ seconds+/)
+ expect(msg.call).to match_regex(log_regex)
end
end
end
diff --git a/spec/frontend/repository/components/__snapshots__/last_commit_spec.js.snap b/spec/frontend/repository/components/__snapshots__/last_commit_spec.js.snap
index be4f8a688e0..fe2247420ed 100644
--- a/spec/frontend/repository/components/__snapshots__/last_commit_spec.js.snap
+++ b/spec/frontend/repository/components/__snapshots__/last_commit_spec.js.snap
@@ -2,7 +2,7 @@
exports[`Repository last commit component renders commit widget 1`] = `
<div
- class="info-well d-none d-sm-flex project-last-commit commit p-3"
+ class="well-segment commit gl-p-5 gl-w-full"
>
<user-avatar-link-stub
class="avatar-cell"
@@ -108,7 +108,7 @@ exports[`Repository last commit component renders commit widget 1`] = `
exports[`Repository last commit component renders the signature HTML as returned by the backend 1`] = `
<div
- class="info-well d-none d-sm-flex project-last-commit commit p-3"
+ class="well-segment commit gl-p-5 gl-w-full"
>
<user-avatar-link-stub
class="avatar-cell"
diff --git a/spec/graphql/types/repository/blob_type_spec.rb b/spec/graphql/types/repository/blob_type_spec.rb
index 968cb026401..21bc88e34c0 100644
--- a/spec/graphql/types/repository/blob_type_spec.rb
+++ b/spec/graphql/types/repository/blob_type_spec.rb
@@ -24,6 +24,7 @@ RSpec.describe Types::Repository::BlobType do
:raw_path,
:replace_path,
:pipeline_editor_path,
+ :code_owners,
:simple_viewer,
:rich_viewer,
:plain_data,
diff --git a/spec/helpers/sorting_helper_spec.rb b/spec/helpers/sorting_helper_spec.rb
index f976fb098a8..b49b4ad6e7e 100644
--- a/spec/helpers/sorting_helper_spec.rb
+++ b/spec/helpers/sorting_helper_spec.rb
@@ -191,4 +191,77 @@ RSpec.describe SortingHelper do
end
end
end
+
+ describe 'with `forks` controller' do
+ before do
+ stub_controller_path 'forks'
+ end
+
+ describe '#forks_sort_options_hash' do
+ it 'returns a hash of available sorting options' do
+ expect(forks_sort_options_hash).to include({
+ sort_value_recently_created => sort_title_created_date,
+ sort_value_oldest_created => sort_title_created_date,
+ sort_value_latest_activity => sort_title_latest_activity,
+ sort_value_oldest_activity => sort_title_latest_activity
+ })
+ end
+ end
+
+ describe '#forks_reverse_sort_options_hash' do
+ context 'for each sort option' do
+ using RSpec::Parameterized::TableSyntax
+
+ where(:sort_key, :reverse_sort_title) do
+ sort_value_recently_created | sort_value_oldest_created
+ sort_value_oldest_created | sort_value_recently_created
+ sort_value_latest_activity | sort_value_oldest_activity
+ sort_value_oldest_activity | sort_value_latest_activity
+ end
+
+ with_them do
+ it 'returns the correct reversed hash' do
+ reverse_hash = forks_reverse_sort_options_hash
+
+ expect(reverse_hash).to include(sort_key)
+ expect(reverse_hash[sort_key]).to eq(reverse_sort_title)
+ end
+ end
+ end
+ end
+
+ describe '#forks_sort_direction_button' do
+ context 'for each sort option' do
+ using RSpec::Parameterized::TableSyntax
+
+ sort_lowest_icon = 'sort-lowest'
+ sort_highest_icon = 'sort-highest'
+
+ where(:selected_sort, :icon) do
+ sort_value_recently_created | sort_highest_icon
+ sort_value_latest_activity | sort_highest_icon
+ sort_value_oldest_created | sort_lowest_icon
+ sort_value_oldest_activity | sort_lowest_icon
+ end
+
+ with_them do
+ it 'returns the correct icon' do
+ set_sorting_url selected_sort
+
+ expect(forks_sort_direction_button(selected_sort)).to include(icon)
+ end
+ end
+ end
+
+ it 'returns the correct link to reverse the current sort option' do
+ sort_options_links = forks_reverse_sort_options_hash
+
+ sort_options_links.each do |selected_sort, reverse_sort|
+ set_sorting_url selected_sort
+
+ expect(forks_sort_direction_button(selected_sort)).to include(reverse_sort)
+ end
+ end
+ end
+ end
end
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index dcecaa3243e..77bc6804125 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -3762,6 +3762,12 @@ RSpec.describe Ci::Build do
build.enqueue
end
+
+ it 'queues BuildHooksWorker' do
+ expect(BuildHooksWorker).to receive(:perform_async).with(build.id)
+
+ build.enqueue
+ end
end
describe 'state transition: pending: :running' do
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index 3b6d756a738..c1bbbfd8812 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -757,23 +757,23 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
context 'with multiple pipelines' do
before_all do
create(:ci_build, name: "rspec", coverage: 30, pipeline: pipeline)
- create(:ci_build, name: "rubocop", coverage: 40, pipeline: pipeline)
+ create(:ci_build, name: "rubocop", coverage: 35, pipeline: pipeline)
end
it "calculates average when there are two builds with coverage" do
- expect(pipeline.coverage).to eq("35.00")
+ expect(pipeline.coverage).to be_within(0.001).of(32.5)
end
it "calculates average when there are two builds with coverage and one with nil" do
create(:ci_build, pipeline: pipeline)
- expect(pipeline.coverage).to eq("35.00")
+ expect(pipeline.coverage).to be_within(0.001).of(32.5)
end
it "calculates average when there are two builds with coverage and one is retried" do
create(:ci_build, name: "rubocop", coverage: 30, pipeline: pipeline, retried: true)
- expect(pipeline.coverage).to eq("35.00")
+ expect(pipeline.coverage).to be_within(0.001).of(32.5)
end
end
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb
index 102800bcca2..d2b1114259e 100644
--- a/spec/models/merge_request_spec.rb
+++ b/spec/models/merge_request_spec.rb
@@ -3960,7 +3960,7 @@ RSpec.describe MergeRequest, factory_default: :keep do
create_build(source_pipeline, 60.2, 'test:1')
create_build(target_pipeline, 50, 'test:2')
- expect(merge_request.pipeline_coverage_delta).to eq('10.20')
+ expect(merge_request.pipeline_coverage_delta).to be_within(0.001).of(10.2)
end
end
diff --git a/spec/presenters/blob_presenter_spec.rb b/spec/presenters/blob_presenter_spec.rb
index cd38e74e0ea..6dbcb5cace7 100644
--- a/spec/presenters/blob_presenter_spec.rb
+++ b/spec/presenters/blob_presenter_spec.rb
@@ -67,6 +67,10 @@ RSpec.describe BlobPresenter do
end
end
+ describe '#code_owners' do
+ it { expect(presenter.code_owners).to match_array([]) }
+ end
+
describe '#ide_edit_path' do
it { expect(presenter.ide_edit_path).to eq("/-/ide/project/#{project.full_path}/edit/HEAD/-/files/ruby/regex.rb") }
end
diff --git a/spec/presenters/ci/pipeline_presenter_spec.rb b/spec/presenters/ci/pipeline_presenter_spec.rb
index 2d3c0d85eda..a278d4dad83 100644
--- a/spec/presenters/ci/pipeline_presenter_spec.rb
+++ b/spec/presenters/ci/pipeline_presenter_spec.rb
@@ -122,6 +122,30 @@ RSpec.describe Ci::PipelinePresenter do
end
end
+ describe '#coverage' do
+ subject { presenter.coverage }
+
+ context 'when pipeline has coverage' do
+ before do
+ allow(pipeline).to receive(:coverage).and_return(35.0)
+ end
+
+ it 'formats coverage into 2 decimal points' do
+ expect(subject).to eq('35.00')
+ end
+ end
+
+ context 'when pipeline does not have coverage' do
+ before do
+ allow(pipeline).to receive(:coverage).and_return(nil)
+ end
+
+ it 'returns nil' do
+ expect(subject).to be_nil
+ end
+ end
+ end
+
describe '#ref_text' do
subject { presenter.ref_text }
diff --git a/spec/presenters/merge_request_presenter_spec.rb b/spec/presenters/merge_request_presenter_spec.rb
index b3ec184d08c..60296cca058 100644
--- a/spec/presenters/merge_request_presenter_spec.rb
+++ b/spec/presenters/merge_request_presenter_spec.rb
@@ -632,4 +632,28 @@ RSpec.describe MergeRequestPresenter do
it { is_expected.to eq(expose_path("/api/v4/projects/#{project.id}/merge_requests/#{resource.iid}/unapprove")) }
end
+
+ describe '#pipeline_coverage_delta' do
+ subject { described_class.new(resource, current_user: user).pipeline_coverage_delta }
+
+ context 'when merge request has pipeline coverage delta' do
+ before do
+ allow(resource).to receive(:pipeline_coverage_delta).and_return(35.0)
+ end
+
+ it 'formats coverage into 2 decimal points' do
+ expect(subject).to eq('35.00')
+ end
+ end
+
+ context 'when merge request does not have pipeline coverage delta' do
+ before do
+ allow(resource).to receive(:pipeline_coverage_delta).and_return(nil)
+ end
+
+ it 'returns nil' do
+ expect(subject).to be_nil
+ end
+ end
+ end
end
diff --git a/spec/serializers/ci/pipeline_entity_spec.rb b/spec/serializers/ci/pipeline_entity_spec.rb
index f79bbd91a0a..4d9ed9fc22f 100644
--- a/spec/serializers/ci/pipeline_entity_spec.rb
+++ b/spec/serializers/ci/pipeline_entity_spec.rb
@@ -260,5 +260,17 @@ RSpec.describe Ci::PipelineEntity do
end
end
end
+
+ context 'when pipeline has coverage' do
+ let_it_be(:pipeline) { create(:ci_pipeline, project: project, user: user) }
+
+ before do
+ allow(pipeline).to receive(:coverage).and_return(35.0)
+ end
+
+ it 'exposes the coverage' do
+ expect(subject[:coverage]).to eq('35.00')
+ end
+ end
end
end
diff --git a/spec/serializers/merge_requests/pipeline_entity_spec.rb b/spec/serializers/merge_requests/pipeline_entity_spec.rb
index 6970b547f12..ee99ab2e7dd 100644
--- a/spec/serializers/merge_requests/pipeline_entity_spec.rb
+++ b/spec/serializers/merge_requests/pipeline_entity_spec.rb
@@ -14,6 +14,7 @@ RSpec.describe MergeRequests::PipelineEntity do
allow(request).to receive(:current_user).and_return(user)
allow(request).to receive(:project).and_return(project)
+ allow(pipeline).to receive(:coverage).and_return(35.0)
end
let(:entity) do
@@ -35,6 +36,10 @@ RSpec.describe MergeRequests::PipelineEntity do
expect(subject[:flags]).to include(:merge_request_pipeline)
end
+ it 'returns presented coverage' do
+ expect(subject[:coverage]).to eq('35.00')
+ end
+
it 'excludes coverage data when disabled' do
entity = described_class
.represent(pipeline, request: request, disable_coverage: true)
diff --git a/spec/support/matchers/background_migrations_matchers.rb b/spec/support/matchers/background_migrations_matchers.rb
index d3833a1e8e8..1057639beec 100644
--- a/spec/support/matchers/background_migrations_matchers.rb
+++ b/spec/support/matchers/background_migrations_matchers.rb
@@ -9,7 +9,7 @@ RSpec::Matchers.define :be_background_migration_with_arguments do |arguments|
end
RSpec::Matchers.define :be_scheduled_delayed_migration do |delay, *expected|
- define_method :matches? do |migration|
+ match(notify_expectation_failures: true) do |migration|
expect(migration).to be_background_migration_with_arguments(expected)
BackgroundMigrationWorker.jobs.any? do |job|
@@ -26,7 +26,7 @@ RSpec::Matchers.define :be_scheduled_delayed_migration do |delay, *expected|
end
RSpec::Matchers.define :be_scheduled_migration do |*expected|
- define_method :matches? do |migration|
+ match(notify_expectation_failures: true) do |migration|
expect(migration).to be_background_migration_with_arguments(expected)
BackgroundMigrationWorker.jobs.any? do |job|
@@ -41,7 +41,7 @@ RSpec::Matchers.define :be_scheduled_migration do |*expected|
end
RSpec::Matchers.define :be_scheduled_migration_with_multiple_args do |*expected|
- define_method :matches? do |migration|
+ match(notify_expectation_failures: true) do |migration|
expect(migration).to be_background_migration_with_arguments(expected)
BackgroundMigrationWorker.jobs.any? do |job|
diff --git a/tooling/bin/qa/check_if_qa_only_spec_changes b/tooling/bin/qa/check_if_qa_only_spec_changes
index fd331559dd7..5b9166b41fe 100755
--- a/tooling/bin/qa/check_if_qa_only_spec_changes
+++ b/tooling/bin/qa/check_if_qa_only_spec_changes
@@ -6,13 +6,17 @@
# all the files are end-to-end test spec files.
abort("ERROR: Please specify the file containing the list of changed files and a file where the qa only spec files will be written") if ARGV.size != 2
-file_contents = File.read(ARGV.shift).split(' ')
-
-all_files_are_qa_specs = file_contents.all? { |file_path| file_path =~ %r{^qa\/qa\/specs\/features\/} }
+changed_files_path = ARGV.shift
output_file = ARGV.shift
+return unless File.exist?(changed_files_path)
+
+changed_files = File.read(changed_files_path).split(' ')
+
+all_files_are_qa_specs = changed_files.all? { |file_path| file_path =~ %r{^qa\/qa\/specs\/features\/} }
+
if all_files_are_qa_specs
- qa_spec_paths_trimmed = file_contents.map { |path| path.sub('qa/', '') }
+ qa_spec_paths_trimmed = changed_files.map { |path| path.sub('qa/', '') }
File.write(output_file, qa_spec_paths_trimmed.join(' '))
end
diff --git a/yarn.lock b/yarn.lock
index 61e3807bb0d..dde2547758b 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -924,10 +924,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/tributejs/-/tributejs-1.0.0.tgz#672befa222aeffc83e7d799b0500a7a4418e59b8"
integrity sha512-nmKw1+hB6MHvlmPz63yPwVs1qQkycHwsKgxpEbzmky16Y6mL4EJMk3w1b8QlOAF/AIAzjCERPhe/R4MJiohbZw==
-"@gitlab/ui@32.42.0":
- version "32.42.0"
- resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-32.42.0.tgz#e45299124b08a6804fff5dc9358d93b9d02680c6"
- integrity sha512-EGV91sM38Tp0eEsK/xeBE6Sd1nOiLO0u5pSNU9fJgfwDQuTpUC/YV5OeKpE4drnOQpxLGUOeGOFogAzv9zcbDg==
+"@gitlab/ui@32.43.0":
+ version "32.43.0"
+ resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-32.43.0.tgz#950d189ff50693bdec29edb3fd002aa409410d3f"
+ integrity sha512-OTKRW3PahpONXirVvV+jBMNVfZLgQtE7x2Q13cBfgDYt5fsPpHstUFv4+hKzV6D/aoVDRuw80HjAcnw/QtS73A==
dependencies:
"@babel/standalone" "^7.0.0"
bootstrap-vue "2.20.1"