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

Add latest changes from gitlab-org/gitlab@master

parent f1e2fca1
No related branches found
No related tags found
No related merge requests found
Showing
with 160 additions and 40 deletions
1.87.0
12.9.0-rc1
Loading
Loading
@@ -71,8 +71,8 @@ export default {
},
computed: {
statusTitle() {
return sprintf(s__('Commits|Commit: %{commitText}'), {
commitText: this.commit.pipeline.detailedStatus.text,
return sprintf(s__('PipelineStatusTooltip|Pipeline: %{ciStatus}'), {
ciStatus: this.commit.pipeline.detailedStatus.text,
});
},
isLoading() {
Loading
Loading
Loading
Loading
@@ -112,6 +112,7 @@ export default {
<div class="image">
<image-viewer
:path="imagePath"
:file-size="isNew ? newSize : oldSize"
:inner-css-classes="[
'frame',
{
Loading
Loading
# frozen_string_literal: true
module Mutations
module Admin
module SidekiqQueues
class DeleteJobs < BaseMutation
graphql_name 'AdminSidekiqQueuesDeleteJobs'
ADMIN_MESSAGE = 'You must be an admin to use this mutation'
Labkit::Context::KNOWN_KEYS.each do |key|
argument key,
GraphQL::STRING_TYPE,
required: false,
description: "Delete jobs matching #{key} in the context metadata"
end
argument :queue_name,
GraphQL::STRING_TYPE,
required: true,
description: 'The name of the queue to delete jobs from'
field :result,
Types::Admin::SidekiqQueues::DeleteJobsResponseType,
null: true,
description: 'Information about the status of the deletion request'
def ready?(**args)
unless current_user&.admin?
raise Gitlab::Graphql::Errors::ResourceNotAvailable, ADMIN_MESSAGE
end
super
end
def resolve(args)
{
result: Gitlab::SidekiqQueue.new(args[:queue_name]).drop_jobs!(args, timeout: 30),
errors: []
}
rescue Gitlab::SidekiqQueue::NoMetadataError
{
result: nil,
errors: ['No metadata provided']
}
rescue Gitlab::SidekiqQueue::InvalidQueueError
raise Gitlab::Graphql::Errors::ResourceNotAvailable, "Queue #{args[:queue_name]} not found"
end
end
end
end
end
# frozen_string_literal: true
module Types
module Admin
module SidekiqQueues
# We can't authorize against the value passed to this because it's
# a plain hash.
class DeleteJobsResponseType < BaseObject # rubocop:disable Graphql/AuthorizeTypes
graphql_name 'DeleteJobsResponse'
description 'The response from the AdminSidekiqQueuesDeleteJobs mutation.'
field :completed,
GraphQL::BOOLEAN_TYPE,
null: true,
description: 'Whether or not the entire queue was processed in time; if not, retrying the same request is safe'
field :deleted_jobs,
GraphQL::INT_TYPE,
null: true,
description: 'The number of matching jobs deleted'
field :queue_size,
GraphQL::INT_TYPE,
null: true,
description: 'The queue size after processing'
end
end
end
end
Loading
Loading
@@ -6,6 +6,7 @@ module Types
 
graphql_name 'Mutation'
 
mount_mutation Mutations::Admin::SidekiqQueues::DeleteJobs
mount_mutation Mutations::AwardEmojis::Add
mount_mutation Mutations::AwardEmojis::Remove
mount_mutation Mutations::AwardEmojis::Toggle
Loading
Loading
Loading
Loading
@@ -172,6 +172,7 @@ class ApplicationSetting < ApplicationRecord
 
validates :gitaly_timeout_default,
presence: true,
if: :gitaly_timeout_default_changed?,
numericality: {
only_integer: true,
greater_than_or_equal_to: 0,
Loading
Loading
@@ -180,6 +181,7 @@ class ApplicationSetting < ApplicationRecord
 
validates :gitaly_timeout_medium,
presence: true,
if: :gitaly_timeout_medium_changed?,
numericality: { only_integer: true, greater_than_or_equal_to: 0 }
validates :gitaly_timeout_medium,
numericality: { less_than_or_equal_to: :gitaly_timeout_default },
Loading
Loading
@@ -190,6 +192,7 @@ class ApplicationSetting < ApplicationRecord
 
validates :gitaly_timeout_fast,
presence: true,
if: :gitaly_timeout_fast_changed?,
numericality: { only_integer: true, greater_than_or_equal_to: 0 }
validates :gitaly_timeout_fast,
numericality: { less_than_or_equal_to: :gitaly_timeout_default },
Loading
Loading
Loading
Loading
@@ -107,7 +107,7 @@ class ProjectWiki
direction_desc: direction == DIRECTION_DESC,
load_content: load_content
).map do |page|
WikiPage.new(self, page, true)
WikiPage.new(self, page)
end
end
 
Loading
Loading
@@ -122,7 +122,7 @@ class ProjectWiki
page_title, page_dir = page_title_and_dir(title)
 
if page = wiki.page(title: page_title, version: version, dir: page_dir)
WikiPage.new(self, page, true)
WikiPage.new(self, page)
end
end
 
Loading
Loading
Loading
Loading
@@ -70,10 +70,9 @@ class WikiPage
Gitlab::HookData::WikiPageBuilder.new(self).build
end
 
def initialize(wiki, page = nil, persisted = false)
def initialize(wiki, page = nil)
@wiki = wiki
@page = page
@persisted = persisted
@attributes = {}.with_indifferent_access
 
set_attributes if persisted?
Loading
Loading
@@ -94,11 +93,7 @@ class WikiPage
 
# The formatted title of this page.
def title
if @attributes[:title]
CGI.unescape_html(self.class.unhyphenize(@attributes[:title]))
else
""
end
@attributes[:title] || ''
end
 
# Sets the title of this page.
Loading
Loading
@@ -176,7 +171,7 @@ class WikiPage
# Returns boolean True or False if this instance
# has been fully created on disk or not.
def persisted?
@persisted == true
@page.present?
end
 
# Creates a new Wiki Page.
Loading
Loading
@@ -196,7 +191,7 @@ class WikiPage
def create(attrs = {})
update_attributes(attrs)
 
save(page_details: title) do
save do
wiki.create_page(title, content, format, attrs[:message])
end
end
Loading
Loading
@@ -222,18 +217,12 @@ class WikiPage
 
update_attributes(attrs)
 
if title_changed?
page_details = title
if wiki.find_page(page_details).present?
@attributes[:title] = @page.url_path
raise PageRenameError
end
else
page_details = @page.url_path
if title.present? && title_changed? && wiki.find_page(title).present?
@attributes[:title] = @page.title
raise PageRenameError
end
 
save(page_details: page_details) do
save do
wiki.update_page(
@page,
content: content,
Loading
Loading
@@ -266,7 +255,14 @@ class WikiPage
end
 
def title_changed?
title.present? && (@page.nil? || self.class.unhyphenize(@page.url_path) != title)
if persisted?
old_title, old_dir = wiki.page_title_and_dir(self.class.unhyphenize(@page.url_path))
new_title, new_dir = wiki.page_title_and_dir(title)
new_title != old_title || (title.include?('/') && new_dir != old_dir)
else
title.present?
end
end
 
# Updates the current @attributes hash by merging a hash of params
Loading
Loading
@@ -313,26 +309,24 @@ class WikiPage
attributes[:format] = @page.format
end
 
def save(page_details:)
return unless valid?
def save
return false unless valid?
 
unless yield
errors.add(:base, wiki.error_message)
return false
end
 
page_title, page_dir = wiki.page_title_and_dir(page_details)
gitlab_git_wiki = wiki.wiki
@page = gitlab_git_wiki.page(title: page_title, dir: page_dir)
@page = wiki.find_page(title).page
set_attributes
@persisted = errors.blank?
true
end
 
def validate_path_limits
*dirnames, title = @attributes[:title].split('/')
 
if title.bytesize > MAX_TITLE_BYTES
if title && title.bytesize > MAX_TITLE_BYTES
errors.add(:title, _("exceeds the limit of %{bytes} bytes") % { bytes: MAX_TITLE_BYTES })
end
 
Loading
Loading
Loading
Loading
@@ -10,6 +10,11 @@
= _('Analytics')
 
%ul.sidebar-sub-level-items{ data: { qa_selector: 'analytics_sidebar_submenu' } }
= nav_link(path: navbar_links.first.path, html_options: { class: "fly-out-top-item" } ) do
= link_to navbar_links.first.link do
%strong.fly-out-top-item-name
= _('Analytics')
%li.divider.fly-out-top-item
- navbar_links.each do |menu_item|
= nav_link(path: menu_item.path) do
= link_to(menu_item.link, menu_item.link_to_options) do
Loading
Loading
Loading
Loading
@@ -19,9 +19,3 @@
%p.prepend-top-default
= _("You must have permission to create a project in a namespace before forking.")
 
.save-project-loader.hide.js-fork-content
%h2.text-center
= icon('spinner spin')
= _("Forking repository")
%p.text-center
= _("Please wait a moment, this page will automatically refresh when ready.")
Loading
Loading
@@ -12,7 +12,7 @@
.form-group.row
.col-sm-12= f.label :title, class: 'control-label-full-width'
.col-sm-12
= f.text_field :title, class: 'form-control qa-wiki-title-textbox', value: @page.title, required: true, autofocus: !@page.persisted?, placeholder: _('Wiki|Page title')
= f.text_field :title, class: 'form-control qa-wiki-title-textbox', value: @page.title, required: true, autofocus: !@page.persisted?, placeholder: s_('Wiki|Page title')
%span.d-inline-block.mw-100.prepend-top-5
= icon('lightbulb-o')
- if @page.persisted?
Loading
Loading
---
title: Tweak wiki page title handling
merge_request: 25647
author:
type: changed
---
title: Fix ImportFailure when restore ci_pipelines:external_pull_request relation
merge_request: 26041
author:
type: fixed
---
title: Add title to Analytics sidebar menus
merge_request: 26265
author:
type: added
---
title: Remove .fa-spinner from app/views/projects/forks
merge_request: 25034
author: nuwe1
type: other
---
title: Add admin API endpoint to delete Sidekiq jobs matching metadata
merge_request: 25998
author:
type: added
---
title: Fix saving preferences with unrelated changes when gitaly timeouts became invalid.
merge_request: 26292
author:
type: fixed
---
title: All image diffs (except for renamed files) show the image file size in the
diff
merge_request: 25734
author:
type: added
---
title: Change tooltip text for pipeline on last commit widget
merge_request: 26315
author:
type: other
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