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

Add latest changes from gitlab-org/gitlab@master

parent d64e3a8b
No related branches found
No related tags found
No related merge requests found
Showing
with 188 additions and 50 deletions
Loading
Loading
@@ -4162,7 +4162,7 @@ Please view this file on the master branch, on stable branches it's out of date.
- Show hook errors for fast-forward merges. !1375
- Allow all parameters of group webhooks to be set through the UI. !1376
- Fix Elasticsearch queries when a group_id is specified. !1423
- Check the right index mapping based on Rails environment for rake gitlab:elastic:add_feature_visiblity_levels_to_project. !1473
- Check the right index mapping based on Rails environment for rake gitlab:elastic:add_feature_visibility_levels_to_project. !1473
- Fix issues with another milestone that has a matching list label could not be added to a board.
- Only admins or group owners can set LDAP overrides.
- Add support for load balancing database queries.
Loading
Loading
Loading
Loading
@@ -80,14 +80,16 @@ GEM
encryptor (~> 3.0.0)
attr_required (1.0.1)
awesome_print (1.8.0)
aws-sdk (2.9.32)
aws-sdk-resources (= 2.9.32)
aws-sdk-core (2.9.32)
aws-eventstream (1.0.3)
aws-sdk (2.11.374)
aws-sdk-resources (= 2.11.374)
aws-sdk-core (2.11.374)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-resources (2.9.32)
aws-sdk-core (= 2.9.32)
aws-sigv4 (1.0.0)
aws-sdk-resources (2.11.374)
aws-sdk-core (= 2.11.374)
aws-sigv4 (1.1.0)
aws-eventstream (~> 1.0, >= 1.0.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
Loading
Loading
@@ -506,7 +508,7 @@ GEM
atlassian-jwt
multipart-post
oauth (~> 0.5, >= 0.5.0)
jmespath (1.3.1)
jmespath (1.4.0)
js_regex (3.1.1)
character_set (~> 1.1)
regexp_parser (~> 1.1)
Loading
Loading
Loading
Loading
@@ -41,7 +41,7 @@ export default {
noForkText() {
return sprintf(
__(
"To protect this issue's confidentiality, %{link_start}fork the project%{link_end} and set the forks visiblity to private.",
"To protect this issue's confidentiality, %{link_start}fork the project%{link_end} and set the forks visibility to private.",
),
{ link_start: `<a href="${this.newForkPath}" class="help-link">`, link_end: '</a>' },
false,
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ class Admin::ProjectsFinder
def execute
items = Project.without_deleted.with_statistics.with_route
items = by_namespace_id(items)
items = by_visibilty_level(items)
items = by_visibility_level(items)
items = by_with_push(items)
items = by_abandoned(items)
items = by_last_repository_check_failed(items)
Loading
Loading
@@ -31,7 +31,7 @@ class Admin::ProjectsFinder
end
 
# rubocop: disable CodeReuse/ActiveRecord
def by_visibilty_level(items)
def by_visibility_level(items)
params[:visibility_level].present? ? items.where(visibility_level: params[:visibility_level]) : items
end
# rubocop: enable CodeReuse/ActiveRecord
Loading
Loading
Loading
Loading
@@ -201,9 +201,9 @@ module VisibilityLevelHelper
 
def visibility_level_errors_for_group(group, level_name)
group_name = link_to group.name, group_path(group)
change_visiblity = link_to 'change the visibility', edit_group_path(group)
change_visibility = link_to 'change the visibility', edit_group_path(group)
 
{ reason: "the visibility of #{group_name} is #{group.visibility}",
instruction: " To make this group #{level_name}, you must first #{change_visiblity} of the parent group." }
instruction: " To make this group #{level_name}, you must first #{change_visibility} of the parent group." }
end
end
---
title: Make Bitbucket Cloud superseded pull requests as closed
merge_request: 19193
author:
type: fixed
---
title: Update AWS SDK to 2.11.374
merge_request: 18601
author:
type: other
Loading
Loading
@@ -16,9 +16,10 @@ module Bitbucket
end
 
def state
if raw['state'] == 'MERGED'
case raw['state']
when 'MERGED'
'merged'
elsif raw['state'] == 'DECLINED'
when 'DECLINED', 'SUPERSEDED'
'closed'
else
'opened'
Loading
Loading
Loading
Loading
@@ -50,7 +50,6 @@ module Gitlab
validates :timeout, duration: { limit: ChronicDuration.output(Project::MAX_BUILD_TIMEOUT) }
 
validates :dependencies, array_of_strings: true
validates :needs, array_of_strings: true
validates :extends, array_of_strings_or_string: true
validates :rules, array_of_hashes: true
end
Loading
Loading
@@ -114,6 +113,11 @@ module Gitlab
description: 'List of evaluable Rules to determine job inclusion.',
inherit: false
 
entry :needs, Entry::Needs,
description: 'Needs configuration for this job.',
metadata: { allowed_needs: %i[job] },
inherit: false
entry :variables, Entry::Variables,
description: 'Environment variables available for this job.',
inherit: false
Loading
Loading
# frozen_string_literal: true
module Gitlab
module Ci
class Config
module Entry
class Need < ::Gitlab::Config::Entry::Simplifiable
strategy :Job, if: -> (config) { config.is_a?(String) }
class Job < ::Gitlab::Config::Entry::Node
include ::Gitlab::Config::Entry::Validatable
validations do
validates :config, presence: true
validates :config, type: String
end
def type
:job
end
def value
{ name: @config }
end
end
class UnknownStrategy < ::Gitlab::Config::Entry::Node
def type
end
def value
end
def errors
["#{location} has an unsupported type"]
end
end
end
end
end
end
end
::Gitlab::Ci::Config::Entry::Need.prepend_if_ee('::EE::Gitlab::Ci::Config::Entry::Need')
# frozen_string_literal: true
module Gitlab
module Ci
class Config
module Entry
##
# Entry that represents a set of needs dependencies.
#
class Needs < ::Gitlab::Config::Entry::Node
include ::Gitlab::Config::Entry::Validatable
validations do
validates :config, presence: true
validate do
unless config.is_a?(Hash) || config.is_a?(Array)
errors.add(:config, 'can only be a Hash or an Array')
end
end
validate on: :composed do
extra_keys = value.keys - opt(:allowed_needs)
if extra_keys.any?
errors.add(:config, "uses invalid types: #{extra_keys.join(', ')}")
end
end
end
def compose!(deps = nil)
super(deps) do
[@config].flatten.each_with_index do |need, index|
@entries[index] = ::Gitlab::Config::Entry::Factory.new(Entry::Need)
.value(need)
.with(key: "need", parent: self, description: "need definition.") # rubocop:disable CodeReuse/ActiveRecord
.create!
end
@entries.each_value do |entry|
entry.compose!(deps)
end
end
end
def value
values = @entries.values.select(&:type)
values.group_by(&:type).transform_values do |values|
values.map(&:value)
end
end
end
end
end
end
end
Loading
Loading
@@ -40,7 +40,7 @@ module Gitlab
environment: job[:environment_name],
coverage_regex: job[:coverage],
yaml_variables: yaml_variables(name),
needs_attributes: job[:needs]&.map { |need| { name: need } },
needs_attributes: job.dig(:needs, :job),
interruptible: job[:interruptible],
rules: job[:rules],
options: {
Loading
Loading
@@ -59,7 +59,7 @@ module Gitlab
instance: job[:instance],
start_in: job[:start_in],
trigger: job[:trigger],
bridge_needs: job[:needs]
bridge_needs: job.dig(:needs, :bridge)&.first
}.compact }.compact
end
 
Loading
Loading
@@ -159,17 +159,19 @@ module Gitlab
end
 
def validate_job_needs!(name, job)
return unless job[:needs]
return unless job.dig(:needs, :job)
 
stage_index = @stages.index(job[:stage])
 
job[:needs].each do |need|
raise ValidationError, "#{name} job: undefined need: #{need}" unless @jobs[need.to_sym]
job.dig(:needs, :job).each do |need|
need_job_name = need[:name]
 
needs_stage_index = @stages.index(@jobs[need.to_sym][:stage])
raise ValidationError, "#{name} job: undefined need: #{need_job_name}" unless @jobs[need_job_name.to_sym]
needs_stage_index = @stages.index(@jobs[need_job_name.to_sym][:stage])
 
unless needs_stage_index.present? && needs_stage_index < stage_index
raise ValidationError, "#{name} job: need #{need} is not defined in prior stages"
raise ValidationError, "#{name} job: need #{need_job_name} is not defined in prior stages"
end
end
end
Loading
Loading
Loading
Loading
@@ -29,22 +29,24 @@ module Gitlab
def compose!(deps = nil)
return unless valid?
 
self.class.nodes.each do |key, factory|
# If we override the config type validation
# we can end with different config types like String
next unless config.is_a?(Hash)
super do
self.class.nodes.each do |key, factory|
# If we override the config type validation
# we can end with different config types like String
next unless config.is_a?(Hash)
 
factory
.value(config[key])
.with(key: key, parent: self)
factory
.value(config[key])
.with(key: key, parent: self)
 
entries[key] = factory.create!
end
entries[key] = factory.create!
end
 
yield if block_given?
yield if block_given?
 
entries.each_value do |entry|
entry.compose!(deps)
entries.each_value do |entry|
entry.compose!(deps)
end
end
end
# rubocop: enable CodeReuse/ActiveRecord
Loading
Loading
@@ -67,12 +69,13 @@ module Gitlab
private
 
# rubocop: disable CodeReuse/ActiveRecord
def entry(key, entry, description: nil, default: nil, inherit: nil, reserved: nil)
def entry(key, entry, description: nil, default: nil, inherit: nil, reserved: nil, metadata: {})
factory = ::Gitlab::Config::Entry::Factory.new(entry)
.with(description: description)
.with(default: default)
.with(inherit: inherit)
.with(reserved: reserved)
.metadata(metadata)
 
(@nodes ||= {}).merge!(key.to_sym => factory)
end
Loading
Loading
Loading
Loading
@@ -112,6 +112,10 @@ module Gitlab
@aspects ||= []
end
 
def self.with_aspect(blk)
self.aspects.append(blk)
end
private
 
attr_reader :entries
Loading
Loading
Loading
Loading
@@ -4,11 +4,11 @@ module Gitlab
module Config
module Entry
class Simplifiable < SimpleDelegator
EntryStrategy = Struct.new(:name, :condition)
EntryStrategy = Struct.new(:name, :klass, :condition)
 
attr_reader :subject
 
def initialize(config, **metadata)
def initialize(config, **metadata, &blk)
unless self.class.const_defined?(:UnknownStrategy)
raise ArgumentError, 'UndefinedStrategy not available!'
end
Loading
Loading
@@ -19,14 +19,13 @@ module Gitlab
 
entry = self.class.entry_class(strategy)
 
@subject = entry.new(config, metadata)
@subject = entry.new(config, metadata, &blk)
 
yield(@subject) if block_given?
super(@subject)
end
 
def self.strategy(name, **opts)
EntryStrategy.new(name, opts.fetch(:if)).tap do |strategy|
EntryStrategy.new(name, opts.dig(:class), opts.fetch(:if)).tap do |strategy|
strategies.append(strategy)
end
end
Loading
Loading
@@ -37,7 +36,7 @@ module Gitlab
 
def self.entry_class(strategy)
if strategy.present?
self.const_get(strategy.name, false)
strategy.klass || self.const_get(strategy.name, false)
else
self::UnknownStrategy
end
Loading
Loading
Loading
Loading
@@ -7,14 +7,27 @@ module Gitlab
extend ActiveSupport::Concern
 
def self.included(node)
node.aspects.append -> do
@validator = self.class.validator.new(self)
@validator.validate(:new)
node.with_aspect -> do
validate(:new)
end
end
 
def validator
@validator ||= self.class.validator.new(self)
end
def validate(context = nil)
validator.validate(context)
end
def compose!(deps = nil, &blk)
super(deps, &blk)
validate(:composed)
end
def errors
@validator.messages + descendants.flat_map(&:errors) # rubocop:disable Gitlab/ModuleWithInstanceVariables
validator.messages + descendants.flat_map(&:errors)
end
 
class_methods do
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ module Quality
@namespace = namespace
end
 
def cleanup(release_name:)
def cleanup(release_name:, wait: true)
selector = case release_name
when String
%(-l release="#{release_name}")
Loading
Loading
@@ -29,6 +29,7 @@ module Quality
'--now',
'--ignore-not-found',
'--include-uninitialized',
%(--wait=#{wait}),
selector
]
 
Loading
Loading
Loading
Loading
@@ -16734,7 +16734,7 @@ msgstr ""
msgid "To preserve performance only <strong>%{display_size} of %{real_size}</strong> files are displayed."
msgstr ""
 
msgid "To protect this issue's confidentiality, %{link_start}fork the project%{link_end} and set the forks visiblity to private."
msgid "To protect this issue's confidentiality, %{link_start}fork the project%{link_end} and set the forks visibility to private."
msgstr ""
 
msgid "To protect this issue's confidentiality, a private fork of this project was selected."
Loading
Loading
Loading
Loading
@@ -16382,7 +16382,7 @@ msgstr ""
msgid "To preserve performance only <strong>%{display_size} of %{real_size}</strong> files are displayed."
msgstr ""
 
msgid "To protect this issue's confidentiality, %{link_start}fork the project%{link_end} and set the forks visiblity to private."
msgid "To protect this issue's confidentiality, %{link_start}fork the project%{link_end} and set the forks visibility to private."
msgstr ""
 
msgid "To protect this issue's confidentiality, a private fork of this project was selected."
Loading
Loading
Loading
Loading
@@ -16382,7 +16382,7 @@ msgstr ""
msgid "To preserve performance only <strong>%{display_size} of %{real_size}</strong> files are displayed."
msgstr ""
 
msgid "To protect this issue's confidentiality, %{link_start}fork the project%{link_end} and set the forks visiblity to private."
msgid "To protect this issue's confidentiality, %{link_start}fork the project%{link_end} and set the forks visibility to private."
msgstr ""
 
msgid "To protect this issue's confidentiality, a private fork of this project was selected."
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