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

Add latest changes from gitlab-org/gitlab@master

parent 4ab54c22
No related branches found
No related tags found
No related merge requests found
Showing
with 49 additions and 27 deletions
Loading
Loading
@@ -15,7 +15,7 @@ class RootController < Dashboard::ProjectsController
before_action :redirect_logged_user, if: -> { current_user.present? }
 
def index
# n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/40260
# n+1: https://gitlab.com/gitlab-org/gitlab-foss/issues/40260
Gitlab::GitalyClient.allow_n_plus_1_calls do
super
end
Loading
Loading
Loading
Loading
@@ -51,7 +51,7 @@ class EnvironmentsFinder
# efficient way to get relevant environment entries.
# Currently, `#execute` method has a serious technical debt and
# we will likely rework on it in the future.
# See more https://gitlab.com/gitlab-org/gitlab-ce/issues/63381
# See more https://gitlab.com/gitlab-org/gitlab-foss/issues/63381
def find
environments = project.environments
environments = by_name(environments)
Loading
Loading
Loading
Loading
@@ -47,11 +47,12 @@ class TodosFinder
sort(items)
end
 
# Returns `true` if the current user has any todos for the given target.
# Returns `true` if the current user has any todos for the given target with the optional given state.
#
# target - The value of the `target_type` column, such as `Issue`.
def any_for_target?(target)
current_user.todos.any_for_target?(target)
# state - The value of the `state` column, such as `pending` or `done`.
def any_for_target?(target, state = nil)
current_user.todos.any_for_target?(target, state)
end
 
private
Loading
Loading
Loading
Loading
@@ -7,7 +7,7 @@ module Resolvers
prepended do
argument :full_path, GraphQL::ID_TYPE,
required: true,
description: 'The full path of the project, group or namespace, e.g., "gitlab-org/gitlab-ce"'
description: 'The full path of the project, group or namespace, e.g., "gitlab-org/gitlab-foss"'
end
 
def model_by_full_path(model, full_path)
Loading
Loading
Loading
Loading
@@ -50,7 +50,7 @@ module Resolvers
return Issue.none if project.nil?
 
# Will need to be be made group & namespace aware with
# https://gitlab.com/gitlab-org/gitlab-ce/issues/54520
# https://gitlab.com/gitlab-org/gitlab-foss/issues/54520
args[:project_id] = project.id
args[:iids] ||= [args[:iid]].compact
 
Loading
Loading
Loading
Loading
@@ -184,10 +184,10 @@ module ApplicationSettingsHelper
:disabled_oauth_sign_in_sources,
:domain_blacklist,
:domain_blacklist_enabled,
# TODO Remove domain_blacklist_raw in APIv5 (See https://gitlab.com/gitlab-org/gitlab-ce/issues/67204)
# TODO Remove domain_blacklist_raw in APIv5 (See https://gitlab.com/gitlab-org/gitlab-foss/issues/67204)
:domain_blacklist_raw,
:domain_whitelist,
# TODO Remove domain_whitelist_raw in APIv5 (See https://gitlab.com/gitlab-org/gitlab-ce/issues/67204)
# TODO Remove domain_whitelist_raw in APIv5 (See https://gitlab.com/gitlab-org/gitlab-foss/issues/67204)
:domain_whitelist_raw,
:outbound_local_requests_whitelist_raw,
:dsa_key_restriction,
Loading
Loading
Loading
Loading
@@ -88,7 +88,7 @@ module BoardsHelper
end
 
def boards_link_text
if current_board_parent.multiple_issue_boards_available?
if multiple_boards_available?
s_("IssueBoards|Boards")
else
s_("IssueBoards|Board")
Loading
Loading
Loading
Loading
@@ -189,11 +189,9 @@ module DiffHelper
params[:w] == '1'
end
 
# rubocop: disable CodeReuse/ActiveRecord
def params_with_whitespace
hide_whitespace? ? request.query_parameters.except(:w) : request.query_parameters.merge(w: 1)
end
# rubocop: enable CodeReuse/ActiveRecord
 
def toggle_whitespace_link(url, options)
options[:class] = [*options[:class], 'btn btn-default'].join(' ')
Loading
Loading
Loading
Loading
@@ -102,7 +102,7 @@ module EmailsHelper
end
when String
# Technically speaking this should be Commit but per
# https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15610#note_163812339
# https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/15610#note_163812339
# we can't deserialize Commit without custom serializer for ActiveJob
return "" unless Ability.allowed?(@recipient, :download_code, @project)
 
Loading
Loading
Loading
Loading
@@ -272,7 +272,7 @@ module IssuablesHelper
markdownPreviewPath: preview_markdown_path(parent),
markdownDocsPath: help_page_path('user/markdown'),
lockVersion: issuable.lock_version,
issuableTemplates: issuable_templates(issuable),
issuableTemplateNamesPath: template_names_path(parent, issuable),
initialTitleHtml: markdown_field(issuable, :title),
initialTitleText: issuable.title,
initialDescriptionHtml: markdown_field(issuable, :description),
Loading
Loading
@@ -429,6 +429,12 @@ module IssuablesHelper
end
end
 
def template_names_path(parent, issuable)
return '' unless parent.is_a?(Project)
project_template_names_path(parent, template_type: issuable.class.name.underscore)
end
def issuable_sidebar_options(issuable)
{
endpoint: "#{issuable[:issuable_json_path]}?serializer=sidebar_extras",
Loading
Loading
Loading
Loading
@@ -235,7 +235,6 @@ module ProjectsHelper
#
# If no limit is applied we'll just issue a COUNT since the result set could
# be too large to load into memory.
# rubocop: disable CodeReuse/ActiveRecord
def any_projects?(projects)
return projects.any? if projects.is_a?(Array)
 
Loading
Loading
@@ -245,10 +244,9 @@ module ProjectsHelper
projects.except(:offset).any?
end
end
# rubocop: enable CodeReuse/ActiveRecord
 
# TODO: Remove this method when removing the feature flag
# https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/11209#note_162234863
# https://gitlab.com/gitlab-org/gitlab/merge_requests/11209#note_162234863
# make sure to remove from the EE specific controller as well: ee/app/controllers/ee/dashboard/projects_controller.rb
def show_projects?(projects, params)
Feature.enabled?(:project_list_filter_bar) || !!(params[:personal] || params[:name] || any_projects?(projects))
Loading
Loading
Loading
Loading
@@ -30,7 +30,7 @@ module RunnersHelper
end
 
# Due to inability of performing sorting of runners by cached "contacted_at" values we have to show uncached values if sorting by "contacted_asc" is requested.
# Please refer to the following issue for more details: https://gitlab.com/gitlab-org/gitlab-ce/issues/55920
# Please refer to the following issue for more details: https://gitlab.com/gitlab-org/gitlab-foss/issues/55920
def runner_contacted_at(runner)
if params[:sort] == 'contacted_asc'
runner.uncached_contacted_at
Loading
Loading
Loading
Loading
@@ -3,7 +3,6 @@
module SafeParamsHelper
# Rails 5.0 requires to permit `params` if they're used in url helpers.
# Use this helper when generating links with `params.merge(...)`
# rubocop: disable CodeReuse/ActiveRecord
def safe_params
if params.respond_to?(:permit!)
params.except(:host, :port, :protocol).permit!
Loading
Loading
@@ -11,5 +10,4 @@ module SafeParamsHelper
params
end
end
# rubocop: enable CodeReuse/ActiveRecord
end
Loading
Loading
@@ -64,7 +64,7 @@ module Ci
# `ci_builds` creation. We can look up a relevant `environment` through
# `deployment` relation today. This is much more efficient than expanding
# environment name with variables.
# (See more https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22380)
# (See more https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/22380)
#
# However, we have to still expand environment name if it's a stop action,
# because `deployment` persists information for start action only.
Loading
Loading
Loading
Loading
@@ -373,7 +373,7 @@ module Ci
 
##
# TODO We do not completely switch to persisted stages because of
# race conditions with setting statuses gitlab-ce#23257.
# race conditions with setting statuses gitlab-foss#23257.
#
def ordered_stages
return legacy_stages unless complete?
Loading
Loading
@@ -386,7 +386,7 @@ module Ci
end
 
def legacy_stages
# TODO, this needs refactoring, see gitlab-ce#26481.
# TODO, this needs refactoring, see gitlab-foss#26481.
 
stages_query = statuses
.group('stage').select(:stage).order('max(stage_idx)')
Loading
Loading
Loading
Loading
@@ -35,6 +35,10 @@ module Clusters
'stable/nginx-ingress'
end
 
def values
content_values.to_yaml
end
def allowed_to_uninstall?
external_ip_or_hostname? && application_jupyter_nil_or_installable?
end
Loading
Loading
@@ -67,6 +71,23 @@ module Clusters
 
private
 
def specification
return {} unless Feature.enabled?(:ingress_modsecurity)
{
"controller" => {
"config" => {
"enable-modsecurity" => "true",
"enable-owasp-modsecurity-crs" => "true"
}
}
}
end
def content_values
YAML.load_file(chart_values_file).deep_merge!(specification)
end
def application_jupyter_nil_or_installable?
cluster.application_jupyter.nil? || cluster.application_jupyter&.installable?
end
Loading
Loading
Loading
Loading
@@ -234,7 +234,7 @@ module Clusters
# as the AUTO_DEVOPS_DOMAIN is needed for CI_ENVIRONMENT_URL
#
# This method should is scheduled to be removed on
# https://gitlab.com/gitlab-org/gitlab-ce/issues/56959
# https://gitlab.com/gitlab-org/gitlab-foss/issues/56959
def legacy_auto_devops_domain
if project_type?
project&.auto_devops&.domain.presence ||
Loading
Loading
Loading
Loading
@@ -19,7 +19,7 @@ module Avatarable
module ShadowMethods
def avatar_url(**args)
# We use avatar_path instead of overriding avatar_url because of carrierwave.
# See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11001/diffs#note_28659864
# See https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/11001/diffs#note_28659864
 
avatar_path(only_path: args.fetch(:only_path, true), size: args[:size]) || super
end
Loading
Loading
Loading
Loading
@@ -50,7 +50,7 @@ module GroupDescendant
child: child.inspect,
preloaded: preloaded.map(&:full_path)
}
issue_url = 'https://gitlab.com/gitlab-org/gitlab-ce/issues/49404'
issue_url = 'https://gitlab.com/gitlab-org/gitlab-foss/issues/49404'
 
Gitlab::Sentry.track_exception(exception, issue_url: issue_url, extra: extras)
end
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ module IssuableStates
# The state:string column is being migrated to state_id:integer column
# This is a temporary hook to populate state_id column with new values
# and should be removed after the state column is removed.
# Check https://gitlab.com/gitlab-org/gitlab-ce/issues/51789 for more information
# Check https://gitlab.com/gitlab-org/gitlab-foss/issues/51789 for more information
included do
before_save :set_state_id
end
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