Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-11-09 15:09:07 +00:00
parent 963e09aecf
commit 07f3c9525c
102 changed files with 487 additions and 266 deletions

View File

@ -1317,7 +1317,6 @@ Layout/ArgumentAlignment:
- 'lib/gitlab/github_gists_import/importer/gist_importer.rb'
- 'lib/gitlab/github_import/importer/issue_importer.rb'
- 'lib/gitlab/github_import/importer/pull_request_importer.rb'
- 'lib/gitlab/github_import/parallel_scheduling.rb'
- 'lib/gitlab/github_import/representation/issue.rb'
- 'lib/gitlab/github_import/representation/issue_event.rb'
- 'lib/gitlab/github_import/representation/note.rb'
@ -1545,17 +1544,6 @@ Layout/ArgumentAlignment:
- 'spec/requests/api/graphql/mutations/merge_requests/set_milestone_spec.rb'
- 'spec/requests/api/graphql/mutations/merge_requests/set_reviewers_spec.rb'
- 'spec/requests/api/graphql/mutations/metrics/dashboard/annotations/create_spec.rb'
- 'spec/requests/api/graphql/mutations/notes/update/image_diff_note_spec.rb'
- 'spec/requests/api/graphql/mutations/packages/cleanup/policy/update_spec.rb'
- 'spec/requests/api/graphql/mutations/release_asset_links/update_spec.rb'
- 'spec/requests/api/graphql/mutations/snippets/create_spec.rb'
- 'spec/requests/api/graphql/mutations/snippets/destroy_spec.rb'
- 'spec/requests/api/graphql/mutations/snippets/mark_as_spam_spec.rb'
- 'spec/requests/api/graphql/mutations/snippets/update_spec.rb'
- 'spec/requests/api/graphql/mutations/todos/mark_all_done_spec.rb'
- 'spec/requests/api/graphql/mutations/todos/mark_done_spec.rb'
- 'spec/requests/api/graphql/mutations/todos/restore_many_spec.rb'
- 'spec/requests/api/graphql/mutations/todos/restore_spec.rb'
- 'spec/requests/api/graphql/packages/conan_spec.rb'
- 'spec/requests/api/graphql/tasks/task_completion_status_spec.rb'
- 'spec/requests/api/graphql/user_query_spec.rb'

View File

@ -2657,7 +2657,6 @@ Layout/LineLength:
- 'lib/gitlab/gitaly_client/server_service.rb'
- 'lib/gitlab/github_import.rb'
- 'lib/gitlab/github_import/importer/pull_request_importer.rb'
- 'lib/gitlab/github_import/parallel_scheduling.rb'
- 'lib/gitlab/gl_repository.rb'
- 'lib/gitlab/global_id/deprecations.rb'
- 'lib/gitlab/golang.rb'

View File

@ -256,7 +256,6 @@ Style/FormatString:
- 'lib/gitlab/github_import/issuable_finder.rb'
- 'lib/gitlab/github_import/object_counter.rb'
- 'lib/gitlab/github_import/page_counter.rb'
- 'lib/gitlab/github_import/parallel_scheduling.rb'
- 'lib/gitlab/import_export/base/relation_factory.rb'
- 'lib/gitlab/import_export/error.rb'
- 'lib/gitlab/import_export/snippet_repo_restorer.rb'

View File

@ -484,7 +484,7 @@ group :test do
gem 'capybara', '~> 3.39', '>= 3.39.2' # rubocop:todo Gemfile/MissingFeatureCategory
gem 'capybara-screenshot', '~> 1.0.26' # rubocop:todo Gemfile/MissingFeatureCategory
gem 'selenium-webdriver', '~> 4.14' # rubocop:todo Gemfile/MissingFeatureCategory
gem 'selenium-webdriver', '~> 4.15' # rubocop:todo Gemfile/MissingFeatureCategory
gem 'graphlyte', '~> 1.0.0' # rubocop:todo Gemfile/MissingFeatureCategory
@ -501,7 +501,7 @@ group :test do
# Moved in `test` because https://gitlab.com/gitlab-org/gitlab/-/issues/217527
gem 'derailed_benchmarks', require: false # rubocop:todo Gemfile/MissingFeatureCategory
gem 'gitlab_quality-test_tooling', '~> 1.4.0', require: false # rubocop:todo Gemfile/MissingFeatureCategory
gem 'gitlab_quality-test_tooling', '~> 1.5.0', require: false # rubocop:todo Gemfile/MissingFeatureCategory
end
gem 'octokit', '~> 6.0' # rubocop:todo Gemfile/MissingFeatureCategory

View File

@ -221,7 +221,7 @@
{"name":"gitlab-styles","version":"10.1.0","platform":"ruby","checksum":"f42745f5397d042fe24cf2d0eb56c995b37f9f43d8fb79b834d197a1cafdc84a"},
{"name":"gitlab_chronic_duration","version":"0.12.0","platform":"ruby","checksum":"0d766944d415b5c831f176871ee8625783fc0c5bfbef2d79a3a616f207ffc16d"},
{"name":"gitlab_omniauth-ldap","version":"2.2.0","platform":"ruby","checksum":"bb4d20acb3b123ed654a8f6a47d3fac673ece7ed0b6992edb92dca14bad2838c"},
{"name":"gitlab_quality-test_tooling","version":"1.4.0","platform":"ruby","checksum":"0fdfb574138ac9228ccce5fc40687aa81dcb8158900ca26982e15c14797959cf"},
{"name":"gitlab_quality-test_tooling","version":"1.5.0","platform":"ruby","checksum":"7ce31d48462290f39c2c9bf8ae99b39b31e3a5eba0546bac058cdb6f7f88afd3"},
{"name":"globalid","version":"1.1.0","platform":"ruby","checksum":"b337e1746f0c8cb0a6c918234b03a1ddeb4966206ce288fbb57779f59b2d154f"},
{"name":"gon","version":"6.4.0","platform":"ruby","checksum":"e3a618d659392890f1aa7db420f17c75fd7d35aeb5f8fe003697d02c4b88d2f0"},
{"name":"google-apis-androidpublisher_v3","version":"0.34.0","platform":"ruby","checksum":"d7e1d7dd92f79c498fe2082222a1740d788e022e660c135564b3fd299cab5425"},
@ -579,7 +579,7 @@
{"name":"sawyer","version":"0.9.2","platform":"ruby","checksum":"fa3a72d62a4525517b18857ddb78926aab3424de0129be6772a8e2ba240e7aca"},
{"name":"sd_notify","version":"0.1.1","platform":"ruby","checksum":"cbc7ac6caa7cedd26b30a72b5eeb6f36050dc0752df263452ea24fb5a4ad3131"},
{"name":"seed-fu","version":"2.3.7","platform":"ruby","checksum":"f19673443e9af799b730e3d4eca6a89b39e5a36825015dffd00d02ea3365cf74"},
{"name":"selenium-webdriver","version":"4.14.0","platform":"ruby","checksum":"55726f81021d3f085ed9fcd318486b7ba90155598bb9e1fde7e4deeefe139d24"},
{"name":"selenium-webdriver","version":"4.15.0","platform":"ruby","checksum":"36134e883c4df98f1b7e8519a3753c77427b74621147f8245aa6cac306d52297"},
{"name":"semver_dialects","version":"1.2.1","platform":"ruby","checksum":"60a1f67659f79c51a667e8858ec9b089c1e4ce4f6d2a0f0b4ac101916946eb23"},
{"name":"sentry-rails","version":"5.8.0","platform":"ruby","checksum":"c11b2d909de2c2bfda793c45f64180fd784d54c46886338b683ee3f8efa7731b"},
{"name":"sentry-raven","version":"3.1.2","platform":"ruby","checksum":"103d3b122958810d34898ce2e705bcf549ddb9d855a70ce9a3970ee2484f364a"},

View File

@ -700,7 +700,7 @@ GEM
omniauth (>= 1.3, < 3)
pyu-ruby-sasl (>= 0.0.3.3, < 0.1)
rubyntlm (~> 0.5)
gitlab_quality-test_tooling (1.4.0)
gitlab_quality-test_tooling (1.5.0)
activesupport (>= 6.1, < 7.2)
amatch (~> 0.4.1)
gitlab (~> 4.19)
@ -1488,7 +1488,7 @@ GEM
seed-fu (2.3.7)
activerecord (>= 3.1)
activesupport (>= 3.1)
selenium-webdriver (4.14.0)
selenium-webdriver (4.15.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
@ -1866,7 +1866,7 @@ DEPENDENCIES
gitlab-utils!
gitlab_chronic_duration (~> 0.12)
gitlab_omniauth-ldap (~> 2.2.0)
gitlab_quality-test_tooling (~> 1.4.0)
gitlab_quality-test_tooling (~> 1.5.0)
gon (~> 6.4.0)
google-apis-androidpublisher_v3 (~> 0.34.0)
google-apis-cloudbilling_v1 (~> 0.21.0)
@ -2026,7 +2026,7 @@ DEPENDENCIES
sassc-rails (~> 2.1.0)
sd_notify (~> 0.1.0)
seed-fu (~> 2.3.7)
selenium-webdriver (~> 4.14)
selenium-webdriver (~> 4.15)
semver_dialects (~> 1.2.1)
sentry-rails (~> 5.8.0)
sentry-raven (~> 3.1)

View File

@ -907,7 +907,7 @@ export default {
v-if="issuesDrawerEnabled"
:open="isIssuableSelected"
header-height="calc(var(--top-bar-height) + var(--performance-bar-height))"
class="gl-w-40p gl-xs-w-full"
class="gl-w-full gl-sm-w-40p"
@close="activeIssuable = null"
>
<template #title>

View File

@ -108,15 +108,27 @@ timeago.register(`${timeagoLanguageCode}-remaining`, memoizedLocaleRemaining());
timeago.register(`${timeagoLanguageCode}-duration`, memoizedLocaleDuration());
const setupAbsoluteFormatters = () => {
const cache = {};
let cache = {};
// Intl.DateTimeFormat options (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options)
// For hourCycle please check https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle
const hourCycle = [undefined, 'h12', 'h23'];
const formats = {
[DATE_WITH_TIME_FORMAT]: () => ({ dateStyle: 'medium', timeStyle: 'short' }),
[DATE_WITH_TIME_FORMAT]: () => ({
dateStyle: 'medium',
timeStyle: 'short',
hourCycle: hourCycle[window.gon?.time_display_format || 0],
}),
[DATE_ONLY_FORMAT]: () => ({ dateStyle: 'medium' }),
};
return (formatName = DEFAULT_DATE_TIME_FORMAT) => {
if (cache.time_display_format !== window.gon?.time_display_format) {
cache = {
time_display_format: window.gon?.time_display_format,
};
}
if (cache[formatName]) {
return cache[formatName];
}

View File

@ -1,7 +1,8 @@
import $ from 'jquery';
import { setCookie } from '~/lib/utils/common_utils';
import UserCallout from '~/user_callout';
import { initProfileTabs } from '~/profile';
import { initProfileTabs, initUserAchievements } from '~/profile';
import { initUserActionsApp } from '~/users/profile/actions';
import UserTabs from './user_tabs';
function initUserProfile(action) {
@ -27,4 +28,6 @@ function initUserProfile(action) {
const page = $('body').attr('data-page');
const action = page.split(':')[1];
initUserProfile(action);
initUserAchievements();
initUserActionsApp();
new UserCallout(); // eslint-disable-line no-new

View File

@ -1,5 +0,0 @@
import { initUserAchievements } from '~/profile';
import { initUserActionsApp } from '~/users/profile/actions';
initUserAchievements();
initUserActionsApp();

View File

@ -63,7 +63,7 @@ const Template = ({
apolloProvider,
check: {
identifier: 'need_rebase',
result: failed ? 'failed' : 'passed',
status: failed ? 'failed' : 'passed',
},
mr: { onlyAllowMergeIfPipelineSucceeds },
canCreatePipelineInTargetProject,

View File

@ -10,3 +10,5 @@
// Gitlab UI util classes
@import '@gitlab/ui/src/scss/utilities';
@import 'tmp_utilities';

View File

@ -0,0 +1,32 @@
/**
* DISCLAIMER
* This is a temporary stylesheet meant to assist in migrating away from desktop-first responsive
* CSS utilities.
* DO NOT add utils in here unless you are actively taking part in in the migration.
* We needed this new file for temporary utils to be defined _after_ the main, non-responsive
* GitLab UI util.
* This file is scheduled to be removed by the end of 2023.
*/
.gl-sm-w-25p {
@include gl-media-breakpoint-up(sm) {
width: 25%;
}
}
.gl-sm-w-30p {
@include gl-media-breakpoint-up(sm) {
width: 30%;
}
}
.gl-sm-w-40p {
@include gl-media-breakpoint-up(sm) {
width: 40%;
}
}
.gl-sm-w-75p {
@include gl-media-breakpoint-up(sm) {
width: 75%;
}
}

View File

@ -48,6 +48,7 @@ class Profiles::PreferencesController < Profiles::ApplicationController
:first_day_of_week,
:preferred_language,
:time_display_relative,
:time_display_format,
:show_whitespace_in_diffs,
:view_diffs_file_by_file,
:tab_width,

View File

@ -59,6 +59,10 @@ module PreferencesHelper
]
end
def time_display_format_choices
UserPreference.time_display_formats
end
def first_day_of_week_choices_with_default
first_day_of_week_choices.unshift([_('System default (%{default})') % { default: default_first_day_of_week }, nil])
end

View File

@ -56,9 +56,14 @@ module Ci
private
# These columns are denormalized from the `projects` table. We first sync these
# columns when the catalog resource record is created. Then any updates to the
# `projects` columns will be synced to the `catalog_resources` table by a worker
# (to be implemented in https://gitlab.com/gitlab-org/gitlab/-/issues/429376.)
def sync_with_project
self.name = project.name
self.description = project.description
self.visibility_level = project.visibility_level
end
end
end

View File

@ -142,7 +142,9 @@ class Project < ApplicationRecord
after_create :set_timestamps_for_create
after_create :check_repository_absence!
after_update :update_catalog_resource, if: -> { (saved_change_to_name? || saved_change_to_description?) && catalog_resource }
# TODO: Remove this callback after background syncing is implemented. See https://gitlab.com/gitlab-org/gitlab/-/issues/429376.
after_update :update_catalog_resource,
if: -> { (saved_change_to_name? || saved_change_to_description? || saved_change_to_visibility_level?) && catalog_resource }
before_destroy :remove_private_deploy_keys
after_destroy :remove_exports

View File

@ -174,7 +174,7 @@ class Upload < ApplicationRecord
end
def update_project_statistics
ProjectCacheWorker.perform_async(model_id, [], [:uploads_size])
ProjectCacheWorker.perform_async(model_id, [], ['uploads_size'])
end
end

View File

@ -391,6 +391,7 @@ class User < MainClusterwide::ApplicationRecord
:first_day_of_week, :first_day_of_week=,
:timezone, :timezone=,
:time_display_relative, :time_display_relative=,
:time_display_format, :time_display_format=,
:show_whitespace_in_diffs, :show_whitespace_in_diffs=,
:view_diffs_file_by_file, :view_diffs_file_by_file=,
:pass_user_identities_to_ci_jwt, :pass_user_identities_to_ci_jwt=,

View File

@ -7,6 +7,7 @@ class UserPreference < MainClusterwide::ApplicationRecord
# enum options with same name for multiple fields, also it creates
# extra methods that aren't really needed here.
NOTES_FILTERS = { all_notes: 0, only_comments: 1, only_activity: 2 }.freeze
TIME_DISPLAY_FORMATS = { system: 0, non_iso_format: 1, iso_format: 2 }.freeze
belongs_to :user
@ -27,12 +28,15 @@ class UserPreference < MainClusterwide::ApplicationRecord
validates :pinned_nav_items, json_schema: { filename: 'pinned_nav_items' }
validates :time_display_format, inclusion: { in: TIME_DISPLAY_FORMATS.values }, presence: true
ignore_columns :experience_level, remove_with: '14.10', remove_after: '2021-03-22'
# 2023-06-22 is after 16.1 release and during 16.2 release https://docs.gitlab.com/ee/development/database/avoiding_downtime_in_migrations.html#ignoring-the-column-release-m
ignore_columns :use_legacy_web_ide, remove_with: '16.2', remove_after: '2023-06-22'
attribute :tab_width, default: -> { Gitlab::TabWidth::DEFAULT }
attribute :time_display_relative, default: true
attribute :time_display_format, default: 0
attribute :render_whitespace_in_code, default: false
attribute :project_shortcut_buttons, default: true
attribute :keyboard_shortcuts_enabled, default: true
@ -80,6 +84,16 @@ class UserPreference < MainClusterwide::ApplicationRecord
end
end
class << self
def time_display_formats
{
s_('Time Display|System') => TIME_DISPLAY_FORMATS[:system],
s_('Time Display|12-hour: 2:34 PM') => TIME_DISPLAY_FORMATS[:non_iso_format],
s_('Time Display|24-hour: 14:34') => TIME_DISPLAY_FORMATS[:iso_format]
}
end
end
def time_display_relative
value = read_attribute(:time_display_relative)
return value unless value.nil?

View File

@ -58,11 +58,11 @@ module Projects
def validate!
unless valid_visibility_level_change?(project, project.visibility_attribute_value(params))
raise ValidationError, s_('UpdateProject|New visibility level not allowed!')
raise_validation_error(s_('UpdateProject|New visibility level not allowed!'))
end
if renaming_project_with_container_registry_tags?
raise ValidationError, s_('UpdateProject|Cannot rename project because it contains container registry tags!')
raise_validation_error(s_('UpdateProject|Cannot rename project because it contains container registry tags!'))
end
validate_default_branch_change
@ -78,16 +78,17 @@ module Projects
params[:previous_default_branch] = previous_default_branch
if !project.root_ref?(new_default_branch) && has_custom_head_branch?
raise ValidationError,
raise_validation_error(
format(
s_("UpdateProject|Could not set the default branch. Do you have a branch named 'HEAD' in your repository? (%{linkStart}How do I fix this?%{linkEnd})"),
linkStart: ambiguous_head_documentation_link, linkEnd: '</a>'
).html_safe
)
end
after_default_branch_change(previous_default_branch)
else
raise ValidationError, s_("UpdateProject|Could not set the default branch")
raise_validation_error(s_("UpdateProject|Could not set the default branch"))
end
end
@ -144,6 +145,10 @@ module Projects
AfterRenameService.new(project, path_before: project.path_before_last_save, full_path_before: project.full_path_before_last_save)
end
def raise_validation_error(message)
raise ValidationError, message
end
def update_failed!
model_errors = project.errors.full_messages.to_sentence
error_message = model_errors.presence || s_('UpdateProject|Project could not be updated!')

View File

@ -113,7 +113,7 @@ class WebHookService
"recursion_detection_request_uuid" => Gitlab::WebHooks::RecursionDetection::UUID.instance.request_uuid
}.compact
WebHookWorker.perform_async(hook.id, data.deep_stringify_keys, hook_name, params)
WebHookWorker.perform_async(hook.id, data.deep_stringify_keys, hook_name.to_s, params)
end
end
@ -170,7 +170,9 @@ class WebHookService
def queue_log_execution_with_retry(log_data, category)
retried = false
begin
::WebHooks::LogExecutionWorker.perform_async(hook.id, log_data.deep_stringify_keys, category, uniqueness_token)
::WebHooks::LogExecutionWorker.perform_async(
hook.id, log_data.deep_stringify_keys, category.to_s, uniqueness_token.to_s
)
rescue Gitlab::SidekiqMiddleware::SizeLimiter::ExceedLimitError
raise if retried

View File

@ -5,7 +5,7 @@
= render 'deprecation_alert'
.gl-md-display-flex.gl-mt-3
.gl-w-quarter.gl-xs-w-full.gl-flex-shrink-0.gl-md-mr-5
.gl-w-full.gl-sm-w-25p.gl-flex-shrink-0.gl-md-mr-5
= render 'sidebar', is_connect_page: true
.gl-w-full
#js-cluster-new

View File

@ -5,7 +5,7 @@
= render_gcp_signup_offer
.gl-md-display-flex.gl-mt-3
.gl-w-quarter.gl-xs-w-full.gl-flex-shrink-0.gl-md-mr-5
.gl-w-full.gl-sm-w-25p.gl-flex-shrink-0.gl-md-mr-5
= render 'sidebar', is_connect_page: false
.gl-w-full
= render 'clusters/clusters/cloud_providers/cloud_provider_selector'

View File

@ -1,5 +1,5 @@
- page_title _('Invitation declined')
.decline-page.gl-display-flex.gl-flex-direction-column.gl-mx-auto{ class: 'gl-xs-w-full!' }
.decline-page.gl-display-flex.gl-flex-direction-column.gl-mx-auto.gl-w-full.gl-sm-w-auto
.gl-align-self-center.gl-mb-4.gl-mt-7.gl-sm-mt-0= sprite_icon('check-circle', size: 48, css_class: 'gl-text-green-400')
%h2.gl-font-size-h2= _('You successfully declined the invitation')
%p

View File

@ -31,7 +31,7 @@
%h1.mb-3.gl-font-size-h2
= brand_title
.mb-3
.gl-w-half.gl-xs-w-full.gl-ml-auto.gl-mr-auto.bar
.gl-w-full.gl-sm-w-half.gl-ml-auto.gl-mr-auto.bar
= yield
= render 'devise/shared/footer'

View File

@ -155,6 +155,12 @@
= f.gitlab_ui_checkbox_component :time_display_relative,
s_('Preferences|Use relative times'),
help_text: s_('Preferences|For example: 30 minutes ago.')
.form-group
= f.label :time_display_format, class: 'label-bold' do
= s_('Preferences|Time format')
- time_display_format_choices.each_entry do |time_display_format_option|
.gl-mb-4
= f.gitlab_ui_radio_component :time_display_format, time_display_format_option[1], time_display_format_option[0]
.settings-section.js-preferences-form.js-search-settings-section#enabled_following
.settings-sticky-header
.settings-sticky-header-inner

View File

@ -52,8 +52,7 @@ module Gitlab
job_delay = client.rate_limit_resets_in + calculate_job_delay(enqueued_job_counter)
self.class
.perform_in(job_delay, project.id, hash, notify_key)
self.class.perform_in(job_delay, project.id, hash.deep_stringify_keys, notify_key.to_s)
end
end
end

View File

@ -50,8 +50,8 @@ module Gitlab
def move_to_next_stage(project, waiters = {})
AdvanceStageWorker.perform_async(
project.id,
waiters,
:protected_branches
waiters.deep_stringify_keys,
'protected_branches'
)
end
end

View File

@ -43,7 +43,7 @@ module Gitlab
def move_to_next_stage(project, waiters = {})
AdvanceStageWorker.perform_async(
project.id, waiters, :pull_requests_merged_by
project.id, waiters.deep_stringify_keys, 'pull_requests_merged_by'
)
end
end

View File

@ -32,7 +32,7 @@ module Gitlab
end
def move_to_next_stage(project, waiters = {})
AdvanceStageWorker.perform_async(project.id, waiters, :notes)
AdvanceStageWorker.perform_async(project.id, waiters.deep_stringify_keys, 'notes')
end
end
end

View File

@ -22,7 +22,7 @@ module Gitlab
hash[waiter.key] = waiter.jobs_remaining
end
AdvanceStageWorker.perform_async(project.id, waiters, :issue_events)
AdvanceStageWorker.perform_async(project.id, waiters.deep_stringify_keys, 'issue_events')
end
# The importers to run in this stage. Issues can't be imported earlier

View File

@ -33,7 +33,7 @@ module Gitlab
AdvanceStageWorker.perform_async(
project.id,
{ waiter.key => waiter.jobs_remaining },
:finish
'finish'
)
end
end

View File

@ -22,7 +22,7 @@ module Gitlab
hash[waiter.key] = waiter.jobs_remaining
end
AdvanceStageWorker.perform_async(project.id, waiters, :attachments)
AdvanceStageWorker.perform_async(project.id, waiters.deep_stringify_keys, 'attachments')
end
def importers(project)

View File

@ -22,7 +22,7 @@ module Gitlab
AdvanceStageWorker.perform_async(
project.id,
{ waiter.key => waiter.jobs_remaining },
:lfs_objects
'lfs_objects'
)
end
end

View File

@ -23,7 +23,7 @@ module Gitlab
AdvanceStageWorker.perform_async(
project.id,
{ waiter.key => waiter.jobs_remaining },
:pull_request_review_requests
'pull_request_review_requests'
)
end
end

View File

@ -23,7 +23,7 @@ module Gitlab
AdvanceStageWorker.perform_async(
project.id,
{ waiter.key => waiter.jobs_remaining },
:pull_request_reviews
'pull_request_reviews'
)
end
end

View File

@ -23,7 +23,7 @@ module Gitlab
AdvanceStageWorker.perform_async(
project.id,
{ waiter.key => waiter.jobs_remaining },
:issues_and_diff_notes
'issues_and_diff_notes'
)
end
end

View File

@ -30,7 +30,7 @@ module Gitlab
AdvanceStageWorker.perform_async(
project.id,
{ waiter.key => waiter.jobs_remaining },
:collaborators
'collaborators'
)
end

View File

@ -19,7 +19,7 @@ module Gitlab
# completed.
# timeout_timer - Time the sidekiq worker was first initiated with the current job_count
# previous_job_count - Number of jobs remaining on last invocation of this worker
def perform(project_id, waiters, next_stage, timeout_timer = Time.zone.now, previous_job_count = nil)
def perform(project_id, waiters, next_stage, timeout_timer = Time.zone.now.to_s, previous_job_count = nil)
import_state_jid = find_import_state_jid(project_id)
# If the import state is nil the project may have been deleted or the import
@ -45,7 +45,9 @@ module Gitlab
handle_timeout(import_state_jid, next_stage, project_id, new_waiters, new_job_count)
else
self.class.perform_in(INTERVAL, project_id, new_waiters, next_stage, timeout_timer, previous_job_count)
self.class.perform_in(INTERVAL,
project_id, new_waiters.deep_stringify_keys, next_stage.to_s, timeout_timer.to_s, previous_job_count
)
end
end

View File

@ -0,0 +1,13 @@
# frozen_string_literal: true
class AddVisibilityLevelToCatalogResources < Gitlab::Database::Migration[2.2]
milestone '16.6'
enable_lock_retries!
def change
# This column must match the settings of `visibility_level` in the `projects` table.
# Backfill will be done as part of https://gitlab.com/gitlab-org/gitlab/-/issues/429056.
add_column :catalog_resources, :visibility_level, :integer, default: 0, null: false
end
end

View File

@ -0,0 +1,10 @@
# frozen_string_literal: true
class AddDisplayTimeFormatPreference < Gitlab::Database::Migration[2.2]
milestone '16.6'
enable_lock_retries!
def change
add_column :user_preferences, :time_display_format, :integer, limit: 2, default: 0, null: false
end
end

View File

@ -0,0 +1 @@
c049aa4242cf88bb418e3285de83cf837e6855a709d68970c2f460a7e86bbf26

View File

@ -0,0 +1 @@
6798b462ec86a98c9f901ba10f6c8b904295091ff9aae48b76289699534f39c4

View File

@ -13479,7 +13479,8 @@ CREATE TABLE catalog_resources (
state smallint DEFAULT 0 NOT NULL,
latest_released_at timestamp with time zone,
name character varying,
description text
description text,
visibility_level integer DEFAULT 0 NOT NULL
);
CREATE SEQUENCE catalog_resources_id_seq
@ -24496,6 +24497,7 @@ CREATE TABLE user_preferences (
project_shortcut_buttons boolean DEFAULT true NOT NULL,
enabled_zoekt boolean DEFAULT true NOT NULL,
keyboard_shortcuts_enabled boolean DEFAULT true NOT NULL,
time_display_format smallint DEFAULT 0 NOT NULL,
CONSTRAINT check_89bf269f41 CHECK ((char_length(diffs_deletion_color) <= 7)),
CONSTRAINT check_d07ccd35f7 CHECK ((char_length(diffs_addition_color) <= 7))
);

View File

@ -1272,7 +1272,7 @@ Gitaly Cluster [does not support snapshot backups](../gitaly/index.md#snapshot-b
When considering using file system data transfer or snapshots:
- Don't use these methods to migrate from one operating system to another. The operating systems of the source and destination should be as similar as possible. For example,
don't use these methods to migrate from Ubuntu to Fedora.
don't use these methods to migrate from Ubuntu to RHEL.
- Data consistency is very important. You should stop GitLab with `sudo gitlab-ctl stop` before taking doing a file system transfer (with `rsync`, for example) or taking a
snapshot.

View File

@ -268,6 +268,22 @@ To use exact times on the GitLab UI:
1. Clear the **Use relative times** checkbox.
1. Select **Save changes**.
### Customize time format
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15206) in GitLab 16.6.
You can customize the format used to display times of activities on your group and project overview pages and user profiles. You can display times as:
- 12 hour format. For example: `2:34 PM`.
- 24 hour format. For example: `14:34`.
To customize the time format:
1. On the left sidebar, select your avatar.
1. Select **Preferences** > **Time preferences**.
1. In **Time format**, select either the **12-hour** or **24-hour** option.
1. Select **Save changes**.
## User identities in CI job JSON web tokens
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/387537) in GitLab 16.0.

View File

@ -11,7 +11,7 @@ type: reference, concepts
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/320783) in GitLab 14.1.
> - `failed` status [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/329636) in GitLab 14.9.
> - `pending` status [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/413723) in GitLab 16.5
> - Timeout interval of two minutes for `pending` status checks [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/388725) in GitLab 16.5.
> - Timeout interval of two minutes for `pending` status checks [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/388725) in GitLab 16.6.
Status checks are API calls to external systems that request the status of an external requirement.

View File

@ -15,7 +15,7 @@ module Gitlab
def calculate_job_delay(job_index)
multiplier = (job_index / parallel_import_batch[:size])
(multiplier * parallel_import_batch[:delay]) + 1.second
(multiplier * parallel_import_batch[:delay]).to_i + 1
end
end
end

View File

@ -6,7 +6,7 @@ module Gitlab
include JobDelayCalculator
attr_reader :project, :client, :page_counter, :already_imported_cache_key,
:job_waiter_cache_key, :job_waiter_remaining_cache_key
:job_waiter_cache_key, :job_waiter_remaining_cache_key
# The base cache key to use for tracking already imported objects.
ALREADY_IMPORTED_CACHE_KEY =
@ -26,12 +26,11 @@ module Gitlab
@client = client
@parallel = parallel
@page_counter = PageCounter.new(project, collection_method)
@already_imported_cache_key = ALREADY_IMPORTED_CACHE_KEY %
{ project: project.id, collection: collection_method }
@job_waiter_cache_key = JOB_WAITER_CACHE_KEY %
{ project: project.id, collection: collection_method }
@job_waiter_remaining_cache_key = JOB_WAITER_REMAINING_CACHE_KEY %
{ project: project.id, collection: collection_method }
@already_imported_cache_key = format(ALREADY_IMPORTED_CACHE_KEY, project: project.id,
collection: collection_method)
@job_waiter_cache_key = format(JOB_WAITER_CACHE_KEY, project: project.id, collection: collection_method)
@job_waiter_remaining_cache_key = format(JOB_WAITER_REMAINING_CACHE_KEY, project: project.id,
collection: collection_method)
end
def parallel?
@ -57,7 +56,8 @@ module Gitlab
# still scheduling duplicates while. Since all work has already been
# completed those jobs will just cycle through any remaining pages while
# not scheduling anything.
Gitlab::Cache::Import::Caching.expire(already_imported_cache_key, Gitlab::Cache::Import::Caching::SHORTER_TIMEOUT)
Gitlab::Cache::Import::Caching.expire(already_imported_cache_key,
Gitlab::Cache::Import::Caching::SHORTER_TIMEOUT)
info(project.id, message: "importer finished")
retval
@ -97,7 +97,7 @@ module Gitlab
repr = object_representation(object)
job_delay = calculate_job_delay(enqueued_job_counter)
sidekiq_worker_class.perform_in(job_delay, project.id, repr.to_hash, job_waiter.key)
sidekiq_worker_class.perform_in(job_delay, project.id, repr.to_hash.deep_stringify_keys, job_waiter.key.to_s)
enqueued_job_counter += 1
job_waiter.jobs_remaining = Gitlab::Cache::Import::Caching.increment(job_waiter_remaining_cache_key)

View File

@ -16,11 +16,15 @@ module Gitlab
hash
end
# This method allow objects to be safely passed directly to Sidekiq without errors.
# It returns JSON datatypes: string, integer, float, boolean, null(nil), array and hash.
def convert_value_for_to_hash(value)
if value.is_a?(Array)
value.map { |v| convert_value_for_to_hash(v) }
elsif value.respond_to?(:to_hash)
value.to_hash
elsif value.respond_to?(:strftime) || value.is_a?(Symbol)
value.to_s
else
value
end

View File

@ -50,6 +50,7 @@ module Gitlab
gon.suggested_label_colors = LabelsHelper.suggested_colors
gon.first_day_of_week = current_user&.first_day_of_week || Gitlab::CurrentSettings.first_day_of_week
gon.time_display_relative = true
gon.time_display_format = 0
gon.ee = Gitlab.ee?
gon.jh = Gitlab.jh?
gon.dot_com = Gitlab.com?
@ -67,6 +68,7 @@ module Gitlab
gon.current_user_fullname = current_user.name
gon.current_user_avatar_url = current_user.avatar_url
gon.time_display_relative = current_user.time_display_relative
gon.time_display_format = current_user.time_display_format
end
# Initialize gon.features with any flags that should be

View File

@ -36134,6 +36134,9 @@ msgstr ""
msgid "Preferences|This feature is experimental and translations are not yet complete."
msgstr ""
msgid "Preferences|Time format"
msgstr ""
msgid "Preferences|Time preferences"
msgstr ""
@ -49554,6 +49557,15 @@ msgstr ""
msgid "Time (in hours) that users are allowed to skip forced configuration of two-factor authentication."
msgstr ""
msgid "Time Display|12-hour: 2:34 PM"
msgstr ""
msgid "Time Display|24-hour: 14:34"
msgstr ""
msgid "Time Display|System"
msgstr ""
msgid "Time based: Yes"
msgstr ""
@ -51433,6 +51445,9 @@ msgstr ""
msgid "UpdateProject|Pruning unreachable objects can lead to repository corruption."
msgstr ""
msgid "UpdateProject|Updating default branch is blocked by security policy"
msgstr ""
msgid "UpdateRepositoryStorage|Timeout waiting for %{type} repository pushes"
msgstr ""

View File

@ -160,5 +160,24 @@ describe('TimeAgo utils', () => {
);
},
);
describe('With User Setting Time Format', () => {
it.each`
timeDisplayFormat | display | text
${0} | ${'System'} | ${'Feb 18, 2020, 10:22 PM'}
${1} | ${'12-hour'} | ${'Feb 18, 2020, 10:22 PM'}
${2} | ${'24-hour'} | ${'Feb 18, 2020, 22:22'}
`(`'$display' renders as '$text'`, ({ timeDisplayFormat, text }) => {
gon.time_display_relative = false;
gon.time_display_format = timeDisplayFormat;
const element = document.querySelector('time');
localTimeAgo([element]);
jest.runAllTimers();
expect(element.innerText).toBe(text);
});
});
});
});

View File

@ -71,6 +71,16 @@ RSpec.describe PreferencesHelper do
end
end
describe '#time_display_format_choices_with_default' do
it 'returns choices' do
expect(helper.time_display_format_choices).to eq({
"12-hour: 2:34 PM" => 1,
"24-hour: 14:34" => 2,
"System" => 0
})
end
end
describe '#user_application_theme' do
context 'with a user' do
it "returns user's theme's css_class" do

View File

@ -82,7 +82,7 @@ RSpec.describe Gitlab::GithubImport::Importer::CollaboratorsImporter, feature_ca
it 'imports each collaborator in parallel' do
expect(Gitlab::GithubImport::ImportCollaboratorWorker).to receive(:perform_in)
.with(1.second, project.id, an_instance_of(Hash), an_instance_of(String))
.with(1, project.id, an_instance_of(Hash), an_instance_of(String))
waiter = importer.parallel_import

View File

@ -98,7 +98,7 @@ RSpec.describe Gitlab::GithubImport::Importer::DiffNotesImporter, feature_catego
.and_yield(github_comment)
expect(Gitlab::GithubImport::ImportDiffNoteWorker).to receive(:perform_in)
.with(1.second, project.id, an_instance_of(Hash), an_instance_of(String))
.with(1, project.id, an_instance_of(Hash), an_instance_of(String))
waiter = importer.parallel_import

View File

@ -78,7 +78,7 @@ RSpec.describe Gitlab::GithubImport::Importer::IssueEventsImporter, feature_cate
allow(importer).to receive(:each_object_to_import).and_yield(issue_event)
expect(Gitlab::GithubImport::ImportIssueEventWorker).to receive(:perform_in).with(
1.second, project.id, an_instance_of(Hash), an_instance_of(String)
1, project.id, an_instance_of(Hash), an_instance_of(String)
)
waiter = importer.parallel_import

View File

@ -92,7 +92,7 @@ RSpec.describe Gitlab::GithubImport::Importer::IssuesImporter, feature_category:
expect(Gitlab::GithubImport::ImportIssueWorker)
.to receive(:perform_in)
.with(1.second, project.id, an_instance_of(Hash), an_instance_of(String))
.with(1, project.id, an_instance_of(Hash), an_instance_of(String))
waiter = importer.parallel_import

View File

@ -119,7 +119,7 @@ RSpec.describe Gitlab::GithubImport::Importer::LfsObjectsImporter, feature_categ
end
expect(Gitlab::GithubImport::ImportLfsObjectWorker).to receive(:perform_in)
.with(1.second, project.id, an_instance_of(Hash), an_instance_of(String))
.with(1, project.id, an_instance_of(Hash), an_instance_of(String))
waiter = importer.parallel_import

View File

@ -84,7 +84,7 @@ RSpec.describe Gitlab::GithubImport::Importer::NotesImporter, feature_category:
.and_yield(github_comment)
expect(Gitlab::GithubImport::ImportNoteWorker).to receive(:perform_in)
.with(1.second, project.id, an_instance_of(Hash), an_instance_of(String))
.with(1, project.id, an_instance_of(Hash), an_instance_of(String))
waiter = importer.parallel_import

View File

@ -144,7 +144,7 @@ RSpec.describe Gitlab::GithubImport::Importer::ProtectedBranchesImporter, featur
it 'imports each protected branch in parallel' do
expect(Gitlab::GithubImport::ImportProtectedBranchWorker)
.to receive(:perform_in)
.with(1.second, project.id, an_instance_of(Hash), an_instance_of(String))
.with(1, project.id, an_instance_of(Hash), an_instance_of(String))
expect(Gitlab::GithubImport::ObjectCounter)
.to receive(:increment).with(project, :protected_branch, :fetched)

View File

@ -97,7 +97,7 @@ RSpec.describe Gitlab::GithubImport::Importer::PullRequests::ReviewRequestsImpor
{ id: 4, login: 'alice' },
{ id: 5, login: 'bob' }
]
},
}.deep_stringify_keys,
instance_of(String)
],
[
@ -108,7 +108,7 @@ RSpec.describe Gitlab::GithubImport::Importer::PullRequests::ReviewRequestsImpor
users: [
{ id: 4, login: 'alice' }
]
},
}.deep_stringify_keys,
instance_of(String)
]
]
@ -116,10 +116,10 @@ RSpec.describe Gitlab::GithubImport::Importer::PullRequests::ReviewRequestsImpor
it 'schedule import for each merge request reviewers' do
expect(Gitlab::GithubImport::PullRequests::ImportReviewRequestWorker)
.to receive(:perform_in).with(1.second, *expected_worker_payload.first)
.to receive(:perform_in).with(1, *expected_worker_payload.first)
expect(Gitlab::GithubImport::PullRequests::ImportReviewRequestWorker)
.to receive(:perform_in).with(1.second, *expected_worker_payload.second)
.to receive(:perform_in).with(1, *expected_worker_payload.second)
expect(Gitlab::GithubImport::ObjectCounter)
.to receive(:increment).twice.with(project, :pull_request_review_request, :fetched)
@ -137,7 +137,7 @@ RSpec.describe Gitlab::GithubImport::Importer::PullRequests::ReviewRequestsImpor
it "doesn't schedule import this merge request reviewers" do
expect(Gitlab::GithubImport::PullRequests::ImportReviewRequestWorker)
.to receive(:perform_in).with(1.second, *expected_worker_payload.second)
.to receive(:perform_in).with(1, *expected_worker_payload.second)
expect(Gitlab::GithubImport::ObjectCounter)
.to receive(:increment).once.with(project, :pull_request_review_request, :fetched)

View File

@ -102,7 +102,7 @@ RSpec.describe Gitlab::GithubImport::Importer::PullRequestsImporter, feature_cat
expect(Gitlab::GithubImport::ImportPullRequestWorker)
.to receive(:perform_in)
.with(1.second, project.id, an_instance_of(Hash), an_instance_of(String))
.with(1, project.id, an_instance_of(Hash), an_instance_of(String))
waiter = importer.parallel_import

View File

@ -296,11 +296,11 @@ RSpec.describe Gitlab::GithubImport::ParallelScheduling, feature_category: :impo
expect(importer).to receive(:each_object_to_import)
.and_yield(object).and_yield(object).and_yield(object)
expect(worker_class).to receive(:perform_in)
.with(1.second, project.id, { title: 'One' }, 'waiter-key').ordered
.with(1, project.id, { 'title' => 'One' }, 'waiter-key').ordered
expect(worker_class).to receive(:perform_in)
.with(1.second, project.id, { title: 'Two' }, 'waiter-key').ordered
.with(1, project.id, { 'title' => 'Two' }, 'waiter-key').ordered
expect(worker_class).to receive(:perform_in)
.with(1.minute + 1.second, project.id, { title: 'Three' }, 'waiter-key').ordered
.with(61, project.id, { 'title' => 'Three' }, 'waiter-key').ordered
job_waiter = importer.parallel_import
@ -325,11 +325,11 @@ RSpec.describe Gitlab::GithubImport::ParallelScheduling, feature_category: :impo
expect(importer).to receive(:each_object_to_import).and_yield(object).and_yield(object).and_yield(object)
expect(worker_class).to receive(:perform_in)
.with(1.second, project.id, { title: 'One' }, 'waiter-key').ordered
.with(1, project.id, { 'title' => 'One' }, 'waiter-key').ordered
expect(worker_class).to receive(:perform_in)
.with(1.minute + 1.second, project.id, { title: 'Two' }, 'waiter-key').ordered
.with(61, project.id, { 'title' => 'Two' }, 'waiter-key').ordered
expect(worker_class).to receive(:perform_in)
.with(2.minutes + 1.second, project.id, { title: 'Three' }, 'waiter-key').ordered
.with(121, project.id, { 'title' => 'Three' }, 'waiter-key').ordered
job_waiter = importer.parallel_import

View File

@ -2,14 +2,14 @@
require 'fast_spec_helper'
RSpec.describe Gitlab::GithubImport::Representation::ToHash do
RSpec.describe Gitlab::GithubImport::Representation::ToHash, feature_category: :importers do
describe '#to_hash' do
let(:user) { double(:user, attributes: { login: 'alice' }) }
let(:issue) do
double(
:issue,
attributes: { user: user, assignees: [user], number: 42 }
attributes: { user: user, assignees: [user], number: 42, created_at: 5.days.ago, status: :valid }
)
end
@ -35,5 +35,13 @@ RSpec.describe Gitlab::GithubImport::Representation::ToHash do
it 'keeps values as-is if they do not respond to #to_hash' do
expect(issue_hash[:number]).to eq(42)
end
it 'converts Date value to String' do
expect(issue_hash[:created_at]).to be_an_instance_of(String)
end
it 'converts Symbol value to String' do
expect(issue_hash[:status]).to be_an_instance_of(String)
end
end
end

View File

@ -2,7 +2,8 @@
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::AggregatedMetric, :clean_gitlab_redis_shared_state do
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::AggregatedMetric, :clean_gitlab_redis_shared_state,
feature_category: :service_ping do
using RSpec::Parameterized::TableSyntax
before do
# weekly AND 1 weekly OR 2

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::DatabaseMetric do
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::DatabaseMetric, feature_category: :service_ping do
let(:database_metric_class) { Class.new(described_class) }
subject do

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::GenericMetric do
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::GenericMetric, feature_category: :service_ping do
shared_examples 'custom fallback' do |custom_fallback|
subject do
Class.new(described_class) do

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::NumbersMetric do
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::NumbersMetric, feature_category: :service_ping do
subject do
described_class.tap do |metric_class|
metric_class.operation :add

View File

@ -2,7 +2,8 @@
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::RedisHLLMetric, :clean_gitlab_redis_shared_state do
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::RedisHLLMetric, :clean_gitlab_redis_shared_state,
feature_category: :service_ping do
before do
Gitlab::UsageDataCounters::HLLRedisCounter.track_event(:i_quickactions_approve, values: 1, time: 1.week.ago)
Gitlab::UsageDataCounters::HLLRedisCounter.track_event(:i_quickactions_approve, values: 1, time: 2.weeks.ago)

View File

@ -2,7 +2,8 @@
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::RedisMetric, :clean_gitlab_redis_shared_state do
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::RedisMetric, :clean_gitlab_redis_shared_state,
feature_category: :service_ping do
before do
4.times do
Gitlab::UsageDataCounters::SourceCodeCounter.count(:pushes)

View File

@ -174,15 +174,16 @@ RSpec.describe Ci::Catalog::Resource, feature_category: :pipeline_composition do
end
describe 'sync with project' do
shared_examples 'name and description of the catalog resource matches the project' do
shared_examples 'denormalized columns of the catalog resource match the project' do
it do
expect(resource.reload.name).to eq(project.name)
expect(resource.reload.description).to eq(project.description)
expect(resource.name).to eq(project.name)
expect(resource.description).to eq(project.description)
expect(resource.visibility_level).to eq(project.visibility_level)
end
end
context 'when the catalog resource is created' do
it_behaves_like 'name and description of the catalog resource matches the project'
it_behaves_like 'denormalized columns of the catalog resource match the project'
end
context 'when the project name is updated' do
@ -190,7 +191,7 @@ RSpec.describe Ci::Catalog::Resource, feature_category: :pipeline_composition do
project.update!(name: 'My new project name')
end
it_behaves_like 'name and description of the catalog resource matches the project'
it_behaves_like 'denormalized columns of the catalog resource match the project'
end
context 'when the project description is updated' do
@ -198,7 +199,15 @@ RSpec.describe Ci::Catalog::Resource, feature_category: :pipeline_composition do
project.update!(description: 'My new description')
end
it_behaves_like 'name and description of the catalog resource matches the project'
it_behaves_like 'denormalized columns of the catalog resource match the project'
end
context 'when the project visibility_level is updated' do
before do
project.update!(visibility_level: 10)
end
it_behaves_like 'denormalized columns of the catalog resource match the project'
end
end
end

View File

@ -9120,18 +9120,20 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
end
end
# TODO: Remove/update this spec after background syncing is implemented. See https://gitlab.com/gitlab-org/gitlab/-/issues/429376.
describe '#update_catalog_resource' do
let_it_be_with_reload(:project) { create(:project, name: 'My project name', description: 'My description') }
let_it_be(:resource) { create(:ci_catalog_resource, project: project) }
let_it_be_with_reload(:resource) { create(:ci_catalog_resource, project: project) }
shared_examples 'name and description of the catalog resource matches the project' do
shared_examples 'name, description, and visibility_level of the catalog resource match the project' do
it do
expect(project).to receive(:update_catalog_resource).once.and_call_original
project.save!
expect(resource.reload.name).to eq(project.name)
expect(resource.reload.description).to eq(project.description)
expect(resource.name).to eq(project.name)
expect(resource.description).to eq(project.description)
expect(resource.visibility_level).to eq(project.visibility_level)
end
end
@ -9140,7 +9142,7 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
project.name = 'My new project name'
end
it_behaves_like 'name and description of the catalog resource matches the project'
it_behaves_like 'name, description, and visibility_level of the catalog resource match the project'
end
context 'when the project description is updated' do
@ -9148,10 +9150,18 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
project.description = 'My new description'
end
it_behaves_like 'name and description of the catalog resource matches the project'
it_behaves_like 'name, description, and visibility_level of the catalog resource match the project'
end
context 'when neither the project name nor description are updated' do
context 'when the project visibility_level is updated' do
before do
project.visibility_level = 10
end
it_behaves_like 'name, description, and visibility_level of the catalog resource match the project'
end
context 'when neither the project name, description, nor visibility_level are updated' do
it 'does not call update_catalog_resource' do
expect(project).not_to receive(:update_catalog_resource)

View File

@ -266,7 +266,7 @@ RSpec.describe Upload do
it 'updates project statistics when upload is added' do
expect(ProjectCacheWorker).to receive(:perform_async)
.with(project.id, [], [:uploads_size])
.with(project.id, [], ['uploads_size'])
subject.save!
end
@ -275,7 +275,7 @@ RSpec.describe Upload do
subject.save!
expect(ProjectCacheWorker).to receive(:perform_async)
.with(project.id, [], [:uploads_size])
.with(project.id, [], ['uploads_size'])
subject.destroy!
end

View File

@ -44,6 +44,9 @@ RSpec.describe User, feature_category: :user_profile do
it { is_expected.to delegate_method(:time_display_relative).to(:user_preference) }
it { is_expected.to delegate_method(:time_display_relative=).to(:user_preference).with_arguments(:args) }
it { is_expected.to delegate_method(:time_display_format).to(:user_preference) }
it { is_expected.to delegate_method(:time_display_format=).to(:user_preference).with_arguments(:args) }
it { is_expected.to delegate_method(:show_whitespace_in_diffs).to(:user_preference) }
it { is_expected.to delegate_method(:show_whitespace_in_diffs=).to(:user_preference).with_arguments(:args) }

View File

@ -2395,45 +2395,49 @@ RSpec.describe ProjectPolicy, feature_category: :system_access do
developer_permissions + [:create_cluster, :read_cluster, :update_cluster, :admin_cluster, :admin_terraform_state, :admin_project_google_cloud]
end
where(:project_visibility, :access_level, :role, :allowed) do
:public | ProjectFeature::ENABLED | :maintainer | true
:public | ProjectFeature::ENABLED | :developer | true
:public | ProjectFeature::ENABLED | :guest | true
:public | ProjectFeature::ENABLED | :anonymous | true
:public | ProjectFeature::PRIVATE | :maintainer | true
:public | ProjectFeature::PRIVATE | :developer | true
:public | ProjectFeature::PRIVATE | :guest | true
:public | ProjectFeature::PRIVATE | :anonymous | false
:public | ProjectFeature::DISABLED | :maintainer | false
:public | ProjectFeature::DISABLED | :developer | false
:public | ProjectFeature::DISABLED | :guest | false
:public | ProjectFeature::DISABLED | :anonymous | false
:internal | ProjectFeature::ENABLED | :maintainer | true
:internal | ProjectFeature::ENABLED | :developer | true
:internal | ProjectFeature::ENABLED | :guest | true
:internal | ProjectFeature::ENABLED | :anonymous | false
:internal | ProjectFeature::PRIVATE | :maintainer | true
:internal | ProjectFeature::PRIVATE | :developer | true
:internal | ProjectFeature::PRIVATE | :guest | true
:internal | ProjectFeature::PRIVATE | :anonymous | false
:internal | ProjectFeature::DISABLED | :maintainer | false
:internal | ProjectFeature::DISABLED | :developer | false
:internal | ProjectFeature::DISABLED | :guest | false
:internal | ProjectFeature::DISABLED | :anonymous | false
:private | ProjectFeature::ENABLED | :maintainer | true
:private | ProjectFeature::ENABLED | :developer | true
:private | ProjectFeature::ENABLED | :guest | true
:private | ProjectFeature::ENABLED | :anonymous | false
:private | ProjectFeature::PRIVATE | :maintainer | true
:private | ProjectFeature::PRIVATE | :developer | true
:private | ProjectFeature::PRIVATE | :guest | true
:private | ProjectFeature::PRIVATE | :anonymous | false
:private | ProjectFeature::DISABLED | :maintainer | false
:private | ProjectFeature::DISABLED | :developer | false
:private | ProjectFeature::DISABLED | :guest | false
:private | ProjectFeature::DISABLED | :anonymous | false
shared_context 'with permission matrix' do
where(:project_visibility, :access_level, :role, :allowed) do
:public | ProjectFeature::ENABLED | :maintainer | true
:public | ProjectFeature::ENABLED | :developer | true
:public | ProjectFeature::ENABLED | :guest | true
:public | ProjectFeature::ENABLED | :anonymous | true
:public | ProjectFeature::PRIVATE | :maintainer | true
:public | ProjectFeature::PRIVATE | :developer | true
:public | ProjectFeature::PRIVATE | :guest | true
:public | ProjectFeature::PRIVATE | :anonymous | false
:public | ProjectFeature::DISABLED | :maintainer | false
:public | ProjectFeature::DISABLED | :developer | false
:public | ProjectFeature::DISABLED | :guest | false
:public | ProjectFeature::DISABLED | :anonymous | false
:internal | ProjectFeature::ENABLED | :maintainer | true
:internal | ProjectFeature::ENABLED | :developer | true
:internal | ProjectFeature::ENABLED | :guest | true
:internal | ProjectFeature::ENABLED | :anonymous | false
:internal | ProjectFeature::PRIVATE | :maintainer | true
:internal | ProjectFeature::PRIVATE | :developer | true
:internal | ProjectFeature::PRIVATE | :guest | true
:internal | ProjectFeature::PRIVATE | :anonymous | false
:internal | ProjectFeature::DISABLED | :maintainer | false
:internal | ProjectFeature::DISABLED | :developer | false
:internal | ProjectFeature::DISABLED | :guest | false
:internal | ProjectFeature::DISABLED | :anonymous | false
:private | ProjectFeature::ENABLED | :maintainer | true
:private | ProjectFeature::ENABLED | :developer | true
:private | ProjectFeature::ENABLED | :guest | true
:private | ProjectFeature::ENABLED | :anonymous | false
:private | ProjectFeature::PRIVATE | :maintainer | true
:private | ProjectFeature::PRIVATE | :developer | true
:private | ProjectFeature::PRIVATE | :guest | true
:private | ProjectFeature::PRIVATE | :anonymous | false
:private | ProjectFeature::DISABLED | :maintainer | false
:private | ProjectFeature::DISABLED | :developer | false
:private | ProjectFeature::DISABLED | :guest | false
:private | ProjectFeature::DISABLED | :anonymous | false
end
end
include_context 'with permission matrix'
with_them do
let(:current_user) { user_subject(role) }
let(:project) { project_subject(project_visibility) }
@ -2450,6 +2454,8 @@ RSpec.describe ProjectPolicy, feature_category: :system_access do
end
context 'when terraform state management is disabled' do
include_context 'with permission matrix'
before do
stub_config(terraform_state: { enabled: false })
end

View File

@ -37,11 +37,13 @@ RSpec.describe 'Updating an image DiffNote', feature_category: :team_planning do
end
let!(:diff_note) do
create(:image_diff_note_on_merge_request,
noteable: noteable,
project: noteable.project,
note: original_body,
position: original_position)
create(
:image_diff_note_on_merge_request,
noteable: noteable,
project: noteable.project,
note: original_body,
position: original_position
)
end
let(:mutation) do

View File

@ -17,14 +17,16 @@ RSpec.describe 'Updating the packages cleanup policy', feature_category: :packag
end
let(:mutation) do
graphql_mutation(:update_packages_cleanup_policy, params,
<<~QUERY
packagesCleanupPolicy {
keepNDuplicatedPackageFiles
nextRunAt
}
errors
QUERY
graphql_mutation(
:update_packages_cleanup_policy,
params,
<<~QUERY
packagesCleanupPolicy {
keepNDuplicatedPackageFiles
nextRunAt
}
errors
QUERY
)
end

View File

@ -10,12 +10,14 @@ RSpec.describe 'Updating an existing release asset link', feature_category: :rel
let_it_be(:developer) { create(:user).tap { |u| project.add_developer(u) } }
let_it_be(:release_link) do
create(:release_link,
release: release,
name: 'link name',
url: 'https://example.com/url',
filepath: '/permanent/path',
link_type: 'package')
create(
:release_link,
release: release,
name: 'link name',
url: 'https://example.com/url',
filepath: '/permanent/path',
link_type: 'package'
)
end
let(:current_user) { developer }

View File

@ -42,7 +42,7 @@ RSpec.describe 'Creating a Snippet', feature_category: :source_code_management d
let(:current_user) { nil }
it_behaves_like 'a mutation that returns top-level errors',
errors: [Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR]
errors: [Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR]
it 'does not create the Snippet' do
expect do
@ -122,7 +122,7 @@ RSpec.describe 'Creating a Snippet', feature_category: :source_code_management d
let(:project_path) { 'foobar' }
it_behaves_like 'a mutation that returns top-level errors',
errors: [Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR]
errors: [Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR]
end
context 'when the feature is disabled' do
@ -131,7 +131,7 @@ RSpec.describe 'Creating a Snippet', feature_category: :source_code_management d
end
it_behaves_like 'a mutation that returns top-level errors',
errors: [Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR]
errors: [Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR]
end
it_behaves_like 'snippet edit usage data counters'

View File

@ -24,7 +24,7 @@ RSpec.describe 'Destroying a Snippet', feature_category: :source_code_management
let(:current_user) { create(:user) }
it_behaves_like 'a mutation that returns top-level errors',
errors: [Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR]
errors: [Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR]
it 'does not destroy the Snippet' do
expect do

View File

@ -40,7 +40,7 @@ RSpec.describe 'Mark snippet as spam', feature_category: :source_code_management
let(:current_user) { other_user }
it_behaves_like 'a mutation that returns top-level errors',
errors: [Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR]
errors: [Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR]
it_behaves_like 'does not mark the snippet as spam'
end

View File

@ -46,7 +46,7 @@ RSpec.describe 'Updating a Snippet', feature_category: :source_code_management d
let(:current_user) { create(:user) }
it_behaves_like 'a mutation that returns top-level errors',
errors: [Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR]
errors: [Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR]
it 'does not update the Snippet' do
expect do
@ -118,13 +118,15 @@ RSpec.describe 'Updating a Snippet', feature_category: :source_code_management d
describe 'PersonalSnippet' do
let(:snippet) do
create(:personal_snippet,
:private,
:repository,
file_name: original_file_name,
title: original_title,
content: original_content,
description: original_description)
create(
:personal_snippet,
:private,
:repository,
file_name: original_file_name,
title: original_title,
content: original_content,
description: original_description
)
end
it_behaves_like 'graphql update actions'
@ -139,15 +141,17 @@ RSpec.describe 'Updating a Snippet', feature_category: :source_code_management d
let_it_be(:project) { create(:project, :private) }
let(:snippet) do
create(:project_snippet,
:private,
:repository,
project: project,
author: create(:user),
file_name: original_file_name,
title: original_title,
content: original_content,
description: original_description)
create(
:project_snippet,
:private,
:repository,
project: project,
author: create(:user),
file_name: original_file_name,
title: original_title,
content: original_content,
description: original_description
)
end
context 'when the author is not a member of the project' do

View File

@ -21,12 +21,14 @@ RSpec.describe 'Marking all todos done', feature_category: :team_planning do
let(:input) { {} }
let(:mutation) do
graphql_mutation(:todos_mark_all_done, input,
<<-QL.strip_heredoc
clientMutationId
todos { id }
errors
QL
graphql_mutation(
:todos_mark_all_done,
input,
<<-QL.strip_heredoc
clientMutationId
todos { id }
errors
QL
)
end

View File

@ -19,15 +19,17 @@ RSpec.describe 'Marking todos done', feature_category: :team_planning do
let(:input) { { id: todo1.to_global_id.to_s } }
let(:mutation) do
graphql_mutation(:todo_mark_done, input,
<<-QL.strip_heredoc
clientMutationId
errors
todo {
id
state
}
QL
graphql_mutation(
:todo_mark_done,
input,
<<-QL.strip_heredoc
clientMutationId
errors
todo {
id
state
}
QL
)
end

View File

@ -20,15 +20,17 @@ RSpec.describe 'Restoring many Todos', feature_category: :team_planning do
let(:input) { { ids: input_ids } }
let(:mutation) do
graphql_mutation(:todo_restore_many, input,
<<-QL.strip_heredoc
clientMutationId
errors
todos {
id
state
}
QL
graphql_mutation(
:todo_restore_many,
input,
<<-QL.strip_heredoc
clientMutationId
errors
todos {
id
state
}
QL
)
end

View File

@ -19,15 +19,17 @@ RSpec.describe 'Restoring Todos', feature_category: :team_planning do
let(:input) { { id: todo1.to_global_id.to_s } }
let(:mutation) do
graphql_mutation(:todo_restore, input,
<<-QL.strip_heredoc
clientMutationId
errors
todo {
id
state
}
QL
graphql_mutation(
:todo_restore,
input,
<<-QL.strip_heredoc
clientMutationId
errors
todo {
id
state
}
QL
)
end

View File

@ -429,8 +429,8 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state,
.with(
project_hook.id,
hash_including(default_log_data.deep_stringify_keys),
:ok,
nil
'ok',
''
)
service_instance.execute
@ -460,8 +460,8 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state,
response_status: 400
).deep_stringify_keys
),
:failed,
nil
'failed',
''
)
service_instance.execute
@ -484,8 +484,8 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state,
internal_error_message: 'Some HTTP Post error'
).deep_stringify_keys
),
:error,
nil
'error',
''
)
service_instance.execute
@ -502,8 +502,8 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state,
.with(
project_hook.id,
hash_including(default_log_data.merge(response_body: '').deep_stringify_keys),
:ok,
nil
'ok',
''
)
service_instance.execute
@ -523,8 +523,8 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state,
.with(
project_hook.id,
hash_including(default_log_data.merge(response_body: stripped_body).deep_stringify_keys),
:ok,
nil
'ok',
''
)
service_instance.execute
@ -556,8 +556,8 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state,
.with(
project_hook.id,
hash_including(default_log_data.merge(response_headers: expected_response_headers).deep_stringify_keys),
:ok,
nil
'ok',
''
)
service_instance.execute
@ -581,8 +581,8 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state,
.with(
project_hook.id,
hash_including(default_log_data.merge(response_headers: expected_response_headers).deep_stringify_keys),
:ok,
nil
'ok',
''
)
service_instance.execute
@ -599,8 +599,8 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state,
.with(
project_hook.id,
hash_including(default_log_data.deep_stringify_keys),
:ok,
nil
'ok',
''
)
.and_raise(
Gitlab::SidekiqMiddleware::SizeLimiter::ExceedLimitError.new(WebHooks::LogExecutionWorker, 100, 50)
@ -612,8 +612,8 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state,
hash_including(default_log_data.merge(
request_data: WebHookLog::OVERSIZE_REQUEST_DATA
).deep_stringify_keys),
:ok,
nil
'ok',
''
)
.and_call_original
.ordered

View File

@ -4,7 +4,7 @@ RSpec.shared_examples Gitlab::Import::AdvanceStage do |factory:|
let_it_be(:project) { create(:project) }
let_it_be_with_reload(:import_state) { create(factory, :started, project: project, jid: '123') }
let(:worker) { described_class.new }
let(:next_stage) { :finish }
let(:next_stage) { 'finish' }
describe '#perform', :clean_gitlab_redis_shared_state do
context 'when the project no longer exists' do
@ -60,7 +60,7 @@ RSpec.shared_examples Gitlab::Import::AdvanceStage do |factory:|
end
it 'schedules the next stage' do
next_worker = described_class::STAGES[next_stage]
next_worker = described_class::STAGES[next_stage.to_sym]
expect_next_found_instance_of(import_state.class) do |state|
expect(state).to receive(:refresh_jid_expiration)
@ -72,7 +72,7 @@ RSpec.shared_examples Gitlab::Import::AdvanceStage do |factory:|
end
it 'raises KeyError when the stage name is invalid' do
expect { worker.perform(project.id, { '123' => 2 }, :kittens) }
expect { worker.perform(project.id, { '123' => 2 }, 'kittens') }
.to raise_error(KeyError)
end
end
@ -106,7 +106,7 @@ RSpec.shared_examples Gitlab::Import::AdvanceStage do |factory:|
it 'advances to next stage' do
freeze_time do
next_worker = described_class::STAGES[next_stage]
next_worker = described_class::STAGES[next_stage.to_sym]
expect(next_worker).to receive(:perform_async).with(project.id)
@ -122,7 +122,7 @@ RSpec.shared_examples Gitlab::Import::AdvanceStage do |factory:|
it 'logs error and fails import' do
freeze_time do
next_worker = described_class::STAGES[next_stage]
next_worker = described_class::STAGES[next_stage.to_sym]
expect(next_worker).not_to receive(:perform_async).with(project.id)
expect_next_instance_of(described_class) do |klass|

View File

@ -32,7 +32,7 @@ RSpec.describe Gitlab::BitbucketImport::AdvanceStageWorker, :clean_gitlab_redis_
expect(described_class)
.to receive(:perform_in)
.with(described_class::INTERVAL, project.id, { '123' => 1 }, :finish, Time.zone.now, 1)
.with(described_class::INTERVAL, project.id, { '123' => 1 }, 'finish', Time.zone.now.to_s, 1)
worker.perform(project.id, { '123' => 2 }, :finish)
end

View File

@ -51,7 +51,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportAttachmentsWorker, feature_cat
expect(Gitlab::GithubImport::AdvanceStageWorker)
.to receive(:perform_async)
.with(project.id, { '123' => 2, '234' => 3, '345' => 4, '456' => 5 }, :protected_branches)
.with(project.id, { '123' => 2, '234' => 3, '345' => 4, '456' => 5 }, 'protected_branches')
worker.import(client, project)
end
@ -62,7 +62,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportAttachmentsWorker, feature_cat
it 'skips release attachments import and calls next stage' do
importers.each { |importer| expect(importer[:klass]).not_to receive(:new) }
expect(Gitlab::GithubImport::AdvanceStageWorker)
.to receive(:perform_async).with(project.id, {}, :protected_branches)
.to receive(:perform_async).with(project.id, {}, 'protected_branches')
worker.import(client, project)
end

View File

@ -35,7 +35,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportCollaboratorsWorker, feature_c
expect(Gitlab::GithubImport::AdvanceStageWorker)
.to receive(:perform_async)
.with(project.id, { '123' => 2 }, :pull_requests_merged_by)
.with(project.id, { '123' => 2 }, 'pull_requests_merged_by')
worker.import(client, project)
end
@ -49,7 +49,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportCollaboratorsWorker, feature_c
expect(Gitlab::GithubImport::AdvanceStageWorker)
.to receive(:perform_async)
.with(project.id, {}, :pull_requests_merged_by)
.with(project.id, {}, 'pull_requests_merged_by')
worker.import(client, project)
end
@ -63,7 +63,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportCollaboratorsWorker, feature_c
expect(Gitlab::GithubImport::AdvanceStageWorker)
.to receive(:perform_async)
.with(project.id, {}, :pull_requests_merged_by)
.with(project.id, {}, 'pull_requests_merged_by')
worker.import(client, project)
end

View File

@ -33,7 +33,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportIssueEventsWorker, feature_cat
expect(Gitlab::GithubImport::AdvanceStageWorker)
.to receive(:perform_async)
.with(project.id, { '123' => 2 }, :notes)
.with(project.id, { '123' => 2 }, 'notes')
worker.import(client, project)
end
@ -44,7 +44,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportIssueEventsWorker, feature_cat
it 'skips issue events import and calls next stage' do
expect(Gitlab::GithubImport::Importer::SingleEndpointIssueEventsImporter).not_to receive(:new)
expect(Gitlab::GithubImport::AdvanceStageWorker).to receive(:perform_async).with(project.id, {}, :notes)
expect(Gitlab::GithubImport::AdvanceStageWorker).to receive(:perform_async).with(project.id, {}, 'notes')
worker.import(client, project)
end

View File

@ -35,7 +35,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportIssuesAndDiffNotesWorker, feat
expect(Gitlab::GithubImport::AdvanceStageWorker)
.to receive(:perform_async)
.with(project.id, { '123' => 2 }, :issue_events)
.with(project.id, { '123' => 2 }, 'issue_events')
worker.import(client, project)
end

View File

@ -24,7 +24,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportLfsObjectsWorker, feature_cate
expect(Gitlab::GithubImport::AdvanceStageWorker)
.to receive(:perform_async)
.with(project.id, { '123' => 2 }, :finish)
.with(project.id, { '123' => 2 }, 'finish')
worker.import(project)
end

View File

@ -35,7 +35,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportNotesWorker, feature_category:
expect(Gitlab::GithubImport::AdvanceStageWorker)
.to receive(:perform_async)
.with(project.id, { '123' => 2 }, :attachments)
.with(project.id, { '123' => 2 }, 'attachments')
worker.import(client, project)
end

View File

@ -27,7 +27,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportProtectedBranchesWorker, featu
expect(Gitlab::GithubImport::AdvanceStageWorker)
.to receive(:perform_async)
.with(project.id, { '123' => 2 }, :lfs_objects)
.with(project.id, { '123' => 2 }, 'lfs_objects')
worker.import(client, project)
end

View File

@ -26,7 +26,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportPullRequestsMergedByWorker, fe
expect(Gitlab::GithubImport::AdvanceStageWorker)
.to receive(:perform_async)
.with(project.id, { '123' => 2 }, :pull_request_review_requests)
.with(project.id, { '123' => 2 }, 'pull_request_review_requests')
worker.import(client, project)
end

View File

@ -24,7 +24,7 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportPullRequestsReviewRequestsWork
expect(Gitlab::GithubImport::AdvanceStageWorker)
.to receive(:perform_async)
.with(project.id, { '123' => 2 }, :pull_request_reviews)
.with(project.id, { '123' => 2 }, 'pull_request_reviews')
worker.import(client, project)
end

Some files were not shown because too many files have changed in this diff Show More