Skip to content
Snippets Groups Projects
Commit 167894d0 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 411cc779
No related branches found
No related tags found
No related merge requests found
Showing
with 59 additions and 77 deletions
Loading
Loading
@@ -299,17 +299,17 @@ export default {
stacked="sm"
tbody-tr-class="table-row mb-4"
>
<template v-slot:head(error)>
<template #head(error)>
<div class="d-none d-sm-block">{{ __('Open errors') }}</div>
</template>
<template v-slot:head(events)="data">
<template #head(events)="data">
<div class="text-sm-right">{{ data.label }}</div>
</template>
<template v-slot:head(users)="data">
<template #head(users)="data">
<div class="text-sm-right">{{ data.label }}</div>
</template>
 
<template v-slot:error="errors">
<template #cell(error)="errors">
<div class="d-flex flex-column">
<gl-link class="d-flex mw-100 text-dark" :href="getDetailsLink(errors.item.id)">
<strong class="text-truncate">{{ errors.item.title.trim() }}</strong>
Loading
Loading
@@ -319,20 +319,20 @@ export default {
</span>
</div>
</template>
<template v-slot:events="errors">
<template #cell(events)="errors">
<div class="text-right">{{ errors.item.count }}</div>
</template>
 
<template v-slot:users="errors">
<template #cell(users)="errors">
<div class="text-right">{{ errors.item.userCount }}</div>
</template>
 
<template v-slot:lastSeen="errors">
<template #cell(lastSeen)="errors">
<div class="text-md-left text-right">
<time-ago :time="errors.item.lastSeen" class="text-secondary" />
</div>
</template>
<template v-slot:ignore="errors">
<template #cell(ignore)="errors">
<gl-button
ref="ignoreError"
v-gl-tooltip.hover
Loading
Loading
@@ -342,7 +342,7 @@ export default {
<gl-icon name="eye-slash" :size="12" />
</gl-button>
</template>
<template v-slot:resolved="errors">
<template #cell(resolved)="errors">
<gl-button
ref="resolveError"
v-gl-tooltip
Loading
Loading
@@ -352,7 +352,7 @@ export default {
<gl-icon name="check-circle" :size="12" />
</gl-button>
</template>
<template v-slot:details="errors">
<template #cell(details)="errors">
<gl-button
:href="getDetailsLink(errors.item.id)"
variant="outline-info"
Loading
Loading
@@ -361,7 +361,7 @@ export default {
{{ __('More details') }}
</gl-button>
</template>
<template v-slot:empty>
<template #empty>
{{ __('No errors to display.') }}
<gl-link class="js-try-again" @click="restartPolling">
{{ __('Check again') }}
Loading
Loading
Loading
Loading
@@ -128,8 +128,8 @@ export default {
@click="handleSuggestDismissed"
/>
<gl-popover
v-if="showSuggestPopover"
:target="() => $refs.suggestButton"
v-if="showSuggestPopover && $refs.suggestButton"
:target="$refs.suggestButton"
:css-classes="['diff-suggest-popover']"
placement="bottom"
:show="showSuggestPopover"
Loading
Loading
Loading
Loading
@@ -26,7 +26,7 @@ module API
end
 
get ":id/#{noteables_path}/:noteable_id/discussions" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
 
notes = readable_discussion_notes(noteable)
discussions = Kaminari.paginate_array(Discussion.build_collection(notes, noteable))
Loading
Loading
@@ -42,7 +42,7 @@ module API
requires :noteable_id, types: [Integer, String], desc: 'The ID of the noteable'
end
get ":id/#{noteables_path}/:noteable_id/discussions/:discussion_id" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
notes = readable_discussion_notes(noteable, params[:discussion_id])
 
if notes.empty?
Loading
Loading
@@ -77,7 +77,7 @@ module API
end
end
post ":id/#{noteables_path}/:noteable_id/discussions" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
type = params[:position] ? 'DiffNote' : 'DiscussionNote'
id_key = noteable.is_a?(Commit) ? :commit_id : :noteable_id
 
Loading
Loading
@@ -107,7 +107,7 @@ module API
requires :noteable_id, types: [Integer, String], desc: 'The ID of the noteable'
end
get ":id/#{noteables_path}/:noteable_id/discussions/:discussion_id/notes" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
notes = readable_discussion_notes(noteable, params[:discussion_id])
 
if notes.empty?
Loading
Loading
@@ -127,7 +127,7 @@ module API
optional :created_at, type: String, desc: 'The creation date of the note'
end
post ":id/#{noteables_path}/:noteable_id/discussions/:discussion_id/notes" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
notes = readable_discussion_notes(noteable, params[:discussion_id])
first_note = notes.first
 
Loading
Loading
@@ -161,7 +161,7 @@ module API
requires :note_id, type: Integer, desc: 'The ID of a note'
end
get ":id/#{noteables_path}/:noteable_id/discussions/:discussion_id/notes/:note_id" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
 
get_note(noteable, params[:note_id])
end
Loading
Loading
@@ -178,7 +178,7 @@ module API
exactly_one_of :body, :resolved
end
put ":id/#{noteables_path}/:noteable_id/discussions/:discussion_id/notes/:note_id" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
 
if params[:resolved].nil?
update_note(noteable, params[:note_id])
Loading
Loading
@@ -196,7 +196,7 @@ module API
requires :note_id, type: Integer, desc: 'The ID of a note'
end
delete ":id/#{noteables_path}/:noteable_id/discussions/:discussion_id/notes/:note_id" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
 
delete_note(noteable, params[:note_id])
end
Loading
Loading
@@ -211,7 +211,7 @@ module API
requires :resolved, type: Boolean, desc: 'Mark discussion resolved/unresolved'
end
put ":id/#{noteables_path}/:noteable_id/discussions/:discussion_id" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
 
resolve_discussion(noteable, params[:discussion_id], params[:resolved])
end
Loading
Loading
Loading
Loading
@@ -83,15 +83,15 @@ module API
end
end
 
def find_noteable(parent_type, parent_id, noteable_type, noteable_id)
params = finder_params_by_noteable_type_and_id(noteable_type, noteable_id, parent_id)
def find_noteable(noteable_type, noteable_id)
params = finder_params_by_noteable_type_and_id(noteable_type, noteable_id)
 
noteable = NotesFinder.new(current_user, params).target
noteable = nil unless can?(current_user, noteable_read_ability_name(noteable), noteable)
noteable || not_found!(noteable_type)
end
 
def finder_params_by_noteable_type_and_id(type, id, parent_id)
def finder_params_by_noteable_type_and_id(type, id)
target_type = type.name.underscore
{ target_type: target_type }.tap do |h|
if %w(issue merge_request).include?(target_type)
Loading
Loading
@@ -100,11 +100,11 @@ module API
h[:target_id] = id
end
 
add_parent_to_finder_params(h, type, parent_id)
add_parent_to_finder_params(h, type)
end
end
 
def add_parent_to_finder_params(finder_params, noteable_type, parent_id)
def add_parent_to_finder_params(finder_params, noteable_type)
finder_params[:project] = user_project
end
 
Loading
Loading
Loading
Loading
@@ -30,7 +30,7 @@ module API
end
# rubocop: disable CodeReuse/ActiveRecord
get ":id/#{noteables_str}/:noteable_id/notes" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
 
# We exclude notes that are cross-references and that cannot be viewed
# by the current user. By doing this exclusion at this level and not
Loading
Loading
@@ -58,7 +58,7 @@ module API
requires :noteable_id, type: Integer, desc: 'The ID of the noteable'
end
get ":id/#{noteables_str}/:noteable_id/notes/:note_id" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
get_note(noteable, params[:note_id])
end
 
Loading
Loading
@@ -71,7 +71,7 @@ module API
optional :created_at, type: String, desc: 'The creation date of the note'
end
post ":id/#{noteables_str}/:noteable_id/notes" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
 
opts = {
note: params[:body],
Loading
Loading
@@ -98,7 +98,7 @@ module API
requires :body, type: String, desc: 'The content of a note'
end
put ":id/#{noteables_str}/:noteable_id/notes/:note_id" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
 
update_note(noteable, params[:note_id])
end
Loading
Loading
@@ -111,7 +111,7 @@ module API
requires :note_id, type: Integer, desc: 'The ID of a note'
end
delete ":id/#{noteables_str}/:noteable_id/notes/:note_id" do
noteable = find_noteable(parent_type, params[:id], noteable_type, params[:noteable_id])
noteable = find_noteable(noteable_type, params[:noteable_id])
 
delete_note(noteable, params[:note_id])
end
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ module API
end
 
get ":id/#{eventables_str}/:eventable_id/resource_label_events" do
eventable = find_noteable(parent_type, params[:id], eventable_type, params[:eventable_id])
eventable = find_noteable(eventable_type, params[:eventable_id])
 
opts = { page: params[:page], per_page: params[:per_page] }
events = ResourceLabelEventFinder.new(current_user, eventable, opts).execute
Loading
Loading
@@ -42,7 +42,8 @@ module API
requires :eventable_id, types: [Integer, String], desc: 'The ID of the eventable'
end
get ":id/#{eventables_str}/:eventable_id/resource_label_events/:event_id" do
eventable = find_noteable(parent_type, params[:id], eventable_type, params[:eventable_id])
eventable = find_noteable(eventable_type, params[:eventable_id])
event = eventable.resource_label_events.find(params[:event_id])
 
not_found!('ResourceLabelEvent') unless can?(current_user, :read_resource_label_event, event)
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@
"@babel/plugin-syntax-import-meta": "^7.2.0",
"@babel/preset-env": "^7.6.2",
"@gitlab/svgs": "^1.90.0",
"@gitlab/ui": "^8.21.0",
"@gitlab/ui": "^9.0.0",
"@gitlab/visual-review-tools": "1.5.1",
"@sentry/browser": "^5.10.2",
"@sourcegraph/code-host-integration": "0.0.21",
Loading
Loading
Loading
Loading
@@ -12,6 +12,12 @@ module QA
 
yield
 
# Workaround for a bug preventing sign out from secondary nodes
# See https://gitlab.com/gitlab-org/gitlab/issues/198289
if address == :geo_secondary
Runtime::Browser.visit(:geo_primary, Page::Dashboard::Projects)
end
Page::Main::Menu.perform(&:sign_out)
end
 
Loading
Loading
Loading
Loading
@@ -26,13 +26,13 @@ module QA
wait_for_requests
end
 
def wait_until(max_duration: 60, sleep_interval: 0.1, reload: true, raise_on_failure: false)
def wait_until(max_duration: 60, sleep_interval: 0.1, reload: true, raise_on_failure: true)
Support::Waiter.wait_until(max_duration: max_duration, sleep_interval: sleep_interval, raise_on_failure: raise_on_failure) do
yield || (reload && refresh && false)
end
end
 
def retry_until(max_attempts: 3, reload: false, sleep_interval: 0, raise_on_failure: false)
def retry_until(max_attempts: 3, reload: false, sleep_interval: 0, raise_on_failure: true)
Support::Retrier.retry_until(max_attempts: max_attempts, reload_page: (reload && self), sleep_interval: sleep_interval, raise_on_failure: raise_on_failure) do
yield
end
Loading
Loading
Loading
Loading
@@ -16,13 +16,6 @@ module QA
super
end
 
def wait_until(max_duration: 60, sleep_interval: 0.1, reload: true, raise_on_failure: false)
log("next wait uses reload: #{reload}")
# Logging of wait start/end/duration is handled by QA::Support::Waiter
super
end
def scroll_to(selector, text: nil)
msg = "scrolling to :#{selector}"
msg += " with text: #{text}" if text
Loading
Loading
Loading
Loading
@@ -34,7 +34,7 @@ module QA
result
end
 
def retry_until(max_attempts: nil, max_duration: nil, reload_page: nil, sleep_interval: 0, raise_on_failure: false, retry_on_exception: false)
def retry_until(max_attempts: nil, max_duration: nil, reload_page: nil, sleep_interval: 0, raise_on_failure: true, retry_on_exception: false)
# For backwards-compatibility
max_attempts = 3 if max_attempts.nil? && max_duration.nil?
 
Loading
Loading
Loading
Loading
@@ -7,7 +7,7 @@ module QA
 
module_function
 
def wait_until(max_duration: singleton_class::DEFAULT_MAX_WAIT_TIME, reload_page: nil, sleep_interval: 0.1, raise_on_failure: false, retry_on_exception: false)
def wait_until(max_duration: singleton_class::DEFAULT_MAX_WAIT_TIME, reload_page: nil, sleep_interval: 0.1, raise_on_failure: true, retry_on_exception: false)
QA::Runtime::Logger.debug(
<<~MSG.tr("\n", ' ')
with wait_until: max_duration: #{max_duration};
Loading
Loading
Loading
Loading
@@ -27,24 +27,6 @@ describe QA::Support::Page::Logging do
.to output(%r{refreshing http://current-url}).to_stdout_from_any_process
end
 
it 'logs wait' do
expect { subject.wait_until(max_duration: 0) {} }
.to output(/next wait uses reload: true/).to_stdout_from_any_process
expect { subject.wait_until(max_duration: 0) {} }
.to output(/with wait_until/).to_stdout_from_any_process
expect { subject.wait_until(max_duration: 0) {} }
.to output(/ended wait_until$/).to_stdout_from_any_process
end
it 'logs wait with reload false' do
expect { subject.wait_until(max_duration: 0, reload: false) {} }
.to output(/next wait uses reload: false/).to_stdout_from_any_process
expect { subject.wait_until(max_duration: 0, reload: false) {} }
.to output(/with wait_until/).to_stdout_from_any_process
expect { subject.wait_until(max_duration: 0, reload: false) {} }
.to output(/ended wait_until$/).to_stdout_from_any_process
end
it 'logs scroll_to' do
expect { subject.scroll_to(:element) }
.to output(/scrolling to :element/).to_stdout_from_any_process
Loading
Loading
Loading
Loading
@@ -14,12 +14,12 @@ describe QA::Support::Retrier do
context 'when the condition is true' do
it 'logs max attempts (3 by default)' do
expect { subject.retry_until { true } }
.to output(/with retry_until: max_attempts: 3; reload_page: ; sleep_interval: 0; raise_on_failure: false; retry_on_exception: false/).to_stdout_from_any_process
.to output(/with retry_until: max_attempts: 3; reload_page: ; sleep_interval: 0; raise_on_failure: true; retry_on_exception: false/).to_stdout_from_any_process
end
 
it 'logs max duration' do
expect { subject.retry_until(max_duration: 1) { true } }
.to output(/with retry_until: max_duration: 1; reload_page: ; sleep_interval: 0; raise_on_failure: false; retry_on_exception: false/).to_stdout_from_any_process
.to output(/with retry_until: max_duration: 1; reload_page: ; sleep_interval: 0; raise_on_failure: true; retry_on_exception: false/).to_stdout_from_any_process
end
 
it 'logs the end' do
Loading
Loading
@@ -30,12 +30,12 @@ describe QA::Support::Retrier do
 
context 'when the condition is false' do
it 'logs the start' do
expect { subject.retry_until(max_duration: 0) { false } }
expect { subject.retry_until(max_duration: 0, raise_on_failure: false) { false } }
.to output(/with retry_until: max_duration: 0; reload_page: ; sleep_interval: 0; raise_on_failure: false; retry_on_exception: false/).to_stdout_from_any_process
end
 
it 'logs the end' do
expect { subject.retry_until(max_duration: 0) { false } }
expect { subject.retry_until(max_duration: 0, raise_on_failure: false) { false } }
.to output(/ended retry_until$/).to_stdout_from_any_process
end
end
Loading
Loading
@@ -54,8 +54,8 @@ describe QA::Support::Retrier do
subject.retry_until
end
 
it 'sets raise_on_failure to false by default' do
expect(subject).to receive(:repeat_until).with(hash_including(raise_on_failure: false))
it 'sets raise_on_failure to true by default' do
expect(subject).to receive(:repeat_until).with(hash_including(raise_on_failure: true))
 
subject.retry_until
end
Loading
Loading
Loading
Loading
@@ -46,8 +46,8 @@ describe QA::Support::Waiter do
subject.wait_until
end
 
it 'sets raise_on_failure to false by default' do
expect(subject).to receive(:repeat_until).with(hash_including(raise_on_failure: false))
it 'sets raise_on_failure to true by default' do
expect(subject).to receive(:repeat_until).with(hash_including(raise_on_failure: true))
 
subject.wait_until
end
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ describe 'Resolving all open threads in a merge request from an issue', :js do
def resolve_all_discussions_link_selector
text = "Resolve all threads in new issue"
url = new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)
%Q{a[data-original-title="#{text}"][href="#{url}"]}
%Q{a[title="#{text}"][href="#{url}"]}
end
 
describe 'as a user with access to the project' do
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ describe 'Resolve an open thread in a merge request by creating an issue', :js d
def resolve_discussion_selector
title = 'Resolve this thread in a new issue'
url = new_project_issue_path(project, discussion_to_resolve: discussion.id, merge_request_to_resolve_discussions_of: merge_request.iid)
"a[data-original-title=\"#{title}\"][href=\"#{url}\"]"
"a[title=\"#{title}\"][href=\"#{url}\"]"
end
 
describe 'As a user with access to the project' do
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ describe 'Merge request > User edits assignees sidebar', :js do
# DOM finders to simplify and improve readability
let(:sidebar_assignee_block) { page.find('.js-issuable-sidebar .assignee') }
let(:sidebar_assignee_avatar_link) { sidebar_assignee_block.find_all('a').find { |a| a['href'].include? assignee.username } }
let(:sidebar_assignee_tooltip) { sidebar_assignee_avatar_link['data-original-title'] || '' }
let(:sidebar_assignee_tooltip) { sidebar_assignee_avatar_link['title'] || '' }
let(:sidebar_assignee_dropdown_item) { sidebar_assignee_block.find(".dropdown-menu li[data-user-id=\"#{assignee.id}\"]") }
let(:sidebar_assignee_dropdown_tooltip) { sidebar_assignee_dropdown_item.find('a')['data-title'] || '' }
 
Loading
Loading
Loading
Loading
@@ -29,7 +29,7 @@ describe 'Merge request > User sees deployment widget', :js do
wait_for_requests
 
expect(page).to have_content("Deployed to #{environment.name}")
expect(find('.js-deploy-time')['data-original-title']).to eq(deployment.created_at.to_time.in_time_zone.to_s(:medium))
expect(find('.js-deploy-time')['title']).to eq(deployment.created_at.to_time.in_time_zone.to_s(:medium))
end
 
context 'when a user created a new merge request with the same SHA' do
Loading
Loading
Loading
Loading
@@ -112,7 +112,7 @@ describe 'User comments on a diff', :js do
changes = sample_compare(expanded_changes).changes.last(expanded_changes.size)
 
page.within("[id='#{hash}']") do
find("button[data-original-title='Show full file']").click
find("button[title='Show full file']").click
wait_for_requests
 
click_diff_line(find("[id='#{changes.first[:line_code]}']"))
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment