Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-05-19 21:08:17 +00:00
parent abe6e7a2e7
commit 3d6aa90710
37 changed files with 154 additions and 79 deletions

View File

@ -1 +1 @@
14.4.0
14.5.0

View File

@ -182,7 +182,7 @@ export default {
</script>
<template>
<div data-testid="vsa-stage-table">
<gl-loading-icon v-if="isLoading" class="gl-mt-4" size="md" />
<gl-loading-icon v-if="isLoading" class="gl-mt-4" size="lg" />
<gl-empty-state
v-else-if="isEmptyStage"
:title="emptyStateTitleText"

View File

@ -145,7 +145,7 @@ export default {
</span>
</div>
<gl-intersection-observer @appear="onAppear">
<gl-loading-icon v-if="showLoadingSpinner" size="md" />
<gl-loading-icon v-if="showLoadingSpinner" size="lg" />
<gl-icon
v-else-if="showImageErrorIcon"
name="media-broken"

View File

@ -407,7 +407,7 @@ export default {
</div>
</header>
<div class="gl-mt-6">
<gl-loading-icon v-if="isLoading" size="md" />
<gl-loading-icon v-if="isLoading" size="lg" />
<gl-alert v-else-if="error" variant="danger" :dismissible="false">
{{ __('An error occurred while loading designs. Please try again.') }}
</gl-alert>

View File

@ -120,7 +120,7 @@ export default {
:help-page-path="helpPagePath"
:inline="isInlineView"
/>
<gl-loading-icon v-if="diffFile.renderingLines" size="md" class="mt-3" />
<gl-loading-icon v-if="diffFile.renderingLines" size="lg" class="mt-3" />
</template>
<not-diffable-viewer v-else-if="notDiffable" />
<no-preview-viewer v-else-if="noPreview" />

View File

@ -33,7 +33,7 @@ export default {
<template>
<div class="environments-container">
<gl-loading-icon v-if="isLoading" size="md" class="gl-mt-3" label="Loading environments" />
<gl-loading-icon v-if="isLoading" size="lg" class="gl-mt-3" label="Loading environments" />
<slot name="empty-state"></slot>

View File

@ -177,7 +177,7 @@ export default {
<template v-if="shouldRenderFolderContent(model)">
<div v-if="model.isLoadingFolderContent" :key="`loading-item-${i}`">
<gl-loading-icon size="md" class="gl-mt-5" />
<gl-loading-icon size="lg" class="gl-mt-5" />
</div>
<template v-else>

View File

@ -369,7 +369,7 @@ export default {
</div>
<div v-if="loading" class="py-3">
<gl-loading-icon size="md" />
<gl-loading-icon size="lg" />
</div>
<template v-else>

View File

@ -67,7 +67,7 @@ export default {
{{ message }}
</gl-alert>
<gl-loading-icon v-if="isLoading" :label="loadingLabel" size="md" class="gl-mt-4" />
<gl-loading-icon v-if="isLoading" :label="loadingLabel" size="lg" class="gl-mt-4" />
<gl-empty-state
v-else-if="errorState"

View File

@ -251,7 +251,7 @@ export default {
<gl-loading-icon
v-if="isLoading"
:label="s__('GroupsTree|Loading groups')"
size="md"
size="lg"
class="loading-animation prepend-top-20"
/>
<groups-component

View File

@ -176,7 +176,7 @@ export default {
{{ __('New file') }}
</gl-button>
</template>
<gl-loading-icon v-else-if="!currentTree || currentTree.loading" size="md" />
<gl-loading-icon v-else-if="!currentTree || currentTree.loading" size="lg" />
<p v-else>
{{
__(

View File

@ -581,7 +581,7 @@ export default {
@clear="filter = ''"
/>
</div>
<gl-loading-icon v-if="$apollo.loading" size="md" class="gl-mt-5" />
<gl-loading-icon v-if="$apollo.loading" size="lg" class="gl-mt-5" />
<template v-else>
<gl-empty-state
v-if="hasEmptyFilter"

View File

@ -181,7 +181,7 @@ export default {
:key="pagePaginationStateKey"
@appear="fetchRepos"
/>
<gl-loading-icon v-if="isLoading" class="gl-mt-7" size="md" />
<gl-loading-icon v-if="isLoading" class="gl-mt-7" size="lg" />
<div v-if="!isLoading && repositories.length === 0" class="gl-text-center">
<strong>{{ emptyStateText }}</strong>

View File

@ -136,7 +136,7 @@ export default {
</template>
<template #table-busy>
<gl-loading-icon size="md" class="gl-my-2" />
<gl-loading-icon size="lg" class="gl-my-2" />
</template>
</gl-table>
<div class="gl-display-flex gl-justify-content-center gl-mt-5">

View File

@ -104,7 +104,7 @@ export default {
@input="onGroupSearch"
/>
<gl-loading-icon v-if="isLoadingInitial" size="md" />
<gl-loading-icon v-if="isLoadingInitial" size="lg" />
<div v-else-if="groups.length === 0" class="gl-text-center">
<h5>{{ s__('Integrations|No available namespaces.') }}</h5>
<p class="gl-mt-5">

View File

@ -29,7 +29,7 @@ export default {
<div>
<h2 class="gl-text-center gl-mb-7">{{ s__('JiraService|GitLab for Jira Configuration') }}</h2>
<gl-loading-icon v-if="subscriptionsLoading" size="md" />
<gl-loading-icon v-if="subscriptionsLoading" size="lg" />
<div v-else-if="hasSubscriptions && !subscriptionsError">
<div class="gl-display-flex gl-justify-content-end gl-mb-3">
<add-namespace-button />

View File

@ -95,7 +95,7 @@ export default {
:illustration="setupIllustration"
:jira-integration-path="jiraIntegrationPath"
/>
<gl-loading-icon v-else-if="$apollo.loading" size="md" class="mt-3" />
<gl-loading-icon v-else-if="$apollo.loading" size="lg" class="mt-3" />
<jira-import-progress
v-else-if="jiraImportDetails.isInProgress"
:illustration="inProgressIllustration"

View File

@ -331,7 +331,7 @@ export default {
</template>
</gl-table-lite>
<gl-loading-icon v-if="isInitialLoadingState" size="md" />
<gl-loading-icon v-if="isInitialLoadingState" size="lg" />
<gl-button
v-if="hasMoreUsers"

View File

@ -711,6 +711,7 @@ export default {
<div
v-if="!restructuredWidgetShowMergeButtons"
class="gl-w-full gl-order-n1 gl-text-gray-500"
data-qa-selector="merged_status_content"
>
<strong v-if="mr.state !== 'closed'">
{{ __('Merge details') }}
@ -788,11 +789,7 @@ export default {
</div>
</div>
<template v-if="shouldShowMergeControls && !glFeatures.restructuredMrWidget">
<div
v-if="!shouldShowMergeEdit"
class="mr-fast-forward-message"
data-qa-selector="fast_forward_message_content"
>
<div v-if="!shouldShowMergeEdit" class="mr-fast-forward-message">
{{ __('Fast-forward merge without a merge commit') }}
</div>
<commits-header

View File

@ -3,7 +3,7 @@
- page_title _("Identities"), @user.name, _("Users")
= render 'admin/users/head'
= link_to _('New identity'), new_admin_user_identity_path, class: 'float-right gl-button btn btn-success'
= link_to _('New identity'), new_admin_user_identity_path, class: 'float-right gl-button btn-confirm'
- if @identities.present?
.table-holder
%table.table

View File

@ -49,6 +49,7 @@
data: { qa_selector: 'new_user_email_field' },
required: true,
title: _('Please provide a valid email address.')
%p.gl-field-hint.text-secondary= _('We recommend a work email address.')
.form-group.gl-mb-5#password-strength
= f.label :password, class: 'label-bold'
= f.password_field :password,

View File

@ -0,0 +1,8 @@
---
name: container_registry_migration_phase2_capacity_40
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86543
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/350543
milestone: '15.1'
type: development
group: group::package
default_enabled: false

View File

@ -78,9 +78,6 @@
- 'i_code_review_user_create_note_in_ipynb_diff'
- 'i_code_review_user_create_note_in_ipynb_diff_mr'
- 'i_code_review_user_create_note_in_ipynb_diff_commit'
- 'i_code_review_create_note_in_ipynb_diff'
- 'i_code_review_create_note_in_ipynb_diff_mr'
- 'i_code_review_create_note_in_ipynb_diff_commit'
- name: code_review_category_monthly_active_users
operator: OR
source: redis
@ -149,9 +146,6 @@
- 'i_code_review_user_create_note_in_ipynb_diff'
- 'i_code_review_user_create_note_in_ipynb_diff_mr'
- 'i_code_review_user_create_note_in_ipynb_diff_commit'
- 'i_code_review_create_note_in_ipynb_diff'
- 'i_code_review_create_note_in_ipynb_diff_mr'
- 'i_code_review_create_note_in_ipynb_diff_commit'
- name: code_review_extension_category_monthly_active_users
operator: OR
source: redis

View File

@ -623,6 +623,7 @@ Input type: `AdminSidekiqQueuesDeleteJobsInput`
| <a id="mutationadminsidekiqqueuesdeletejobsqueuename"></a>`queueName` | [`String!`](#string) | Name of the queue to delete jobs from. |
| <a id="mutationadminsidekiqqueuesdeletejobsrelatedclass"></a>`relatedClass` | [`String`](#string) | Delete jobs matching related_class in the context metadata. |
| <a id="mutationadminsidekiqqueuesdeletejobsremoteip"></a>`remoteIp` | [`String`](#string) | Delete jobs matching remote_ip in the context metadata. |
| <a id="mutationadminsidekiqqueuesdeletejobsrootcallerid"></a>`rootCallerId` | [`String`](#string) | Delete jobs matching root_caller_id in the context metadata. |
| <a id="mutationadminsidekiqqueuesdeletejobsrootnamespace"></a>`rootNamespace` | [`String`](#string) | Delete jobs matching root_namespace in the context metadata. |
| <a id="mutationadminsidekiqqueuesdeletejobssubscriptionplan"></a>`subscriptionPlan` | [`String`](#string) | Delete jobs matching subscription_plan in the context metadata. |
| <a id="mutationadminsidekiqqueuesdeletejobsuser"></a>`user` | [`String`](#string) | Delete jobs matching user in the context metadata. |

View File

@ -54,6 +54,7 @@ module ContainerRegistry
#
# TODO: See https://gitlab.com/gitlab-org/container-registry/-/issues/582
#
return 40 if Feature.enabled?(:container_registry_migration_phase2_capacity_40)
return 25 if Feature.enabled?(:container_registry_migration_phase2_capacity_25)
return 10 if Feature.enabled?(:container_registry_migration_phase2_capacity_10)
return 5 if Feature.enabled?(:container_registry_migration_phase2_capacity_5)

View File

@ -20,7 +20,8 @@ module Gitlab
:pipeline_id,
:related_class,
:feature_category,
:artifact_size
:artifact_size,
:root_caller_id
].freeze
private_constant :KNOWN_KEYS
@ -34,7 +35,8 @@ module Gitlab
Attribute.new(:job, ::Ci::Build),
Attribute.new(:related_class, String),
Attribute.new(:feature_category, String),
Attribute.new(:artifact, ::Ci::JobArtifact)
Attribute.new(:artifact, ::Ci::JobArtifact),
Attribute.new(:root_caller_id, String)
].freeze
def self.known_keys
@ -84,10 +86,11 @@ module Gitlab
hash[:project] = -> { project_path } if include_project?
hash[:root_namespace] = -> { root_namespace_path } if include_namespace?
hash[:client_id] = -> { client } if include_client?
hash[:caller_id] = caller_id if set_values.include?(:caller_id)
hash[:remote_ip] = remote_ip if set_values.include?(:remote_ip)
hash[:related_class] = related_class if set_values.include?(:related_class)
hash[:feature_category] = feature_category if set_values.include?(:feature_category)
assign_hash_if_value(hash, :caller_id)
assign_hash_if_value(hash, :root_caller_id)
assign_hash_if_value(hash, :remote_ip)
assign_hash_if_value(hash, :related_class)
assign_hash_if_value(hash, :feature_category)
hash[:pipeline_id] = -> { job&.pipeline_id } if set_values.include?(:job)
hash[:job_id] = -> { job&.id } if set_values.include?(:job)
hash[:artifact_size] = -> { artifact&.size } if set_values.include?(:artifact)
@ -108,6 +111,14 @@ module Gitlab
lazy_attr_reader attr.name, type: attr.type
end
def assign_hash_if_value(hash, attribute_name)
raise ArgumentError unless KNOWN_KEYS.include?(attribute_name)
# rubocop:disable GitlabSecurity/PublicSend
hash[attribute_name] = public_send(attribute_name) if set_values.include?(attribute_name)
# rubocop:enable GitlabSecurity/PublicSend
end
def assign_attributes(values)
values.slice(*APPLICATION_ATTRIBUTES.map(&:name)).each do |name, value|
instance_variable_set("@#{name}", value)

View File

@ -19,14 +19,21 @@ module Gitlab
# This should be inside the context for the arguments so
# that we don't override the feature category on the worker
# with the one from the caller.
#
root_caller_id = Gitlab::ApplicationContext.current_context_attribute(:root_caller_id) ||
Gitlab::ApplicationContext.current_context_attribute(:caller_id)
context = {
root_caller_id: root_caller_id
}
# We do not want to set anything explicitly in the context
# when the feature category is 'not_owned'.
if worker_class.feature_category_not_owned?
yield
else
Gitlab::ApplicationContext.with_context(feature_category: worker_class.get_feature_category.to_s, &block)
unless worker_class.feature_category_not_owned?
context[:feature_category] = worker_class.get_feature_category.to_s
end
Gitlab::ApplicationContext.with_context(**context, &block)
end
end
end

View File

@ -12,7 +12,9 @@ module Gitlab
# This is not a worker we know about, perhaps from a gem
return yield unless worker_class.respond_to?(:get_worker_context)
Gitlab::ApplicationContext.with_context(feature_category: worker_class.get_feature_category.to_s) do
feature_category = worker_class.get_feature_category.to_s
Gitlab::ApplicationContext.with_context(feature_category: feature_category) do
# Use the context defined on the class level as the more specific context
wrap_in_optional_context(worker_class.get_worker_context, &block)
end

View File

@ -42325,6 +42325,9 @@ msgstr ""
msgid "We invite you to %{featureLinkStart}request a feature%{featureLinkEnd}, %{bugLinkStart}report a bug%{bugLinkEnd} or %{feedbackLinkStart}share feedback%{feedbackLinkEnd}"
msgstr ""
msgid "We recommend a work email address."
msgstr ""
msgid "We recommend cloud-based mobile authenticator apps such as Authy, Duo Mobile, and LastPass. They can restore access if you lose your hardware device."
msgstr ""

View File

@ -78,9 +78,9 @@ module QA
view 'app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue' do
element :merge_button
element :fast_forward_message_content
element :merge_moment_dropdown
element :merge_immediately_menu_item
element :merged_status_content
end
view 'app/assets/javascripts/vue_merge_request_widget/components/states/sha_mismatch.vue' do
@ -192,10 +192,6 @@ module QA
click_element(:edit_button)
end
def fast_forward_possible?
has_element?(:fast_forward_message_content)
end
def fast_forward_not_possible?
has_element?(:no_fast_forward_message_content)
end
@ -265,7 +261,7 @@ module QA
# To remove page refresh logic if possible
# We don't raise on failure because this method is used as a predicate matcher
retry_until(max_attempts: 3, reload: true, raise_on_failure: false) do
has_element?(:merged_status_content, text: 'The changes were merged into', wait: 20)
has_element?(:merged_status_content, text: /The changes were merged into|Changes merged into/, wait: 20)
end
end
@ -316,12 +312,6 @@ module QA
end
click_element(:mr_rebase_button)
success = wait_until do
fast_forward_possible?
end
raise "Rebase did not appear to be successful" unless success
end
def merge_immediately!

View File

@ -28,15 +28,19 @@ module QA
merge_request.visit!
Page::MergeRequest::Show.perform do |merge_request|
expect(merge_request).to have_content('Merge blocked: the source branch must be rebased onto the target branch.')
expect(merge_request).to be_fast_forward_not_possible
expect(merge_request).not_to have_merge_button
Page::MergeRequest::Show.perform do |mr_page|
expect(mr_page).to have_content('Merge blocked: the source branch must be rebased onto the target branch.')
expect(mr_page).to be_fast_forward_not_possible
expect(mr_page).not_to have_merge_button
expect(merge_request.project.commits.size).to eq(2)
merge_request.rebase!
mr_page.rebase!
expect(merge_request).to have_merge_button
expect(merge_request).to be_fast_forward_possible
expect(mr_page).to have_merge_button
mr_page.merge!
expect(merge_request.project.commits.size).to eq(3)
end
end
end

View File

@ -45,7 +45,7 @@ exports[`Design management index page designs renders loading icon 1`] = `
<gl-loading-icon-stub
color="dark"
label="Loading"
size="md"
size="lg"
/>
</div>

View File

@ -58,17 +58,20 @@ RSpec.describe ContainerRegistry::Migration do
describe '.capacity' do
subject { described_class.capacity }
where(:ff_1_enabled, :ff_2_enabled, :ff_5_enabled, :ff_10_enabled, :ff_25_enabled, :expected_result) do
false | false | false | false | false | 0
true | false | false | false | false | 1
false | true | false | false | false | 2
true | true | false | false | false | 2
false | false | true | false | false | 5
true | true | true | false | false | 5
false | false | false | true | false | 10
true | true | true | true | false | 10
false | false | false | false | true | 25
true | true | true | true | true | 25
where(:ff_1_enabled, :ff_2_enabled, :ff_5_enabled,
:ff_10_enabled, :ff_25_enabled, :ff_40_enabled, :expected_result) do
false | false | false | false | false | false | 0
true | false | false | false | false | false | 1
false | true | false | false | false | false | 2
true | true | false | false | false | false | 2
false | false | true | false | false | false | 5
true | true | true | false | false | false | 5
false | false | false | true | false | false | 10
true | true | true | true | false | false | 10
false | false | false | false | true | false | 25
true | true | true | true | true | false | 25
false | false | false | false | false | true | 40
true | true | true | true | true | true | 40
end
with_them do
@ -78,7 +81,8 @@ RSpec.describe ContainerRegistry::Migration do
container_registry_migration_phase2_capacity_2: ff_2_enabled,
container_registry_migration_phase2_capacity_5: ff_5_enabled,
container_registry_migration_phase2_capacity_10: ff_10_enabled,
container_registry_migration_phase2_capacity_25: ff_25_enabled
container_registry_migration_phase2_capacity_25: ff_25_enabled,
container_registry_migration_phase2_capacity_40: ff_40_enabled
)
end

View File

@ -50,6 +50,26 @@ RSpec.describe Gitlab::SidekiqMiddleware::WorkerContext::Client do
end
describe "#call" do
context 'root_caller_id' do
it 'uses caller_id of the current context' do
Gitlab::ApplicationContext.with_context(caller_id: 'CALLER') do
TestWithContextWorker.perform_async
end
job = TestWithContextWorker.jobs.last
expect(job['meta.root_caller_id']).to eq('CALLER')
end
it 'uses root_caller_id instead of caller_id of the current context' do
Gitlab::ApplicationContext.with_context(caller_id: 'CALLER', root_caller_id: 'ROOT_CALLER') do
TestWithContextWorker.perform_async
end
job = TestWithContextWorker.jobs.last
expect(job['meta.root_caller_id']).to eq('ROOT_CALLER')
end
end
it 'applies a context for jobs scheduled in batch' do
user_per_job = { 'job1' => build_stubbed(:user, username: 'user-1'),
'job2' => build_stubbed(:user, username: 'user-2') }
@ -97,7 +117,7 @@ RSpec.describe Gitlab::SidekiqMiddleware::WorkerContext::Client do
end
it 'does not set any explicit feature category for mailers', :sidekiq_mailers do
expect(Gitlab::ApplicationContext).not_to receive(:with_context)
expect(Gitlab::ApplicationContext).to receive(:with_context).with(hash_excluding(feature_category: anything))
TestMailer.test_mail.deliver_later
end

View File

@ -15,7 +15,7 @@ RSpec.describe 'Code review events' do
code_review_events = Gitlab::UsageDataCounters::HLLRedisCounter.events_for_category("code_review")
exceptions = %w[i_code_review_mr_diffs i_code_review_mr_single_file_diffs i_code_review_total_suggestions_applied i_code_review_total_suggestions_added]
exceptions = %w[i_code_review_mr_diffs i_code_review_mr_single_file_diffs i_code_review_total_suggestions_applied i_code_review_total_suggestions_added i_code_review_create_note_in_ipynb_diff i_code_review_create_note_in_ipynb_diff_mr i_code_review_create_note_in_ipynb_diff_commit]
code_review_aggregated_events += exceptions
expect(code_review_events - code_review_aggregated_events).to be_empty

View File

@ -11,11 +11,33 @@ RSpec.describe CronjobQueue do
include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
def perform
AnotherWorker.perform_async('identifier')
end
end
end
let(:another_worker) do
Class.new do
def self.name
'AnotherWorker'
end
include ApplicationWorker
# To keep track of the context that was active for certain arguments
cattr_accessor(:contexts) { {} }
def perform(identifier, *args)
self.class.contexts.merge!(identifier => Gitlab::ApplicationContext.current)
end
end
end
before do
stub_const("DummyWorker", worker)
stub_const("AnotherWorker", another_worker)
end
it 'sets the queue name of a worker' do
@ -27,7 +49,7 @@ RSpec.describe CronjobQueue do
end
it 'automatically clears project, user and namespace from the context', :aggregate_failues do
worker_context = worker.get_worker_context.to_lazy_hash.transform_values(&:call)
worker_context = worker.get_worker_context.to_lazy_hash.transform_values { |v| v.try(:call) }
expect(worker_context[:user]).to be_nil
expect(worker_context[:root_namespace]).to be_nil
@ -42,6 +64,14 @@ RSpec.describe CronjobQueue do
expect(job).to include('meta.caller_id' => 'Cronjob')
end
it 'gets root_caller_id from the cronjob' do
Sidekiq::Testing.inline! do
worker.perform_async
end
expect(AnotherWorker.contexts['identifier']).to include('meta.root_caller_id' => 'Cronjob')
end
it 'does not set the caller_id if there was already one in the context' do
Gitlab::ApplicationContext.with_context(caller_id: 'already set') do
worker.perform_async

View File

@ -106,7 +106,8 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
before do
# set capacity to 10
stub_feature_flags(
container_registry_migration_phase2_capacity_25: false
container_registry_migration_phase2_capacity_25: false,
container_registry_migration_phase2_capacity_40: false
)
# Plus 2 created above gives 9 importing repositories
@ -475,7 +476,8 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures
before do
# set capacity to 10
stub_feature_flags(
container_registry_migration_phase2_capacity_25: false
container_registry_migration_phase2_capacity_25: false,
container_registry_migration_phase2_capacity_40: false
)
# Plus 2 created above gives 9 importing repositories