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-04-21 00:09:07 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-21 00:09:07 +0300
commit98f1353fcd07e45ef995c3cee14b659711a63221 (patch)
tree6b699245b77a76a754d86a343af261560f3bb2d0
parentb6e611dd423708f2e31c034e5dcab9b0cd18021a (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.rubocop_manual_todo.yml5
-rw-r--r--.rubocop_todo.yml5
-rw-r--r--app/assets/javascripts/admin/users/components/usage_ping_disabled.vue48
-rw-r--r--app/assets/javascripts/admin/users/index.js21
-rw-r--r--app/assets/javascripts/pages/admin/users/index.js3
-rw-r--r--app/controllers/admin/users_controller.rb10
-rw-r--r--app/controllers/projects/commit_controller.rb2
-rw-r--r--app/controllers/projects/compare_controller.rb4
-rw-r--r--app/helpers/commits_helper.rb2
-rw-r--r--app/helpers/issuables_helper.rb2
-rw-r--r--app/models/clusters/applications/runner.rb2
-rw-r--r--app/models/concerns/relative_positioning.rb9
-rw-r--r--app/views/admin/application_settings/_gitaly.html.haml8
-rw-r--r--app/views/admin/application_settings/repository.html.haml21
-rw-r--r--app/views/admin/runners/show.html.haml4
-rw-r--r--app/views/admin/users/_cohorts.html.haml5
-rw-r--r--app/views/profiles/keys/_form.html.haml4
-rw-r--r--app/views/projects/blob/viewers/_contributing.html.haml4
-rw-r--r--app/views/projects/commit/show.html.haml7
-rw-r--r--app/views/projects/compare/show.html.haml11
-rw-r--r--app/views/projects/diffs/_diffs.html.haml3
-rw-r--r--app/views/projects/tags/_tag.html.haml2
-rw-r--r--changelogs/unreleased/325163-remove-global-default-branch-ff.yml5
-rw-r--r--changelogs/unreleased/326312-project-compare-controller-use-pagination.yml5
-rw-r--r--changelogs/unreleased/Externalise-strings-in-_gitaly-html-haml.yml5
-rw-r--r--changelogs/unreleased/Externalize-strings-in-runners-show-html-haml.yml5
-rw-r--r--changelogs/unreleased/Externalize-strings-in-viewers-_contributing-html-haml.yml5
-rw-r--r--changelogs/unreleased/gl-badge-mr.yml5
-rw-r--r--changelogs/unreleased/gl-badge-tags.yml5
-rw-r--r--changelogs/unreleased/gl-form-keys.yml5
-rw-r--r--changelogs/unreleased/improve-finding-of-terminus-when-shifting-positions.yml5
-rw-r--r--changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-services-feature-flags.yml5
-rw-r--r--changelogs/unreleased/pl-rubocop-todo-redundant-file-extension-in-require.yml5
-rw-r--r--changelogs/unreleased/update-gitlab-runner-helm-chart-to-0-28-0.yml5
-rw-r--r--config/feature_flags/development/global_default_branch_name.yml8
-rw-r--r--config/feature_flags/development/optimize_shifting_relative_positions.yml8
-rw-r--r--doc/user/admin_area/user_cohorts.md3
-rw-r--r--doc/user/project/repository/branches/default.md20
-rw-r--r--lib/gitlab/relative_positioning.rb1
-rw-r--r--lib/gitlab/relative_positioning/item_context.rb8
-rw-r--r--lib/tasks/tokens.rake8
-rw-r--r--locale/gitlab.pot21
-rw-r--r--package.json2
-rw-r--r--qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb2
-rw-r--r--qa/qa/tools/revoke_all_personal_access_tokens.rb2
-rw-r--r--rubocop/cop/code_reuse/presenter.rb2
-rw-r--r--rubocop/cop/code_reuse/serializer.rb2
-rw-r--r--rubocop/cop/code_reuse/service_class.rb2
-rw-r--r--rubocop/cop/code_reuse/worker.rb2
-rw-r--r--rubocop/cop/scalability/idempotent_worker.rb2
-rwxr-xr-xscripts/docs_screenshots.rb2
-rw-r--r--spec/features/admin/admin_users_spec.rb23
-rw-r--r--spec/features/projects/compare_spec.rb28
-rw-r--r--spec/helpers/commits_helper_spec.rb12
-rw-r--r--spec/helpers/issuables_helper_spec.rb8
-rw-r--r--spec/initializers/6_validations_spec.rb2
-rw-r--r--spec/initializers/mail_encoding_patch_spec.rb2
-rw-r--r--spec/lib/gitlab/import_export/json/legacy_reader/file_spec.rb2
-rw-r--r--spec/lib/gitlab/import_export/json/legacy_reader/hash_spec.rb2
-rw-r--r--spec/lib/gitlab/relative_positioning/item_context_spec.rb16
-rw-r--r--spec/rubocop/cop/performance/ar_count_each_spec.rb2
-rw-r--r--spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb2
-rw-r--r--spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb4
-rw-r--r--spec/services/feature_flags/create_service_spec.rb1
-rw-r--r--spec/services/feature_flags/destroy_service_spec.rb1
-rw-r--r--spec/services/feature_flags/disable_service_spec.rb1
-rw-r--r--spec/services/feature_flags/enable_service_spec.rb1
-rw-r--r--spec/services/feature_flags/update_service_spec.rb1
-rw-r--r--spec/services/issues/build_service_spec.rb2
-rw-r--r--spec/services/issues/referenced_merge_requests_service_spec.rb2
-rw-r--r--spec/services/issues/resolve_discussions_spec.rb2
-rw-r--r--spec/support/shared_examples/models/relative_positioning_shared_examples.rb22
-rw-r--r--spec/views/admin/application_settings/repository.html.haml_spec.rb32
-rw-r--r--yarn.lock10
74 files changed, 272 insertions, 243 deletions
diff --git a/.rubocop_manual_todo.yml b/.rubocop_manual_todo.yml
index 1f5d202633d..872d6da7a55 100644
--- a/.rubocop_manual_todo.yml
+++ b/.rubocop_manual_todo.yml
@@ -899,11 +899,6 @@ RSpec/EmptyLineAfterFinalLetItBe:
- spec/services/dependency_proxy/find_or_create_manifest_service_spec.rb
- spec/services/discussions/resolve_service_spec.rb
- spec/services/discussions/unresolve_service_spec.rb
- - spec/services/feature_flags/create_service_spec.rb
- - spec/services/feature_flags/destroy_service_spec.rb
- - spec/services/feature_flags/disable_service_spec.rb
- - spec/services/feature_flags/enable_service_spec.rb
- - spec/services/feature_flags/update_service_spec.rb
- spec/services/git/branch_push_service_spec.rb
- spec/services/import/bitbucket_server_service_spec.rb
- spec/services/incident_management/incidents/create_service_spec.rb
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 765c39285e8..cffdd9ceebf 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -876,11 +876,6 @@ Style/RedundantFetchBlock:
- 'spec/lib/gitlab/null_request_store_spec.rb'
- 'spec/lib/gitlab/safe_request_store_spec.rb'
-# Offense count: 26
-# Cop supports --auto-correct.
-Style/RedundantFileExtensionInRequire:
- Enabled: false
-
# Offense count: 206
# Cop supports --auto-correct.
Style/RedundantInterpolation:
diff --git a/app/assets/javascripts/admin/users/components/usage_ping_disabled.vue b/app/assets/javascripts/admin/users/components/usage_ping_disabled.vue
deleted file mode 100644
index 5da38495010..00000000000
--- a/app/assets/javascripts/admin/users/components/usage_ping_disabled.vue
+++ /dev/null
@@ -1,48 +0,0 @@
-<script>
-import { GlEmptyState, GlSprintf, GlLink } from '@gitlab/ui';
-
-export default {
- components: {
- GlEmptyState,
- GlSprintf,
- GlLink,
- },
- inject: {
- svgPath: {
- default: '',
- },
- docsLink: {
- default: '',
- },
- primaryButtonPath: {
- default: '',
- },
- },
-};
-</script>
-<template>
- <gl-empty-state
- class="js-empty-state"
- :title="__('Activate user activity analysis')"
- :svg-path="svgPath"
- :primary-button-text="__('Turn on usage ping')"
- :primary-button-link="primaryButtonPath"
- >
- <template #description>
- <gl-sprintf
- :message="
- __(
- 'Turn on %{strongStart}usage ping%{strongEnd} to activate analysis of user activity, known as %{docLinkStart}Cohorts%{docLinkEnd}.',
- )
- "
- >
- <template #docLink="{ content }">
- <gl-link :href="docsLink" target="_blank">{{ content }}</gl-link>
- </template>
- <template #strong="{ content }"
- ><strong>{{ content }}</strong></template
- >
- </gl-sprintf>
- </template>
- </gl-empty-state>
-</template>
diff --git a/app/assets/javascripts/admin/users/index.js b/app/assets/javascripts/admin/users/index.js
index 0365d054fc9..eceae8a8674 100644
--- a/app/assets/javascripts/admin/users/index.js
+++ b/app/assets/javascripts/admin/users/index.js
@@ -1,7 +1,6 @@
import Vue from 'vue';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import AdminUsersApp from './components/app.vue';
-import UsagePingDisabled from './components/usage_ping_disabled.vue';
export const initAdminUsersApp = (el = document.querySelector('#js-admin-users-app')) => {
if (!el) {
@@ -21,23 +20,3 @@ export const initAdminUsersApp = (el = document.querySelector('#js-admin-users-a
}),
});
};
-
-export const initCohortsEmptyState = (el = document.querySelector('#js-cohorts-empty-state')) => {
- if (!el) {
- return false;
- }
-
- const { emptyStateSvgPath, enableUsagePingLink, docsLink } = el.dataset;
-
- return new Vue({
- el,
- provide: {
- svgPath: emptyStateSvgPath,
- primaryButtonPath: enableUsagePingLink,
- docsLink,
- },
- render(h) {
- return h(UsagePingDisabled);
- },
- });
-};
diff --git a/app/assets/javascripts/pages/admin/users/index.js b/app/assets/javascripts/pages/admin/users/index.js
index b1079c3b068..48a5412c967 100644
--- a/app/assets/javascripts/pages/admin/users/index.js
+++ b/app/assets/javascripts/pages/admin/users/index.js
@@ -1,6 +1,6 @@
import Vue from 'vue';
-import { initAdminUsersApp, initCohortsEmptyState } from '~/admin/users';
+import { initAdminUsersApp } from '~/admin/users';
import initTabs from '~/admin/users/tabs';
import initConfirmModal from '~/confirm_modal';
import csrf from '~/lib/utils/csrf';
@@ -62,6 +62,5 @@ document.addEventListener('DOMContentLoaded', () => {
});
initConfirmModal();
- initCohortsEmptyState();
initTabs();
});
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index 8a090c8ef10..67829874b4b 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -318,13 +318,11 @@ class Admin::UsersController < Admin::ApplicationController
end
def load_cohorts
- if Gitlab::CurrentSettings.usage_ping_enabled
- cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do
- CohortsService.new.execute
- end
-
- CohortsSerializer.new.represent(cohorts_results)
+ cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do
+ CohortsService.new.execute
end
+
+ CohortsSerializer.new.represent(cohorts_results)
end
def track_cohorts_visit
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index 04186062344..5a69898ce95 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -24,7 +24,7 @@ class Projects::CommitController < Projects::ApplicationController
end
BRANCH_SEARCH_LIMIT = 1000
- COMMIT_DIFFS_PER_PAGE = 75
+ COMMIT_DIFFS_PER_PAGE = 20
feature_category :source_code_management
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb
index 221bc16e256..c716acd52bc 100644
--- a/app/controllers/projects/compare_controller.rb
+++ b/app/controllers/projects/compare_controller.rb
@@ -26,6 +26,10 @@ class Projects::CompareController < Projects::ApplicationController
feature_category :source_code_management
+ # Diffs may be pretty chunky, the less is better in this endpoint.
+ # Pagination design guides: https://design.gitlab.com/components/pagination/#behavior
+ COMMIT_DIFFS_PER_PAGE = 20
+
def index
end
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index e7a81eb5629..4b71f9b3065 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -128,7 +128,7 @@ module CommitsHelper
%w(btn gpg-status-box) + Array(additional_classes)
end
- def conditionally_paginate_diff_files(diffs, paginate:, per: Projects::CommitController::COMMIT_DIFFS_PER_PAGE)
+ def conditionally_paginate_diff_files(diffs, paginate:, per:)
if paginate
Kaminari.paginate_array(diffs.diff_files.to_a).page(params[:page]).per(per)
else
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb
index 8ebc773bb25..c6fde38579b 100644
--- a/app/helpers/issuables_helper.rb
+++ b/app/helpers/issuables_helper.rb
@@ -199,7 +199,7 @@ module IssuablesHelper
count = issuables_count_for_state(issuable_type, state)
if count != -1
- html << " " << content_tag(:span, number_with_delimiter(count), class: 'badge badge-pill')
+ html << " " << content_tag(:span, number_with_delimiter(count), class: 'badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm')
end
html.html_safe
diff --git a/app/models/clusters/applications/runner.rb b/app/models/clusters/applications/runner.rb
index bc80bcd0b06..e8d56072b89 100644
--- a/app/models/clusters/applications/runner.rb
+++ b/app/models/clusters/applications/runner.rb
@@ -3,7 +3,7 @@
module Clusters
module Applications
class Runner < ApplicationRecord
- VERSION = '0.27.0'
+ VERSION = '0.28.0'
self.table_name = 'clusters_applications_runners'
diff --git a/app/models/concerns/relative_positioning.rb b/app/models/concerns/relative_positioning.rb
index 7f559f0a7ed..9ae0ce95bc7 100644
--- a/app/models/concerns/relative_positioning.rb
+++ b/app/models/concerns/relative_positioning.rb
@@ -53,13 +53,18 @@ module RelativePositioning
return [size, starting_from] if size >= MIN_GAP
+ terminus =
+ if Feature.enabled?(:optimize_shifting_relative_positions, default_enabled: :yaml)
+ context.at_position(starting_from)
+ else
+ at_end ? context.max_sibling : context.min_sibling
+ end
+
if at_end
- terminus = context.max_sibling
terminus.shift_left
max_relative_position = terminus.relative_position
[[(MAX_POSITION - max_relative_position) / gaps, IDEAL_DISTANCE].min, max_relative_position]
else
- terminus = context.min_sibling
terminus.shift_right
min_relative_position = terminus.relative_position
[[(min_relative_position - MIN_POSITION) / gaps, IDEAL_DISTANCE].min, min_relative_position]
diff --git a/app/views/admin/application_settings/_gitaly.html.haml b/app/views/admin/application_settings/_gitaly.html.haml
index 72e7cb0b437..b28a53d8bf6 100644
--- a/app/views/admin/application_settings/_gitaly.html.haml
+++ b/app/views/admin/application_settings/_gitaly.html.haml
@@ -3,7 +3,7 @@
%fieldset
.form-group
- = f.label :gitaly_timeout_default, 'Default Timeout Period', class: 'label-bold'
+ = f.label :gitaly_timeout_default, _('Default Timeout Period'), class: 'label-bold'
= f.number_field :gitaly_timeout_default, class: 'form-control gl-form-input'
.form-text.text-muted
Timeout for Gitaly calls from the GitLab application (in seconds). This timeout is not enforced
@@ -12,16 +12,16 @@
worker timeout, the remaining time from the worker timeout would be used to avoid having to terminate
the worker.
.form-group
- = f.label :gitaly_timeout_fast, 'Fast Timeout Period', class: 'label-bold'
+ = f.label :gitaly_timeout_fast, _('Fast Timeout Period'), class: 'label-bold'
= f.number_field :gitaly_timeout_fast, class: 'form-control gl-form-input'
.form-text.text-muted
Fast operation timeout (in seconds). Some Gitaly operations are expected to be fast.
If they exceed this threshold, there may be a problem with a storage shard and 'failing fast'
can help maintain the stability of the GitLab instance.
.form-group
- = f.label :gitaly_timeout_medium, 'Medium Timeout Period', class: 'label-bold'
+ = f.label :gitaly_timeout_medium, _('Medium Timeout Period'), class: 'label-bold'
= f.number_field :gitaly_timeout_medium, class: 'form-control gl-form-input'
.form-text.text-muted
Medium operation timeout (in seconds). This should be a value between the Fast and the Default timeout.
- = f.submit 'Save changes', class: "gl-button btn btn-confirm"
+ = f.submit _('Save changes'), class: "gl-button btn btn-confirm"
diff --git a/app/views/admin/application_settings/repository.html.haml b/app/views/admin/application_settings/repository.html.haml
index 4365d8937bd..111cc9c5d7c 100644
--- a/app/views/admin/application_settings/repository.html.haml
+++ b/app/views/admin/application_settings/repository.html.haml
@@ -2,17 +2,16 @@
- page_title _("Repository")
- @content_class = "limit-container-width" unless fluid_layout
-- if Feature.enabled?(:global_default_branch_name, default_enabled: true)
- %section.settings.as-default-branch-name.no-animate#js-default-branch-name{ class: ('expanded' if expanded_by_default?) }
- .settings-header
- %h4
- = _('Default initial branch name')
- %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
- = expanded_by_default? ? _('Collapse') : _('Expand')
- %p
- = _('Set the default name of the initial branch when creating new repositories through the user interface.')
- .settings-content
- = render 'initial_branch_name'
+%section.settings.as-default-branch-name.no-animate#js-default-branch-name{ class: ('expanded' if expanded_by_default?) }
+ .settings-header
+ %h4
+ = _('Default initial branch name')
+ %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
+ = expanded_by_default? ? _('Collapse') : _('Expand')
+ %p
+ = _('Set the default name of the initial branch when creating new repositories through the user interface.')
+ .settings-content
+ = render 'initial_branch_name'
%section.settings.as-mirror.no-animate#js-mirror-settings{ class: ('expanded' if expanded_by_default?) }
.settings-header
diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml
index 9d23ddc7b68..929c92970ff 100644
--- a/app/views/admin/runners/show.html.haml
+++ b/app/views/admin/runners/show.html.haml
@@ -49,7 +49,7 @@
.input-group
= search_field_tag :search, params[:search], class: 'form-control gl-form-input', spellcheck: false
.input-group-append
- = submit_tag 'Search', class: 'gl-button btn btn-default'
+ = submit_tag _('Search'), class: 'gl-button btn btn-default'
%td
- @projects.each do |project|
@@ -60,7 +60,7 @@
.float-right
= form_for project.runner_projects.new, url: admin_namespace_project_runner_projects_path(project.namespace, project), method: :post do |f|
= f.hidden_field :runner_id, value: @runner.id
- = f.submit 'Enable', class: 'gl-button btn btn-sm'
+ = f.submit _('Enable'), class: 'gl-button btn btn-sm'
= paginate_without_count @projects
.col-md-6
diff --git a/app/views/admin/users/_cohorts.html.haml b/app/views/admin/users/_cohorts.html.haml
index 013c6072165..25b30adc5be 100644
--- a/app/views/admin/users/_cohorts.html.haml
+++ b/app/views/admin/users/_cohorts.html.haml
@@ -1,4 +1 @@
-- if @cohorts
- = render 'cohorts_table'
-- else
- #js-cohorts-empty-state{ data: { empty_state_svg_path: image_path('illustrations/convdev/convdev_no_index.svg'), enable_usage_ping_link: metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings'), docs_link: help_page_path('user/admin_area/analytics/user_cohorts') } }
+= render 'cohorts_table'
diff --git a/app/views/profiles/keys/_form.html.haml b/app/views/profiles/keys/_form.html.haml
index 35335f3ef80..6dc6aaf44b6 100644
--- a/app/views/profiles/keys/_form.html.haml
+++ b/app/views/profiles/keys/_form.html.haml
@@ -5,11 +5,11 @@
.form-group
= f.label :key, s_('Profiles|Key'), class: 'label-bold'
%p= _("Paste your public SSH key, which is usually contained in the file '~/.ssh/id_ed25519.pub' or '~/.ssh/id_rsa.pub' and begins with 'ssh-ed25519' or 'ssh-rsa'. Do not paste your private SSH key, as that can compromise your identity.")
- = f.text_area :key, class: "form-control js-add-ssh-key-validation-input qa-key-public-key-field", rows: 8, required: true, placeholder: s_('Profiles|Typically starts with "ssh-ed25519 …" or "ssh-rsa …"')
+ = f.text_area :key, class: "form-control gl-form-input js-add-ssh-key-validation-input qa-key-public-key-field", rows: 8, required: true, placeholder: s_('Profiles|Typically starts with "ssh-ed25519 …" or "ssh-rsa …"')
.form-row
.col.form-group
= f.label :title, _('Title'), class: 'label-bold'
- = f.text_field :title, class: "form-control input-lg qa-key-title-field", required: true, placeholder: s_('Profiles|e.g. My MacBook key')
+ = f.text_field :title, class: "form-control gl-form-input input-lg qa-key-title-field", required: true, placeholder: s_('Profiles|e.g. My MacBook key')
%p.form-text.text-muted= s_('Profiles|Give your individual key a title.')
.col.form-group
diff --git a/app/views/projects/blob/viewers/_contributing.html.haml b/app/views/projects/blob/viewers/_contributing.html.haml
index 18559e2908f..eac8c17b7ff 100644
--- a/app/views/projects/blob/viewers/_contributing.html.haml
+++ b/app/views/projects/blob/viewers/_contributing.html.haml
@@ -1,9 +1,9 @@
= sprite_icon('book')
-After you've reviewed these contribution guidelines, you'll be all set to
+= _("After you've reviewed these contribution guidelines, you'll be all set to")
- options = contribution_options(viewer.project)
- if options.any?
= succeed '.' do
= Gitlab::Utils.to_exclusive_sentence(options).html_safe
- else
- contribute to this project.
+ = _("contribute to this project.")
diff --git a/app/views/projects/commit/show.html.haml b/app/views/projects/commit/show.html.haml
index 5652b503a6d..c3fdfeb6f4e 100644
--- a/app/views/projects/commit/show.html.haml
+++ b/app/views/projects/commit/show.html.haml
@@ -12,7 +12,12 @@
.container-fluid{ class: [limited_container_width, container_class] }
= render "commit_box"
= render "ci_menu"
- = render "projects/diffs/diffs", diffs: @diffs, environment: @environment, diff_page_context: "is-commit", paginate_diffs: true
+ = render "projects/diffs/diffs",
+ diffs: @diffs,
+ environment: @environment,
+ diff_page_context: "is-commit",
+ paginate_diffs: true,
+ paginate_diffs_per_page: Projects::CommitController::COMMIT_DIFFS_PER_PAGE
.limited-width-notes
= render "shared/notes/notes_with_form", :autocomplete => true
diff --git a/app/views/projects/compare/show.html.haml b/app/views/projects/compare/show.html.haml
index 9e9c271e7be..1fc067b6be1 100644
--- a/app/views/projects/compare/show.html.haml
+++ b/app/views/projects/compare/show.html.haml
@@ -6,8 +6,15 @@
#js-compare-selector{ data: project_compare_selector_data(@project, @merge_request, params) }
- if @commits.present?
- = render "projects/commits/commit_list"
- = render "projects/diffs/diffs", diffs: @diffs, environment: @environment, diff_page_context: "is-compare"
+ -# Only show commit list in the first page
+ - hide_commit_list = params[:page].present? && params[:page] != '1'
+ = render "projects/commits/commit_list" unless hide_commit_list
+ = render "projects/diffs/diffs",
+ diffs: @diffs,
+ environment: @environment,
+ diff_page_context: "is-compare",
+ paginate_diffs: true,
+ paginate_diffs_per_page: Projects::CompareController::COMMIT_DIFFS_PER_PAGE
- else
.card.bg-light
.center
diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml
index 1c7a9ffe0bb..ac35a0a25c7 100644
--- a/app/views/projects/diffs/_diffs.html.haml
+++ b/app/views/projects/diffs/_diffs.html.haml
@@ -4,7 +4,8 @@
- diff_page_context = local_assigns.fetch(:diff_page_context, nil)
- load_diff_files_async = Feature.enabled?(:async_commit_diff_files, @project) && diff_page_context == "is-commit"
- paginate_diffs = local_assigns.fetch(:paginate_diffs, false) && !load_diff_files_async
-- diff_files = conditionally_paginate_diff_files(diffs, paginate: paginate_diffs)
+- paginate_diffs_per_page = local_assigns.fetch(:paginate_diffs_per_page, nil)
+- diff_files = conditionally_paginate_diff_files(diffs, paginate: paginate_diffs, per: paginate_diffs_per_page)
.content-block.oneline-block.files-changed.diff-files-changed.js-diff-files-changed
.files-changed-inner
diff --git a/app/views/projects/tags/_tag.html.haml b/app/views/projects/tags/_tag.html.haml
index 1072d5bce06..a178ec6979a 100644
--- a/app/views/projects/tags/_tag.html.haml
+++ b/app/views/projects/tags/_tag.html.haml
@@ -8,7 +8,7 @@
= link_to tag.name, project_tag_path(@project, tag.name), class: 'item-title ref-name'
- if protected_tag?(@project, tag)
- %span.badge.badge-success.gl-ml-2
+ %span.badge.badge-success.gl-ml-2.gl-badge.sm.badge-pill
= s_('TagsPage|protected')
- if tag.message.present?
diff --git a/changelogs/unreleased/325163-remove-global-default-branch-ff.yml b/changelogs/unreleased/325163-remove-global-default-branch-ff.yml
new file mode 100644
index 00000000000..d97bc8ca61e
--- /dev/null
+++ b/changelogs/unreleased/325163-remove-global-default-branch-ff.yml
@@ -0,0 +1,5 @@
+---
+title: Remove the global default branch feature flag
+merge_request: 59024
+author:
+type: other
diff --git a/changelogs/unreleased/326312-project-compare-controller-use-pagination.yml b/changelogs/unreleased/326312-project-compare-controller-use-pagination.yml
new file mode 100644
index 00000000000..ed9b133ab51
--- /dev/null
+++ b/changelogs/unreleased/326312-project-compare-controller-use-pagination.yml
@@ -0,0 +1,5 @@
+---
+title: Enable pagination in the CompareController
+merge_request: 59162
+author:
+type: performance
diff --git a/changelogs/unreleased/Externalise-strings-in-_gitaly-html-haml.yml b/changelogs/unreleased/Externalise-strings-in-_gitaly-html-haml.yml
new file mode 100644
index 00000000000..7822bcead4b
--- /dev/null
+++ b/changelogs/unreleased/Externalise-strings-in-_gitaly-html-haml.yml
@@ -0,0 +1,5 @@
+---
+title: Externalise Strings in /application_settings/_gitaly.html.haml
+merge_request: 57976
+author: nuwe1
+type: other
diff --git a/changelogs/unreleased/Externalize-strings-in-runners-show-html-haml.yml b/changelogs/unreleased/Externalize-strings-in-runners-show-html-haml.yml
new file mode 100644
index 00000000000..91dd03f9881
--- /dev/null
+++ b/changelogs/unreleased/Externalize-strings-in-runners-show-html-haml.yml
@@ -0,0 +1,5 @@
+---
+title: Externalizes strings in runners/show.html.haml
+merge_request: 58166
+author: nuwe1
+type: other
diff --git a/changelogs/unreleased/Externalize-strings-in-viewers-_contributing-html-haml.yml b/changelogs/unreleased/Externalize-strings-in-viewers-_contributing-html-haml.yml
new file mode 100644
index 00000000000..6bef163b11b
--- /dev/null
+++ b/changelogs/unreleased/Externalize-strings-in-viewers-_contributing-html-haml.yml
@@ -0,0 +1,5 @@
+---
+title: Externalize strings in viewers/_contributing.html.haml
+merge_request: 58447
+author: nuwe1
+type: other
diff --git a/changelogs/unreleased/gl-badge-mr.yml b/changelogs/unreleased/gl-badge-mr.yml
new file mode 100644
index 00000000000..2fc3590c823
--- /dev/null
+++ b/changelogs/unreleased/gl-badge-mr.yml
@@ -0,0 +1,5 @@
+---
+title: Add gl-badge for badges in MRs and issues nav
+merge_request: 57942
+author: Yogi (@yo)
+type: changed
diff --git a/changelogs/unreleased/gl-badge-tags.yml b/changelogs/unreleased/gl-badge-tags.yml
new file mode 100644
index 00000000000..3773311f863
--- /dev/null
+++ b/changelogs/unreleased/gl-badge-tags.yml
@@ -0,0 +1,5 @@
+---
+title: Add gl-badge class for tag's badge
+merge_request: 57939
+author: Yogi (@yo)
+type: changed
diff --git a/changelogs/unreleased/gl-form-keys.yml b/changelogs/unreleased/gl-form-keys.yml
new file mode 100644
index 00000000000..a265609f91d
--- /dev/null
+++ b/changelogs/unreleased/gl-form-keys.yml
@@ -0,0 +1,5 @@
+---
+title: Apply gl-form-input for fields in ssh keys page
+merge_request: 58000
+author: Yogi (@yo)
+type: changed
diff --git a/changelogs/unreleased/improve-finding-of-terminus-when-shifting-positions.yml b/changelogs/unreleased/improve-finding-of-terminus-when-shifting-positions.yml
new file mode 100644
index 00000000000..fd8e90f1f4d
--- /dev/null
+++ b/changelogs/unreleased/improve-finding-of-terminus-when-shifting-positions.yml
@@ -0,0 +1,5 @@
+---
+title: Improve shifting of positions when creating issues
+merge_request: 59745
+author:
+type: performance
diff --git a/changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-services-feature-flags.yml b/changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-services-feature-flags.yml
new file mode 100644
index 00000000000..7f0edeaee44
--- /dev/null
+++ b/changelogs/unreleased/issue-325836-fix-empty-line-after-let-it-be-services-feature-flags.yml
@@ -0,0 +1,5 @@
+---
+title: Fix EmptyLineAfterFinalLetItBe offenses in spec/services/feature_flags
+merge_request: 58419
+author: Huzaifa Iftikhar @huzaifaiftikhar
+type: fixed
diff --git a/changelogs/unreleased/pl-rubocop-todo-redundant-file-extension-in-require.yml b/changelogs/unreleased/pl-rubocop-todo-redundant-file-extension-in-require.yml
new file mode 100644
index 00000000000..3958acc8a92
--- /dev/null
+++ b/changelogs/unreleased/pl-rubocop-todo-redundant-file-extension-in-require.yml
@@ -0,0 +1,5 @@
+---
+title: Resolves rubocop offense Style/RedundantFileExtensionInRequire
+merge_request: 57963
+author: Shubham Kumar (@imskr)
+type: fixed
diff --git a/changelogs/unreleased/update-gitlab-runner-helm-chart-to-0-28-0.yml b/changelogs/unreleased/update-gitlab-runner-helm-chart-to-0-28-0.yml
new file mode 100644
index 00000000000..d893cb61237
--- /dev/null
+++ b/changelogs/unreleased/update-gitlab-runner-helm-chart-to-0-28-0.yml
@@ -0,0 +1,5 @@
+---
+title: Update GitLab Runner Helm Chart to 0.28.0
+merge_request: 59802
+author:
+type: other
diff --git a/config/feature_flags/development/global_default_branch_name.yml b/config/feature_flags/development/global_default_branch_name.yml
deleted file mode 100644
index 488c9fb47c8..00000000000
--- a/config/feature_flags/development/global_default_branch_name.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: global_default_branch_name
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35269
-rollout_issue_url:
-milestone: '13.2'
-type: development
-group: group::source code
-default_enabled: true
diff --git a/config/feature_flags/development/optimize_shifting_relative_positions.yml b/config/feature_flags/development/optimize_shifting_relative_positions.yml
new file mode 100644
index 00000000000..25392bbe7a7
--- /dev/null
+++ b/config/feature_flags/development/optimize_shifting_relative_positions.yml
@@ -0,0 +1,8 @@
+---
+name: optimize_shifting_relative_positions
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59745
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/328402
+milestone: '13.12'
+type: development
+group: group::project management
+default_enabled: false
diff --git a/doc/user/admin_area/user_cohorts.md b/doc/user/admin_area/user_cohorts.md
index f3c913b409a..888c798be2e 100644
--- a/doc/user/admin_area/user_cohorts.md
+++ b/doc/user/admin_area/user_cohorts.md
@@ -6,8 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Cohorts **(FREE)**
-As a benefit of having the [usage ping active](settings/usage_statistics.md),
-you can analyze your users' GitLab activities over time.
+You can analyze your users' GitLab activities over time.
To see user cohorts, go to **Admin Area > Overview > Users**.
diff --git a/doc/user/project/repository/branches/default.md b/doc/user/project/repository/branches/default.md
index 1363d883e76..b6446cdc63f 100644
--- a/doc/user/project/repository/branches/default.md
+++ b/doc/user/project/repository/branches/default.md
@@ -60,7 +60,6 @@ GitLab administrators can configure a new default branch name at the
> - It's deployed behind a feature flag, enabled by default.
> - It cannot be enabled or disabled per-project.
> - It's recommended for production use.
-> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-custom-initial-branch-name).
GitLab [administrators](../../../permissions.md) of self-managed instances can
customize the initial branch for projects hosted on that instance. Individual
@@ -75,25 +74,6 @@ Projects created on this instance after you change the setting use the
custom branch name, unless a group-level or subgroup-level configuration
overrides it.
-#### Enable or disable custom initial branch name **(FREE SELF)**
-
-Setting the default initial branch name is under development but ready for production use.
-It is deployed behind a feature flag that is **enabled by default**.
-[GitLab administrators with access to the GitLab Rails console](../../../../administration/feature_flags.md)
-can opt to disable it for your instance.
-
-To disable it:
-
-```ruby
-Feature.disable(:global_default_branch_name)
-```
-
-To enable it:
-
-```ruby
-Feature.enable(:global_default_branch_name)
-```
-
### Group-level custom initial branch name **(FREE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/221014) in GitLab 13.6.
diff --git a/lib/gitlab/relative_positioning.rb b/lib/gitlab/relative_positioning.rb
index e2cbe4b2de0..ceaba2538c1 100644
--- a/lib/gitlab/relative_positioning.rb
+++ b/lib/gitlab/relative_positioning.rb
@@ -13,6 +13,7 @@ module Gitlab
MIN_GAP = 2
NoSpaceLeft = Class.new(StandardError)
+ InvalidPosition = Class.new(StandardError)
IllegalRange = Class.new(ArgumentError)
def self.range(lhs, rhs)
diff --git a/lib/gitlab/relative_positioning/item_context.rb b/lib/gitlab/relative_positioning/item_context.rb
index 8f5495ece5e..1e738aef9b0 100644
--- a/lib/gitlab/relative_positioning/item_context.rb
+++ b/lib/gitlab/relative_positioning/item_context.rb
@@ -129,6 +129,14 @@ module Gitlab
neighbour(sib)
end
+ def at_position(position)
+ item = scoped_items.find_by(relative_position: position)
+
+ raise InvalidPosition, 'No item found at the specified position' if item.nil?
+
+ neighbour(item)
+ end
+
def shift_left
move_sequence_before(true)
object.reset_relative_position
diff --git a/lib/tasks/tokens.rake b/lib/tasks/tokens.rake
index b0ff2cce482..74baa11c314 100644
--- a/lib/tasks/tokens.rake
+++ b/lib/tasks/tokens.rake
@@ -1,9 +1,9 @@
# frozen_string_literal: true
-require_relative '../../app/models/concerns/token_authenticatable.rb'
-require_relative '../../app/models/concerns/token_authenticatable_strategies/base.rb'
-require_relative '../../app/models/concerns/token_authenticatable_strategies/insecure.rb'
-require_relative '../../app/models/concerns/token_authenticatable_strategies/digest.rb'
+require_relative '../../app/models/concerns/token_authenticatable'
+require_relative '../../app/models/concerns/token_authenticatable_strategies/base'
+require_relative '../../app/models/concerns/token_authenticatable_strategies/insecure'
+require_relative '../../app/models/concerns/token_authenticatable_strategies/digest'
namespace :tokens do
desc "Reset all GitLab incoming email tokens"
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index d025807473e..83ec614619f 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -1799,9 +1799,6 @@ msgstr ""
msgid "Activate Service Desk"
msgstr ""
-msgid "Activate user activity analysis"
-msgstr ""
-
msgid "Active"
msgstr ""
@@ -2771,6 +2768,9 @@ msgstr ""
msgid "After that, you will not be able to use merge approvals or epics as well as many security features."
msgstr ""
+msgid "After you've reviewed these contribution guidelines, you'll be all set to"
+msgstr ""
+
msgid "Alert"
msgid_plural "Alerts"
msgstr[0] ""
@@ -10345,6 +10345,9 @@ msgstr ""
msgid "Default CI configuration path"
msgstr ""
+msgid "Default Timeout Period"
+msgstr ""
+
msgid "Default artifacts expiration"
msgstr ""
@@ -13382,6 +13385,9 @@ msgstr ""
msgid "False positive"
msgstr ""
+msgid "Fast Timeout Period"
+msgstr ""
+
msgid "Fast-forward merge is not possible. Rebase the source branch onto %{targetBranch} to allow this merge request to be merged."
msgstr ""
@@ -19673,6 +19679,9 @@ msgstr ""
msgid "Median"
msgstr ""
+msgid "Medium Timeout Period"
+msgstr ""
+
msgid "Medium vulnerabilities present"
msgstr ""
@@ -33354,9 +33363,6 @@ msgstr ""
msgid "Turn on"
msgstr ""
-msgid "Turn on %{strongStart}usage ping%{strongEnd} to activate analysis of user activity, known as %{docLinkStart}Cohorts%{docLinkEnd}."
-msgstr ""
-
msgid "Turn on usage ping"
msgstr ""
@@ -37024,6 +37030,9 @@ msgstr ""
msgid "container_name cannot be larger than %{max_length} chars"
msgstr ""
+msgid "contribute to this project."
+msgstr ""
+
msgid "could not read private key, is the passphrase correct?"
msgstr ""
diff --git a/package.json b/package.json
index d198ce4e525..c39cb6ef08a 100644
--- a/package.json
+++ b/package.json
@@ -133,7 +133,7 @@
"sortablejs": "^1.10.2",
"sql.js": "^0.4.0",
"string-hash": "1.1.3",
- "style-loader": "^1.3.0",
+ "style-loader": "^2.0.0",
"swagger-ui-dist": "^3.44.1",
"three": "^0.84.0",
"three-orbit-controls": "^82.1.0",
diff --git a/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb b/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb
index 07fc4f0e7fa..94df408f9aa 100644
--- a/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb
+++ b/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require_relative 'cluster_with_prometheus.rb'
+require_relative 'cluster_with_prometheus'
module QA
RSpec.describe 'Monitor', :orchestrated, :kubernetes, :requires_admin, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/241448', type: :investigating } do
diff --git a/qa/qa/tools/revoke_all_personal_access_tokens.rb b/qa/qa/tools/revoke_all_personal_access_tokens.rb
index 0aaf1ed6f7f..63a7b0d2d8e 100644
--- a/qa/qa/tools/revoke_all_personal_access_tokens.rb
+++ b/qa/qa/tools/revoke_all_personal_access_tokens.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require_relative '../../qa'
-require 'net/protocol.rb'
+require 'net/protocol'
# This script revokes all personal access tokens with the name of 'api-test-token' on the host specified by GITLAB_ADDRESS
# Required environment variables: GITLAB_USERNAME, GITLAB_PASSWORD and GITLAB_ADDRESS
# Run `rake revoke_personal_access_tokens`
diff --git a/rubocop/cop/code_reuse/presenter.rb b/rubocop/cop/code_reuse/presenter.rb
index 5f8f2839ca6..6eef5e5a4b0 100644
--- a/rubocop/cop/code_reuse/presenter.rb
+++ b/rubocop/cop/code_reuse/presenter.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require_relative '../../code_reuse_helpers.rb'
+require_relative '../../code_reuse_helpers'
module RuboCop
module Cop
diff --git a/rubocop/cop/code_reuse/serializer.rb b/rubocop/cop/code_reuse/serializer.rb
index 2212c50514e..17a84ec31f7 100644
--- a/rubocop/cop/code_reuse/serializer.rb
+++ b/rubocop/cop/code_reuse/serializer.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require_relative '../../code_reuse_helpers.rb'
+require_relative '../../code_reuse_helpers'
module RuboCop
module Cop
diff --git a/rubocop/cop/code_reuse/service_class.rb b/rubocop/cop/code_reuse/service_class.rb
index 768b43fb684..e403a87093c 100644
--- a/rubocop/cop/code_reuse/service_class.rb
+++ b/rubocop/cop/code_reuse/service_class.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require_relative '../../code_reuse_helpers.rb'
+require_relative '../../code_reuse_helpers'
module RuboCop
module Cop
diff --git a/rubocop/cop/code_reuse/worker.rb b/rubocop/cop/code_reuse/worker.rb
index e38d2783d0f..4902920234f 100644
--- a/rubocop/cop/code_reuse/worker.rb
+++ b/rubocop/cop/code_reuse/worker.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require_relative '../../code_reuse_helpers.rb'
+require_relative '../../code_reuse_helpers'
module RuboCop
module Cop
diff --git a/rubocop/cop/scalability/idempotent_worker.rb b/rubocop/cop/scalability/idempotent_worker.rb
index a38b457b7c7..7abde54ce7e 100644
--- a/rubocop/cop/scalability/idempotent_worker.rb
+++ b/rubocop/cop/scalability/idempotent_worker.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require_relative '../../code_reuse_helpers.rb'
+require_relative '../../code_reuse_helpers'
module RuboCop
module Cop
diff --git a/scripts/docs_screenshots.rb b/scripts/docs_screenshots.rb
index 7472d9ea37b..094e7e87960 100755
--- a/scripts/docs_screenshots.rb
+++ b/scripts/docs_screenshots.rb
@@ -5,7 +5,7 @@
require 'png_quantizator'
require 'open3'
require 'parallel'
-require_relative '../tooling/lib/tooling/images.rb'
+require_relative '../tooling/lib/tooling/images'
generator = ARGV[0]
milestone = ARGV[1]
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb
index 4fc60d17886..e4b783a81fa 100644
--- a/spec/features/admin/admin_users_spec.rb
+++ b/spec/features/admin/admin_users_spec.rb
@@ -44,27 +44,14 @@ RSpec.describe "Admin::Users" do
end
describe 'Cohorts tab content' do
- context 'with usage ping enabled' do
- it 'shows users count per month' do
- stub_application_setting(usage_ping_enabled: true)
+ it 'shows users count per month' do
+ stub_application_setting(usage_ping_enabled: false)
- create_list(:user, 2)
+ create_list(:user, 2)
- visit admin_users_path(tab: 'cohorts')
-
- expect(page).to have_content("#{Time.now.strftime('%b %Y')} 3 0")
- end
- end
-
- context 'with usage ping disabled' do
- it 'shows empty state', :js do
- stub_application_setting(usage_ping_enabled: false)
-
- visit admin_users_path(tab: 'cohorts')
+ visit admin_users_path(tab: 'cohorts')
- expect(page).to have_selector(".js-empty-state")
- expect(page).to have_content("Activate user activity analysis")
- end
+ expect(page).to have_content("#{Time.now.strftime('%b %Y')} 3 0")
end
end
end
diff --git a/spec/features/projects/compare_spec.rb b/spec/features/projects/compare_spec.rb
index 64e9968061c..bc3ef2af9b0 100644
--- a/spec/features/projects/compare_spec.rb
+++ b/spec/features/projects/compare_spec.rb
@@ -118,6 +118,34 @@ RSpec.describe "Compare", :js do
end
end
end
+
+ context "pagination" do
+ before do
+ stub_const("Projects::CompareController::COMMIT_DIFFS_PER_PAGE", 1)
+ end
+
+ it "shows an adjusted count for changed files on this page" do
+ visit project_compare_index_path(project, from: "feature", to: "master")
+
+ click_button('Compare')
+
+ expect(page).to have_content("Showing 1 changed file")
+ end
+
+ it "shows commits list only on the first page" do
+ visit project_compare_index_path(project, from: "feature", to: "master")
+ click_button('Compare')
+
+ expect(page).to have_content 'Commits (29)'
+
+ # go to the second page
+ within(".files .gl-pagination") do
+ click_on("2")
+ end
+
+ expect(page).not_to have_content 'Commits (29)'
+ end
+ end
end
describe "tags" do
diff --git a/spec/helpers/commits_helper_spec.rb b/spec/helpers/commits_helper_spec.rb
index 86ed133e599..53d204a697d 100644
--- a/spec/helpers/commits_helper_spec.rb
+++ b/spec/helpers/commits_helper_spec.rb
@@ -144,7 +144,7 @@ RSpec.describe CommitsHelper do
}
end
- subject { helper.conditionally_paginate_diff_files(diffs_collection, paginate: paginate) }
+ subject { helper.conditionally_paginate_diff_files(diffs_collection, paginate: paginate, per: Projects::CommitController::COMMIT_DIFFS_PER_PAGE) }
before do
allow(helper).to receive(:params).and_return(params)
@@ -168,15 +168,15 @@ RSpec.describe CommitsHelper do
let(:page) { 1 }
it "has 20 diffs" do
- expect(subject.size).to eq(75)
+ expect(subject.size).to eq(20)
end
end
- context "page 2" do
- let(:page) { 2 }
+ context "page 5" do
+ let(:page) { 5 }
- it "has the remaining 10 diffs" do
- expect(subject.size).to eq(10)
+ it "has the remaining 5 out of 85 diffs" do
+ expect(subject.size).to eq(5)
end
end
end
diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb
index 54524858962..b0338d80ee7 100644
--- a/spec/helpers/issuables_helper_spec.rb
+++ b/spec/helpers/issuables_helper_spec.rb
@@ -133,13 +133,13 @@ RSpec.describe IssuablesHelper do
it 'returns navigation with badges' do
expect(helper.issuables_state_counter_text(:issues, :opened, true))
- .to eq('<span>Open</span> <span class="badge badge-pill">42</span>')
+ .to eq('<span>Open</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm">42</span>')
expect(helper.issuables_state_counter_text(:issues, :closed, true))
- .to eq('<span>Closed</span> <span class="badge badge-pill">42</span>')
+ .to eq('<span>Closed</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm">42</span>')
expect(helper.issuables_state_counter_text(:merge_requests, :merged, true))
- .to eq('<span>Merged</span> <span class="badge badge-pill">42</span>')
+ .to eq('<span>Merged</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm">42</span>')
expect(helper.issuables_state_counter_text(:merge_requests, :all, true))
- .to eq('<span>All</span> <span class="badge badge-pill">42</span>')
+ .to eq('<span>All</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm">42</span>')
end
end
diff --git a/spec/initializers/6_validations_spec.rb b/spec/initializers/6_validations_spec.rb
index b909fc9db0a..cdd96640933 100644
--- a/spec/initializers/6_validations_spec.rb
+++ b/spec/initializers/6_validations_spec.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require 'spec_helper'
-require_relative '../../config/initializers/6_validations.rb'
+require_relative '../../config/initializers/6_validations'
RSpec.describe '6_validations' do
describe 'validate_storages_config' do
diff --git a/spec/initializers/mail_encoding_patch_spec.rb b/spec/initializers/mail_encoding_patch_spec.rb
index efacaf6b1b4..52a0d041f48 100644
--- a/spec/initializers/mail_encoding_patch_spec.rb
+++ b/spec/initializers/mail_encoding_patch_spec.rb
@@ -3,7 +3,7 @@
require 'fast_spec_helper'
require 'mail'
-require_relative '../../config/initializers/mail_encoding_patch.rb'
+require_relative '../../config/initializers/mail_encoding_patch'
RSpec.describe 'Mail quoted-printable transfer encoding patch and Unicode characters' do
shared_examples 'email encoding' do |email|
diff --git a/spec/lib/gitlab/import_export/json/legacy_reader/file_spec.rb b/spec/lib/gitlab/import_export/json/legacy_reader/file_spec.rb
index 9c7f41cbb89..e092891f236 100644
--- a/spec/lib/gitlab/import_export/json/legacy_reader/file_spec.rb
+++ b/spec/lib/gitlab/import_export/json/legacy_reader/file_spec.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require 'spec_helper'
-require_relative 'shared_example.rb'
+require_relative 'shared_example'
RSpec.describe Gitlab::ImportExport::JSON::LegacyReader::File do
it_behaves_like 'import/export json legacy reader' do
diff --git a/spec/lib/gitlab/import_export/json/legacy_reader/hash_spec.rb b/spec/lib/gitlab/import_export/json/legacy_reader/hash_spec.rb
index d0899accf59..e47122b6151 100644
--- a/spec/lib/gitlab/import_export/json/legacy_reader/hash_spec.rb
+++ b/spec/lib/gitlab/import_export/json/legacy_reader/hash_spec.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require 'spec_helper'
-require_relative 'shared_example.rb'
+require_relative 'shared_example'
RSpec.describe Gitlab::ImportExport::JSON::LegacyReader::Hash do
it_behaves_like 'import/export json legacy reader' do
diff --git a/spec/lib/gitlab/relative_positioning/item_context_spec.rb b/spec/lib/gitlab/relative_positioning/item_context_spec.rb
index daea8d8470d..3a469e53cb1 100644
--- a/spec/lib/gitlab/relative_positioning/item_context_spec.rb
+++ b/spec/lib/gitlab/relative_positioning/item_context_spec.rb
@@ -212,4 +212,20 @@ RSpec.describe Gitlab::RelativePositioning::ItemContext do
end
end
end
+
+ describe '#at_position' do
+ let_it_be(:issue) { create_issue(500) }
+ let_it_be(:issue_2) { create_issue(510) }
+
+ let(:subject) { described_class.new(issue, range) }
+
+ it 'finds the item at the specified position' do
+ expect(subject.at_position(500)).to eq(described_class.new(issue, range))
+ expect(subject.at_position(510)).to eq(described_class.new(issue_2, range))
+ end
+
+ it 'raises InvalidPosition when the item cannot be found' do
+ expect { subject.at_position(501) }.to raise_error Gitlab::RelativePositioning::InvalidPosition
+ end
+ end
end
diff --git a/spec/rubocop/cop/performance/ar_count_each_spec.rb b/spec/rubocop/cop/performance/ar_count_each_spec.rb
index fa7a1aba426..4aeb9e13b18 100644
--- a/spec/rubocop/cop/performance/ar_count_each_spec.rb
+++ b/spec/rubocop/cop/performance/ar_count_each_spec.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require 'fast_spec_helper'
-require_relative '../../../../rubocop/cop/performance/ar_count_each.rb'
+require_relative '../../../../rubocop/cop/performance/ar_count_each'
RSpec.describe RuboCop::Cop::Performance::ARCountEach do
subject(:cop) { described_class.new }
diff --git a/spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb b/spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb
index 127c858a549..e95220756ed 100644
--- a/spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb
+++ b/spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require 'fast_spec_helper'
-require_relative '../../../../rubocop/cop/performance/ar_exists_and_present_blank.rb'
+require_relative '../../../../rubocop/cop/performance/ar_exists_and_present_blank'
RSpec.describe RuboCop::Cop::Performance::ARExistsAndPresentBlank do
subject(:cop) { described_class.new }
diff --git a/spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb b/spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb
index bc8b6b2d113..a66d3898c5c 100644
--- a/spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb
+++ b/spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
-require_relative 'shared_processing_service.rb'
-require_relative 'shared_processing_service_tests_with_yaml.rb'
+require_relative 'shared_processing_service'
+require_relative 'shared_processing_service_tests_with_yaml'
RSpec.describe Ci::PipelineProcessing::AtomicProcessingService do
it_behaves_like 'Pipeline Processing Service'
diff --git a/spec/services/feature_flags/create_service_spec.rb b/spec/services/feature_flags/create_service_spec.rb
index 128fab114fe..2e0c162ebc1 100644
--- a/spec/services/feature_flags/create_service_spec.rb
+++ b/spec/services/feature_flags/create_service_spec.rb
@@ -6,6 +6,7 @@ RSpec.describe FeatureFlags::CreateService do
let_it_be(:project) { create(:project) }
let_it_be(:developer) { create(:user) }
let_it_be(:reporter) { create(:user) }
+
let(:user) { developer }
before_all do
diff --git a/spec/services/feature_flags/destroy_service_spec.rb b/spec/services/feature_flags/destroy_service_spec.rb
index b35de02c628..ee30474873c 100644
--- a/spec/services/feature_flags/destroy_service_spec.rb
+++ b/spec/services/feature_flags/destroy_service_spec.rb
@@ -8,6 +8,7 @@ RSpec.describe FeatureFlags::DestroyService do
let_it_be(:project) { create(:project) }
let_it_be(:developer) { create(:user) }
let_it_be(:reporter) { create(:user) }
+
let(:user) { developer }
let!(:feature_flag) { create(:operations_feature_flag, project: project) }
diff --git a/spec/services/feature_flags/disable_service_spec.rb b/spec/services/feature_flags/disable_service_spec.rb
index de0f70bf552..4b2137be35c 100644
--- a/spec/services/feature_flags/disable_service_spec.rb
+++ b/spec/services/feature_flags/disable_service_spec.rb
@@ -7,6 +7,7 @@ RSpec.describe FeatureFlags::DisableService do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
+
let(:params) { {} }
let(:service) { described_class.new(project, user, params) }
diff --git a/spec/services/feature_flags/enable_service_spec.rb b/spec/services/feature_flags/enable_service_spec.rb
index 88c8028f6c5..c0008b1933f 100644
--- a/spec/services/feature_flags/enable_service_spec.rb
+++ b/spec/services/feature_flags/enable_service_spec.rb
@@ -7,6 +7,7 @@ RSpec.describe FeatureFlags::EnableService do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
+
let(:params) { {} }
let(:service) { described_class.new(project, user, params) }
diff --git a/spec/services/feature_flags/update_service_spec.rb b/spec/services/feature_flags/update_service_spec.rb
index 9639cf3081d..1a127a0d472 100644
--- a/spec/services/feature_flags/update_service_spec.rb
+++ b/spec/services/feature_flags/update_service_spec.rb
@@ -6,6 +6,7 @@ RSpec.describe FeatureFlags::UpdateService do
let_it_be(:project) { create(:project) }
let_it_be(:developer) { create(:user) }
let_it_be(:reporter) { create(:user) }
+
let(:user) { developer }
let(:feature_flag) { create(:operations_feature_flag, project: project, active: true) }
diff --git a/spec/services/issues/build_service_spec.rb b/spec/services/issues/build_service_spec.rb
index 80fe2474ecd..87b5f250d4b 100644
--- a/spec/services/issues/build_service_spec.rb
+++ b/spec/services/issues/build_service_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'spec_helper.rb'
+require 'spec_helper'
RSpec.describe Issues::BuildService do
let_it_be(:project) { create(:project, :repository) }
diff --git a/spec/services/issues/referenced_merge_requests_service_spec.rb b/spec/services/issues/referenced_merge_requests_service_spec.rb
index bf7a4c97e48..1dfe88d9951 100644
--- a/spec/services/issues/referenced_merge_requests_service_spec.rb
+++ b/spec/services/issues/referenced_merge_requests_service_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'spec_helper.rb'
+require 'spec_helper'
RSpec.describe Issues::ReferencedMergeRequestsService do
def create_referencing_mr(attributes = {})
diff --git a/spec/services/issues/resolve_discussions_spec.rb b/spec/services/issues/resolve_discussions_spec.rb
index 9fbc9cbcca6..927dd7ae3e7 100644
--- a/spec/services/issues/resolve_discussions_spec.rb
+++ b/spec/services/issues/resolve_discussions_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'spec_helper.rb'
+require 'spec_helper'
RSpec.describe Issues::ResolveDiscussions do
let(:project) { create(:project, :repository) }
diff --git a/spec/support/shared_examples/models/relative_positioning_shared_examples.rb b/spec/support/shared_examples/models/relative_positioning_shared_examples.rb
index b8d12a6da59..c5615ced3fd 100644
--- a/spec/support/shared_examples/models/relative_positioning_shared_examples.rb
+++ b/spec/support/shared_examples/models/relative_positioning_shared_examples.rb
@@ -66,7 +66,7 @@ RSpec.shared_examples 'a class that supports relative positioning' do
end
end
- describe '.move_nulls_to_end' do
+ shared_examples '.move_nulls_to_end' do
let(:item3) { create_item }
let(:sibling_query) { item1.class.relative_positioning_query_base(item1) }
@@ -186,7 +186,7 @@ RSpec.shared_examples 'a class that supports relative positioning' do
end
end
- describe '.move_nulls_to_start' do
+ shared_examples '.move_nulls_to_start' do
let(:item3) { create_item }
let(:sibling_query) { item1.class.relative_positioning_query_base(item1) }
@@ -261,6 +261,24 @@ RSpec.shared_examples 'a class that supports relative positioning' do
end
end
+ context 'when optimize_shifting_relative_positions is enabled' do
+ before do
+ stub_feature_flags(optimize_shifting_relative_positions: true)
+ end
+
+ it_behaves_like '.move_nulls_to_start'
+ it_behaves_like '.move_nulls_to_end'
+ end
+
+ context 'when optimize_shifting_relative_positions is disabled' do
+ before do
+ stub_feature_flags(optimize_shifting_relative_positions: false)
+ end
+
+ it_behaves_like '.move_nulls_to_start'
+ it_behaves_like '.move_nulls_to_end'
+ end
+
describe '#move_before' do
let(:item3) { create(factory, default_params) }
diff --git a/spec/views/admin/application_settings/repository.html.haml_spec.rb b/spec/views/admin/application_settings/repository.html.haml_spec.rb
index b110bc277ac..47cadd29e33 100644
--- a/spec/views/admin/application_settings/repository.html.haml_spec.rb
+++ b/spec/views/admin/application_settings/repository.html.haml_spec.rb
@@ -12,35 +12,17 @@ RSpec.describe 'admin/application_settings/repository.html.haml' do
end
describe 'default initial branch name' do
- context 'when the feature flag is disabled' do
- before do
- stub_feature_flags(global_default_branch_name: false)
- end
+ it 'has the setting section' do
+ render
- it 'does not show the setting section' do
- render
-
- expect(rendered).not_to have_css("#js-default-branch-name")
- end
+ expect(rendered).to have_css("#js-default-branch-name")
end
- context 'when the feature flag is enabled' do
- before do
- stub_feature_flags(global_default_branch_name: true)
- end
-
- it 'has the setting section' do
- render
-
- expect(rendered).to have_css("#js-default-branch-name")
- end
-
- it 'renders the correct setting section content' do
- render
+ it 'renders the correct setting section content' do
+ render
- expect(rendered).to have_content("Default initial branch name")
- expect(rendered).to have_content("Set the default name of the initial branch when creating new repositories through the user interface.")
- end
+ expect(rendered).to have_content("Default initial branch name")
+ expect(rendered).to have_content("Set the default name of the initial branch when creating new repositories through the user interface.")
end
end
end
diff --git a/yarn.lock b/yarn.lock
index c1d2ddbf4e2..aae3e2922c2 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -11207,13 +11207,13 @@ strip-json-comments@~2.0.1:
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
-style-loader@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.3.0.tgz#828b4a3b3b7e7aa5847ce7bae9e874512114249e"
- integrity sha512-V7TCORko8rs9rIqkSrlMfkqA63DfoGBBJmK1kKGCcSi+BWb4cqz0SRsnp4l6rU5iwOEd0/2ePv68SV22VXon4Q==
+style-loader@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-2.0.0.tgz#9669602fd4690740eaaec137799a03addbbc393c"
+ integrity sha512-Z0gYUJmzZ6ZdRUqpg1r8GsaFKypE+3xAzuFeMuoHgjc9KZv3wMyCRjQIWEbhoFSq7+7yoHXySDJyyWQaPajeiQ==
dependencies:
loader-utils "^2.0.0"
- schema-utils "^2.7.0"
+ schema-utils "^3.0.0"
style-search@^0.1.0:
version "0.1.0"