diff options
| author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 21:08:17 +0000 |
|---|---|---|
| committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 21:08:17 +0000 |
| commit | 3d6aa9071097f5070c801bee13a619da0a297d07 (patch) | |
| tree | b455237758a12fefeec49c29cc8655cb63e118ff | |
| parent | abe6e7a2e7a456fa05f4ebeb28f8747a92cf59b1 (diff) | |
| download | gitlab-ce-3d6aa9071097f5070c801bee13a619da0a297d07.tar.gz | |
Add latest changes from gitlab-org/gitlab@master
37 files changed, 154 insertions, 79 deletions
diff --git a/GITLAB_SHELL_VERSION b/GITLAB_SHELL_VERSION index 72f51351fcd..d18453764c3 100644 --- a/GITLAB_SHELL_VERSION +++ b/GITLAB_SHELL_VERSION @@ -1 +1 @@ -14.4.0 +14.5.0 diff --git a/app/assets/javascripts/cycle_analytics/components/stage_table.vue b/app/assets/javascripts/cycle_analytics/components/stage_table.vue index e4236968efc..d460f764c00 100644 --- a/app/assets/javascripts/cycle_analytics/components/stage_table.vue +++ b/app/assets/javascripts/cycle_analytics/components/stage_table.vue @@ -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" diff --git a/app/assets/javascripts/design_management/components/list/item.vue b/app/assets/javascripts/design_management/components/list/item.vue index b6163491abc..3092b8554ac 100644 --- a/app/assets/javascripts/design_management/components/list/item.vue +++ b/app/assets/javascripts/design_management/components/list/item.vue @@ -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" diff --git a/app/assets/javascripts/design_management/pages/index.vue b/app/assets/javascripts/design_management/pages/index.vue index 42d5d8fb359..d3f3f9dad67 100644 --- a/app/assets/javascripts/design_management/pages/index.vue +++ b/app/assets/javascripts/design_management/pages/index.vue @@ -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> diff --git a/app/assets/javascripts/diffs/components/diff_content.vue b/app/assets/javascripts/diffs/components/diff_content.vue index 1eba12a3ae9..bfe35e9346d 100644 --- a/app/assets/javascripts/diffs/components/diff_content.vue +++ b/app/assets/javascripts/diffs/components/diff_content.vue @@ -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" /> diff --git a/app/assets/javascripts/environments/components/container.vue b/app/assets/javascripts/environments/components/container.vue index cec53869aa8..b2844ed5ad6 100644 --- a/app/assets/javascripts/environments/components/container.vue +++ b/app/assets/javascripts/environments/components/container.vue @@ -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> diff --git a/app/assets/javascripts/environments/components/environments_table.vue b/app/assets/javascripts/environments/components/environments_table.vue index 7fcd6e5fff8..895a6cf2ccb 100644 --- a/app/assets/javascripts/environments/components/environments_table.vue +++ b/app/assets/javascripts/environments/components/environments_table.vue @@ -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> diff --git a/app/assets/javascripts/error_tracking/components/error_tracking_list.vue b/app/assets/javascripts/error_tracking/components/error_tracking_list.vue index 86102fd54b1..d29d5aa0671 100644 --- a/app/assets/javascripts/error_tracking/components/error_tracking_list.vue +++ b/app/assets/javascripts/error_tracking/components/error_tracking_list.vue @@ -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> diff --git a/app/assets/javascripts/feature_flags/components/empty_state.vue b/app/assets/javascripts/feature_flags/components/empty_state.vue index a6de4972bb1..a66215cdae6 100644 --- a/app/assets/javascripts/feature_flags/components/empty_state.vue +++ b/app/assets/javascripts/feature_flags/components/empty_state.vue @@ -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" diff --git a/app/assets/javascripts/groups/components/app.vue b/app/assets/javascripts/groups/components/app.vue index e3147065d5c..2c42a331550 100644 --- a/app/assets/javascripts/groups/components/app.vue +++ b/app/assets/javascripts/groups/components/app.vue @@ -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 diff --git a/app/assets/javascripts/ide/components/ide.vue b/app/assets/javascripts/ide/components/ide.vue index 45bbf93ebc9..d589f56dd7c 100644 --- a/app/assets/javascripts/ide/components/ide.vue +++ b/app/assets/javascripts/ide/components/ide.vue @@ -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> {{ __( diff --git a/app/assets/javascripts/import_entities/import_groups/components/import_table.vue b/app/assets/javascripts/import_entities/import_groups/components/import_table.vue index bb8defedb02..6b96fa7c45c 100644 --- a/app/assets/javascripts/import_entities/import_groups/components/import_table.vue +++ b/app/assets/javascripts/import_entities/import_groups/components/import_table.vue @@ -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" diff --git a/app/assets/javascripts/import_entities/import_projects/components/import_projects_table.vue b/app/assets/javascripts/import_entities/import_projects/components/import_projects_table.vue index 0307607321e..848c7361601 100644 --- a/app/assets/javascripts/import_entities/import_projects/components/import_projects_table.vue +++ b/app/assets/javascripts/import_entities/import_projects/components/import_projects_table.vue @@ -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> diff --git a/app/assets/javascripts/integrations/overrides/components/integration_overrides.vue b/app/assets/javascripts/integrations/overrides/components/integration_overrides.vue index f2d3e6489ee..1255ed01f6d 100644 --- a/app/assets/javascripts/integrations/overrides/components/integration_overrides.vue +++ b/app/assets/javascripts/integrations/overrides/components/integration_overrides.vue @@ -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"> diff --git a/app/assets/javascripts/jira_connect/subscriptions/components/add_namespace_modal/groups_list.vue b/app/assets/javascripts/jira_connect/subscriptions/components/add_namespace_modal/groups_list.vue index 7f035dddafe..a9ec7bd971e 100644 --- a/app/assets/javascripts/jira_connect/subscriptions/components/add_namespace_modal/groups_list.vue +++ b/app/assets/javascripts/jira_connect/subscriptions/components/add_namespace_modal/groups_list.vue @@ -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"> diff --git a/app/assets/javascripts/jira_connect/subscriptions/pages/subscriptions_page.vue b/app/assets/javascripts/jira_connect/subscriptions/pages/subscriptions_page.vue index b1c1ae73e14..d7213f683d8 100644 --- a/app/assets/javascripts/jira_connect/subscriptions/pages/subscriptions_page.vue +++ b/app/assets/javascripts/jira_connect/subscriptions/pages/subscriptions_page.vue @@ -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 /> diff --git a/app/assets/javascripts/jira_import/components/jira_import_app.vue b/app/assets/javascripts/jira_import/components/jira_import_app.vue index 0f690d17da9..5e388900d2a 100644 --- a/app/assets/javascripts/jira_import/components/jira_import_app.vue +++ b/app/assets/javascripts/jira_import/components/jira_import_app.vue @@ -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" diff --git a/app/assets/javascripts/jira_import/components/jira_import_form.vue b/app/assets/javascripts/jira_import/components/jira_import_form.vue index 8a36a4d2466..4e5e9f4ade7 100644 --- a/app/assets/javascripts/jira_import/components/jira_import_form.vue +++ b/app/assets/javascripts/jira_import/components/jira_import_form.vue @@ -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" diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue index 4fb95fe635c..9541058ec2a 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue @@ -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 diff --git a/app/views/admin/identities/index.html.haml b/app/views/admin/identities/index.html.haml index a4f1ce4afc0..b4dd92bf15c 100644 --- a/app/views/admin/identities/index.html.haml +++ b/app/views/admin/identities/index.html.haml @@ -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 diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index 970e490dd72..57135c6cdfc 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -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, diff --git a/config/feature_flags/development/container_registry_migration_phase2_capacity_40.yml b/config/feature_flags/development/container_registry_migration_phase2_capacity_40.yml new file mode 100644 index 00000000000..f26ddd99607 --- /dev/null +++ b/config/feature_flags/development/container_registry_migration_phase2_capacity_40.yml @@ -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 diff --git a/config/metrics/aggregates/code_review.yml b/config/metrics/aggregates/code_review.yml index a25222b8d6b..f6ed93c650e 100644 --- a/config/metrics/aggregates/code_review.yml +++ b/config/metrics/aggregates/code_review.yml @@ -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 diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 482d5c926d1..ed1d58da07f 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -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. | diff --git a/lib/container_registry/migration.rb b/lib/container_registry/migration.rb index 8377190c83c..5daf8d7ab0c 100644 --- a/lib/container_registry/migration.rb +++ b/lib/container_registry/migration.rb @@ -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) diff --git a/lib/gitlab/application_context.rb b/lib/gitlab/application_context.rb index 6ef5a1e2cd8..3e095585b18 100644 --- a/lib/gitlab/application_context.rb +++ b/lib/gitlab/application_context.rb @@ -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) diff --git a/lib/gitlab/sidekiq_middleware/worker_context/client.rb b/lib/gitlab/sidekiq_middleware/worker_context/client.rb index 7d3925e9dec..d9797e9c7c7 100644 --- a/lib/gitlab/sidekiq_middleware/worker_context/client.rb +++ b/lib/gitlab/sidekiq_middleware/worker_context/client.rb @@ -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 diff --git a/lib/gitlab/sidekiq_middleware/worker_context/server.rb b/lib/gitlab/sidekiq_middleware/worker_context/server.rb index d026f4918c6..7c2dd80c17a 100644 --- a/lib/gitlab/sidekiq_middleware/worker_context/server.rb +++ b/lib/gitlab/sidekiq_middleware/worker_context/server.rb @@ -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 diff --git a/locale/gitlab.pot b/locale/gitlab.pot index c574db9ff8a..2503b9e7a70 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -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 "" diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb index 8f5ac62d127..ba4e8d4f9fa 100644 --- a/qa/qa/page/merge_request/show.rb +++ b/qa/qa/page/merge_request/show.rb @@ -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! diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb index 536abfa5303..ae1d3e6d383 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb @@ -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 diff --git a/spec/frontend/design_management/pages/__snapshots__/index_spec.js.snap b/spec/frontend/design_management/pages/__snapshots__/index_spec.js.snap index 243cc9d891d..be736184e60 100644 --- a/spec/frontend/design_management/pages/__snapshots__/index_spec.js.snap +++ b/spec/frontend/design_management/pages/__snapshots__/index_spec.js.snap @@ -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> diff --git a/spec/lib/container_registry/migration_spec.rb b/spec/lib/container_registry/migration_spec.rb index 81dac354b8b..e70e2175774 100644 --- a/spec/lib/container_registry/migration_spec.rb +++ b/spec/lib/container_registry/migration_spec.rb @@ -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 diff --git a/spec/lib/gitlab/sidekiq_middleware/worker_context/client_spec.rb b/spec/lib/gitlab/sidekiq_middleware/worker_context/client_spec.rb index 3baa0c6f967..821d8b8fe7b 100644 --- a/spec/lib/gitlab/sidekiq_middleware/worker_context/client_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/worker_context/client_spec.rb @@ -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 diff --git a/spec/lib/gitlab/usage_data_counters/code_review_events_spec.rb b/spec/lib/gitlab/usage_data_counters/code_review_events_spec.rb index c4a84445a01..0d45c4a4352 100644 --- a/spec/lib/gitlab/usage_data_counters/code_review_events_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/code_review_events_spec.rb @@ -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 diff --git a/spec/workers/concerns/cronjob_queue_spec.rb b/spec/workers/concerns/cronjob_queue_spec.rb index d1ad5c65ea3..0244535051f 100644 --- a/spec/workers/concerns/cronjob_queue_spec.rb +++ b/spec/workers/concerns/cronjob_queue_spec.rb @@ -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 diff --git a/spec/workers/container_registry/migration/enqueuer_worker_spec.rb b/spec/workers/container_registry/migration/enqueuer_worker_spec.rb index a57a9e3b2e8..d13d08da69b 100644 --- a/spec/workers/container_registry/migration/enqueuer_worker_spec.rb +++ b/spec/workers/container_registry/migration/enqueuer_worker_spec.rb @@ -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 |
