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

Add latest changes from gitlab-org/gitlab@master

parent b375c6c0
No related branches found
No related tags found
No related merge requests found
Showing
with 245 additions and 246 deletions
Loading
Loading
@@ -493,13 +493,6 @@
changes: *code-backstage-patterns
when: on_success
 
.test-metadata:rules:flaky-examples-check:
rules:
- <<: *if-merge-request
changes: *code-backstage-patterns
when: on_success
##############
# YAML rules #
##############
Loading
Loading
Loading
Loading
@@ -37,22 +37,3 @@ update-tests-metadata:
- retry gem install fog-aws mime-types activesupport rspec_profiling postgres-copy --no-document
- source scripts/rspec_helpers.sh
- update_tests_metadata
flaky-examples-check:
extends:
- .default-tags
- .default-retry
- .test-metadata:rules:flaky-examples-check
image: ruby:2.6-alpine
stage: post-test
variables:
NEW_FLAKY_SPECS_REPORT: rspec_flaky/report-new.json
allow_failure: true
artifacts:
expire_in: 30d
paths:
- rspec_flaky/
script:
- '[[ -f $NEW_FLAKY_SPECS_REPORT ]] || echo "{}" > ${NEW_FLAKY_SPECS_REPORT}'
- scripts/merge-reports ${NEW_FLAKY_SPECS_REPORT} rspec_flaky/new_*_*.json
- scripts/flaky_examples/detect-new-flaky-examples $NEW_FLAKY_SPECS_REPORT
Loading
Loading
@@ -349,8 +349,8 @@ RSpec/HaveGitlabHttpStatus:
- 'ee/spec/requests/{groups,projects,repositories}/**/*'
- 'spec/requests/api/*/**/*.rb'
- 'ee/spec/requests/api/*/**/*.rb'
- 'spec/requests/api/[a-p]*.rb'
- 'ee/spec/requests/api/[a-p]*.rb'
- 'spec/requests/api/[a-s]*.rb'
- 'ee/spec/requests/api/[a-s]*.rb'
 
Style/MultilineWhenThen:
Enabled: false
Loading
Loading
Loading
Loading
@@ -374,7 +374,7 @@ group :development, :test do
 
gem 'scss_lint', '~> 0.56.0', require: false
gem 'haml_lint', '~> 0.34.0', require: false
gem 'simplecov', '~> 0.16.1', require: false
gem 'simplecov', '~> 0.18.5', require: false
gem 'bundler-audit', '~> 0.6.1', require: false
 
gem 'benchmark-ips', '~> 2.3.0', require: false
Loading
Loading
Loading
Loading
@@ -240,7 +240,7 @@ GEM
diffy (3.3.0)
discordrb-webhooks-blackst0ne (3.3.0)
rest-client (~> 2.0)
docile (1.3.1)
docile (1.3.2)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0)
doorkeeper (5.0.2)
Loading
Loading
@@ -1015,11 +1015,10 @@ GEM
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simple_po_parser (1.1.2)
simplecov (0.16.1)
simplecov (0.18.5)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
simplecov-html (~> 0.11)
simplecov-html (0.12.2)
sixarm_ruby_unaccent (1.2.0)
slack-messenger (2.3.3)
snowplow-tracker (0.6.1)
Loading
Loading
@@ -1375,7 +1374,7 @@ DEPENDENCIES
sidekiq (~> 5.2.7)
sidekiq-cron (~> 1.0)
simple_po_parser (~> 1.1.2)
simplecov (~> 0.16.1)
simplecov (~> 0.18.5)
slack-messenger (~> 2.3.3)
snowplow-tracker (~> 0.6.1)
spring (~> 2.0.0)
Loading
Loading
Loading
Loading
@@ -468,6 +468,7 @@ export default {
ref="addMetricBtn"
v-gl-modal="$options.addMetric.modalId"
variant="outline-success"
data-qa-selector="add_metric_button"
class="mr-2 mt-1"
>{{ $options.addMetric.title }}</gl-button
>
Loading
Loading
Loading
Loading
@@ -5,10 +5,10 @@ module Mutations
extend ActiveSupport::Concern
 
def resolve_group(full_path:)
resolver.resolve(full_path: full_path)
group_resolver.resolve(full_path: full_path)
end
 
def resolver
def group_resolver
Resolvers::GroupResolver.new(object: nil, context: context)
end
end
Loading
Loading
# frozen_string_literal: true
module Mutations
module ResolvesIssuable
extend ActiveSupport::Concern
include Mutations::ResolvesProject
def resolve_issuable(type:, parent_path:, iid:)
parent = resolve_issuable_parent(parent_path)
issuable_resolver(type, parent, context).resolve(iid: iid.to_s)
end
def issuable_resolver(type, parent, context)
resolver_class = "Resolvers::#{type.to_s.classify.pluralize}Resolver".constantize
resolver_class.single.new(object: parent, context: context)
end
def resolve_issuable_parent(parent_path)
resolve_project(full_path: parent_path)
end
end
end
Loading
Loading
@@ -5,10 +5,10 @@ module Mutations
extend ActiveSupport::Concern
 
def resolve_project(full_path:)
resolver.resolve(full_path: full_path)
project_resolver.resolve(full_path: full_path)
end
 
def resolver
def project_resolver
Resolvers::ProjectResolver.new(object: nil, context: context)
end
end
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@
module Mutations
module Issues
class Base < BaseMutation
include Mutations::ResolvesProject
include Mutations::ResolvesIssuable
 
argument :project_path, GraphQL::ID_TYPE,
required: true,
Loading
Loading
@@ -23,11 +23,7 @@ module Mutations
private
 
def find_object(project_path:, iid:)
project = resolve_project(full_path: project_path)
resolver = Resolvers::IssuesResolver
.single.new(object: project, context: context)
resolver.resolve(iid: iid)
resolve_issuable(type: :issue, parent_path: project_path, iid: iid)
end
end
end
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@
module Mutations
module MergeRequests
class Base < BaseMutation
include Mutations::ResolvesProject
include Mutations::ResolvesIssuable
 
argument :project_path, GraphQL::ID_TYPE,
required: true,
Loading
Loading
@@ -23,11 +23,7 @@ module Mutations
private
 
def find_object(project_path:, iid:)
project = resolve_project(full_path: project_path)
resolver = Resolvers::MergeRequestsResolver
.single.new(object: project, context: context)
resolver.resolve(iid: iid)
resolve_issuable(type: :merge_request, parent_path: project_path, iid: iid)
end
end
end
Loading
Loading
Loading
Loading
@@ -3,18 +3,23 @@
module FormHelper
prepend_if_ee('::EE::FormHelper') # rubocop: disable Cop/InjectEnterpriseEditionModule
 
def form_errors(model, type: 'form')
def form_errors(model, type: 'form', truncate: [])
return unless model.errors.any?
 
headline = n_('The %{type} contains the following error:', 'The %{type} contains the following errors:', model.errors.count) % { type: type }
truncate = Array.wrap(truncate)
 
content_tag(:div, class: 'alert alert-danger', id: 'error_explanation') do
content_tag(:h4, headline) <<
content_tag(:ul) do
model.errors.full_messages
.map { |msg| content_tag(:li, msg) }
.join
.html_safe
messages = model.errors.map do |attribute, message|
message = model.errors.full_message(attribute, message)
message = content_tag(:span, message, class: 'str-truncated-100') if truncate.include?(attribute)
content_tag(:li, message)
end
messages.join.html_safe
end
end
end
Loading
Loading
Loading
Loading
@@ -333,11 +333,15 @@ class WikiPage
*dirnames, title = @attributes[:title].split('/')
 
if title.bytesize > MAX_TITLE_BYTES
errors.add(:title, _("exceeds the limit of %{bytes} bytes for page titles") % { bytes: MAX_TITLE_BYTES })
errors.add(:title, _("exceeds the limit of %{bytes} bytes") % { bytes: MAX_TITLE_BYTES })
end
 
if dirnames.any? { |d| d.bytesize > MAX_DIRECTORY_BYTES }
errors.add(:title, _("exceeds the limit of %{bytes} bytes for directory names") % { bytes: MAX_DIRECTORY_BYTES })
invalid_dirnames = dirnames.select { |d| d.bytesize > MAX_DIRECTORY_BYTES }
invalid_dirnames.each do |dirname|
errors.add(:title, _('exceeds the limit of %{bytes} bytes for directory name "%{dirname}"') % {
bytes: MAX_DIRECTORY_BYTES,
dirname: dirname
})
end
end
end
Loading
Loading
@@ -4,7 +4,7 @@
= form_for [@project.namespace.becomes(Namespace), @project, @page], method: @page.persisted? ? :put : :post,
html: { class: form_classes },
data: { uploads_path: uploads_path } do |f|
= form_errors(@page)
= form_errors(@page, truncate: :title)
 
- if @page.persisted?
= f.hidden_field :last_commit_sha, value: @page.last_commit_sha
Loading
Loading
This diff is collapsed.
Loading
Loading
@@ -5,7 +5,7 @@ class AuthorizedProjectsWorker # rubocop:disable Scalability/IdempotentWorker
prepend WaitableWorker
 
feature_category :authentication_and_authorization
latency_sensitive_worker!
urgency :high
weight 2
 
# This is a workaround for a Ruby 2.3.7 bug. rspec-mocks cannot restore the
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ class BuildFinishedWorker # rubocop:disable Scalability/IdempotentWorker
include PipelineQueue
 
queue_namespace :pipeline_processing
latency_sensitive_worker!
urgency :high
worker_resource_boundary :cpu
 
# rubocop: disable CodeReuse/ActiveRecord
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ class BuildHooksWorker # rubocop:disable Scalability/IdempotentWorker
 
queue_namespace :pipeline_hooks
feature_category :continuous_integration
latency_sensitive_worker!
urgency :high
 
# rubocop: disable CodeReuse/ActiveRecord
def perform(build_id)
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ class BuildQueueWorker # rubocop:disable Scalability/IdempotentWorker
 
queue_namespace :pipeline_processing
feature_category :continuous_integration
latency_sensitive_worker!
urgency :high
worker_resource_boundary :cpu
 
# rubocop: disable CodeReuse/ActiveRecord
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ class BuildSuccessWorker # rubocop:disable Scalability/IdempotentWorker
include PipelineQueue
 
queue_namespace :pipeline_processing
latency_sensitive_worker!
urgency :high
 
# rubocop: disable CodeReuse/ActiveRecord
def perform(build_id)
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