Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
f3a12bfbd1f5
Commit
f3a12bfb
authored
Jan 27, 2020
by
GitLab Bot
Browse files
Add latest changes from gitlab-org/gitlab@master
parent
e2e9bc1f2548
Changes
63
Hide whitespace changes
Inline
Side-by-side
.rubocop_todo.yml
View file @
f3a12bfb
...
...
@@ -52,14 +52,6 @@
-
'
spec/support/helpers/stub_object_storage.rb'
-
'
spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: leading, trailing
Layout/DotPosition
:
Exclude
:
-
'
app/models/concerns/relative_positioning.rb'
# Offense count: 69
# Cop supports --auto-correct.
Layout/EmptyLinesAroundArguments
:
...
...
@@ -100,12 +92,6 @@
-
'
spec/support/helpers/repo_helpers.rb'
-
'
spec/support/helpers/stub_object_storage.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/LeadingBlankLines
:
Exclude
:
-
'
lib/tasks/yarn.rake'
# Offense count: 54
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
...
...
@@ -150,11 +136,6 @@
Layout/SpaceInsideParens
:
Enabled
:
false
# Offense count: 1
Lint/DisjunctiveAssignmentInConstructor
:
Exclude
:
-
'
app/models/uploads/base.rb'
# Offense count: 19
Lint/DuplicateMethods
:
Exclude
:
...
...
@@ -177,21 +158,6 @@
Lint/MissingCopEnableDirective
:
Enabled
:
false
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: Whitelist.
# Whitelist: present?, blank?, presence, try, try!
Lint/SafeNavigationConsistency
:
Exclude
:
-
'
lib/gitlab/gpg/commit.rb'
# Offense count: 2
# Cop supports --auto-correct.
Lint/ToJSON
:
Exclude
:
-
'
lib/gitlab/cycle_analytics/usage_data.rb'
-
'
lib/gitlab/template/base_template.rb'
# Offense count: 6
Lint/UriEscapeUnescape
:
Exclude
:
...
...
@@ -200,12 +166,6 @@
-
'
spec/lib/google_api/auth_spec.rb'
-
'
spec/requests/api/files_spec.rb'
# Offense count: 1
# Configuration parameters: CheckForMethodsWithNoSideEffects.
Lint/Void
:
Exclude
:
-
'
lib/gitlab/git/diff_collection.rb'
# Offense count: 165
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
...
...
@@ -284,12 +244,6 @@
-
'
spec/rubocop/cop/migration/update_column_in_batches_spec.rb'
-
'
spec/serializers/pipeline_details_entity_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
RSpec/MultipleSubjects
:
Exclude
:
-
'
spec/services/merge_requests/create_from_issue_service_spec.rb'
# Offense count: 2018
# Cop supports --auto-correct.
# Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
...
...
@@ -319,12 +273,6 @@
-
'
spec/requests/api/jobs_spec.rb'
-
'
spec/services/projects/create_service_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
RSpec/SharedContext
:
Exclude
:
-
'
spec/features/admin/admin_groups_spec.rb'
# Offense count: 4
RSpec/VoidExpect
:
Exclude
:
...
...
@@ -348,12 +296,6 @@
-
'
spec/controllers/concerns/continue_params_spec.rb'
-
'
spec/lib/marginalia_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Rails/ApplicationMailer
:
Exclude
:
-
'
app/mailers/base_mailer.rb'
# Offense count: 8
# Cop supports --auto-correct.
Rails/BelongsTo
:
...
...
@@ -414,14 +356,6 @@
Rails/RakeEnvironment
:
Enabled
:
false
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/RedundantAllowNil
:
Exclude
:
-
'
app/models/application_setting.rb'
# Offense count: 868
# Configuration parameters: Blacklist, Whitelist.
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
...
...
@@ -457,12 +391,6 @@
-
'
lib/tasks/gitlab/backup.rake'
-
'
spec/tasks/gitlab/backup_rake_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/Dir
:
Exclude
:
-
'
qa/qa.rb'
# Offense count: 6
# Cop supports --auto-correct.
Style/EachWithObject
:
...
...
@@ -591,13 +519,6 @@
Style/NumericPredicate
:
Enabled
:
false
# Offense count: 2
# Cop supports --auto-correct.
Style/OrAssignment
:
Exclude
:
-
'
lib/api/commit_statuses.rb'
-
'
lib/gitlab/project_transfer.rb'
# Offense count: 106
# Cop supports --auto-correct.
Style/ParallelAssignment
:
...
...
@@ -632,12 +553,6 @@
Style/RaiseArgs
:
Enabled
:
false
# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantConditional
:
Exclude
:
-
'
lib/system_check/helpers.rb'
# Offense count: 221
# Cop supports --auto-correct.
Style/RedundantFreeze
:
...
...
@@ -704,12 +619,6 @@
Style/SpecialGlobalVars
:
EnforcedStyle
:
use_perl_names
# Offense count: 1
# Cop supports --auto-correct.
Style/StderrPuts
:
Exclude
:
-
'
config/initializers/rspec_profiling.rb'
# Offense count: 75
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
...
...
@@ -736,30 +645,6 @@
-
'
spec/requests/api/pipeline_schedules_spec.rb'
-
'
spec/support/capybara.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArrayLiteral
:
Exclude
:
-
'
ee/spec/models/project_spec.rb'
-
'
spec/lib/gitlab/metrics/dashboard/processor_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral
:
Exclude
:
-
'
lib/gitlab/ci/ansi2html.rb'
# Offense count: 2
# Cop supports --auto-correct.
Style/UnlessElse
:
Exclude
:
-
'
lib/backup/manager.rb'
-
'
lib/gitlab/project_search_results.rb'
# Offense count: 8
# Cop supports --auto-correct.
Style/UnneededCondition
:
...
...
@@ -776,13 +661,6 @@
Style/UnneededInterpolation
:
Enabled
:
false
# Offense count: 2
# Cop supports --auto-correct.
Style/UnneededSort
:
Exclude
:
-
'
app/models/concerns/resolvable_discussion.rb'
-
'
lib/gitlab/highlight.rb'
RSpec/ReceiveCounts
:
Exclude
:
-
'
ee/spec/models/broadcast_message_spec.rb'
...
...
@@ -907,4 +785,4 @@
-
'
spec/services/projects/open_issues_count_service_spec.rb'
-
'
spec/services/quick_actions/interpret_service_spec.rb'
-
'
spec/support/shared_examples/services/boards/issues_list_service_shared_examples.rb'
-
'
spec/uploaders/namespace_file_uploader_spec.rb'
\ No newline at end of file
-
'
spec/uploaders/namespace_file_uploader_spec.rb'
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
f3a12bfb
...
...
@@ -132,11 +132,6 @@
type
:
String
,
required
:
true
,
},
environmentsEndpoint
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
currentEnvironmentName
:
{
type
:
String
,
required
:
true
,
...
...
@@ -218,9 +213,7 @@
]),
...
mapGetters
(
'
monitoringDashboard
'
,
[
'
getMetricStates
'
,
'
filteredEnvironments
'
]),
firstDashboard
()
{
return
this
.
environmentsEndpoint
.
length
>
0
&&
this
.
allDashboards
.
length
>
0
?
this
.
allDashboards
[
0
]
:
{};
return
this
.
allDashboards
.
length
>
0
?
this
.
allDashboards
[
0
]
:
{};
},
selectedDashboard
()
{
return
this
.
allDashboards
.
find
(
d
=>
d
.
path
===
this
.
currentDashboard
)
||
this
.
firstDashboard
;
...
...
@@ -246,7 +239,6 @@
created
()
{
this
.
setEndpoints
({
metricsEndpoint
:
this
.
metricsEndpoint
,
environmentsEndpoint
:
this
.
environmentsEndpoint
,
deploymentsEndpoint
:
this
.
deploymentsEndpoint
,
dashboardEndpoint
:
this
.
dashboardEndpoint
,
dashboardsEndpoint
:
this
.
dashboardsEndpoint
,
...
...
app/assets/javascripts/monitoring/stores/mutations.js
View file @
f3a12bfb
...
...
@@ -172,7 +172,6 @@
[
types
.
SET_ENDPOINTS
](
state
,
endpoints
)
{
state
.
metricsEndpoint
=
endpoints
.
metricsEndpoint
;
state
.
environmentsEndpoint
=
endpoints
.
environmentsEndpoint
;
state
.
deploymentsEndpoint
=
endpoints
.
deploymentsEndpoint
;
state
.
dashboardEndpoint
=
endpoints
.
dashboardEndpoint
;
state
.
dashboardsEndpoint
=
endpoints
.
dashboardsEndpoint
;
...
...
app/assets/javascripts/monitoring/stores/state.js
View file @
f3a12bfb
...
...
@@ -2,7 +2,6 @@
export
default
()
=>
({
metricsEndpoint
:
null
,
environmentsEndpoint
:
null
,
deploymentsEndpoint
:
null
,
dashboardEndpoint
:
invalidUrl
,
emptyState
:
'
gettingStarted
'
,
...
...
app/assets/javascripts/serverless/components/url.vue
View file @
f3a12bfb
<
script
>
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
ClipboardButton
from
'
../../vue_shared/components/clipboard_button.vue
'
;
...
...
@@ -3,5 +2,4 @@
import
ClipboardButton
from
'
../../vue_shared/components/clipboard_button.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
export
default
{
components
:
{
...
...
@@ -5,8 +3,6 @@
export
default
{
components
:
{
Icon
,
GlButton
,
ClipboardButton
,
},
props
:
{
...
...
@@ -26,13 +22,5 @@
:title=
"s__('ServerlessURL|Copy URL')"
class=
"input-group-text js-clipboard-btn"
/>
<gl-button
:href=
"uri"
target=
"_blank"
rel=
"noopener noreferrer nofollow"
class=
"input-group-text btn btn-default"
>
<icon
name=
"external-link"
/>
</gl-button>
</div>
</
template
>
app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue
View file @
f3a12bfb
...
...
@@ -146,6 +146,5 @@
auto_merge_strategy
:
useAutoMerge
?
this
.
mr
.
preferredAutoMergeStrategy
:
undefined
,
should_remove_source_branch
:
this
.
removeSourceBranch
===
true
,
squash
:
this
.
squashBeforeMerge
,
squash_commit_message
:
this
.
squashCommitMessage
,
};
...
...
@@ -150,5 +149,12 @@
};
// If users can't alter the squash message (e.g. for 1-commit merge requests),
// we shouldn't send the commit message because that would make the backend
// do unnecessary work.
if
(
this
.
shouldShowSquashBeforeMerge
)
{
options
.
squash_commit_message
=
this
.
squashCommitMessage
;
}
this
.
isMakingRequest
=
true
;
this
.
service
.
merge
(
options
)
...
...
app/controllers/dashboard/projects_controller.rb
View file @
f3a12bfb
...
...
@@ -66,6 +66,8 @@
@total_user_projects_count
=
ProjectsFinder
.
new
(
params:
{
non_public:
true
},
current_user:
current_user
).
execute
@total_starred_projects_count
=
ProjectsFinder
.
new
(
params:
{
starred:
true
},
current_user:
current_user
).
execute
finder_params
[
:use_cte
]
=
Feature
.
enabled?
(
:use_cte_for_projects_finder
,
default_enabled:
true
)
projects
=
ProjectsFinder
.
new
(
params:
finder_params
,
current_user:
current_user
)
.
execute
...
...
app/finders/projects_finder.rb
View file @
f3a12bfb
...
...
@@ -44,6 +44,8 @@
init_collection
end
use_cte
=
params
.
delete
(
:use_cte
)
collection
=
Project
.
wrap_authorized_projects_with_cte
(
collection
)
if
use_cte
collection
=
filter_projects
(
collection
)
sort
(
collection
)
end
...
...
@@ -177,7 +179,7 @@
end
def
sort
(
items
)
params
[
:sort
].
present?
?
items
.
sort_by_attribute
(
params
[
:sort
])
:
items
.
order_id_desc
params
[
:sort
].
present?
?
items
.
sort_by_attribute
(
params
[
:sort
])
:
items
.
projects_
order_id_desc
end
def
by_archived
(
projects
)
...
...
app/helpers/environments_helper.rb
View file @
f3a12bfb
...
...
@@ -33,7 +33,6 @@
"dashboard-endpoint"
=>
metrics_dashboard_project_environment_path
(
project
,
environment
,
format: :json
),
"deployments-endpoint"
=>
project_environment_deployments_path
(
project
,
environment
,
format: :json
),
"default-branch"
=>
project
.
default_branch
,
"environments-endpoint"
:
project_environments_path
(
project
,
format: :json
),
"project-path"
=>
project_path
(
project
),
"tags-path"
=>
project_tags_path
(
project
),
"has-metrics"
=>
"
#{
environment
.
has_metrics?
}
"
,
...
...
app/mailers/abuse_report_mailer.rb
View file @
f3a12bfb
# frozen_string_literal: true
class
AbuseReportMailer
<
Base
Mailer
class
AbuseReportMailer
<
Application
Mailer
layout
'empty_mailer'
helper
EmailsHelper
...
...
app/mailers/application_mailer.rb
0 → 100644
View file @
f3a12bfb
# frozen_string_literal: true
class
ApplicationMailer
<
ActionMailer
::
Base
around_action
:render_with_default_locale
helper
ApplicationHelper
helper
MarkupHelper
attr_accessor
:current_user
helper_method
:current_user
,
:can?
default
from:
proc
{
default_sender_address
.
format
}
default
reply_to:
proc
{
default_reply_to_address
.
format
}
def
can?
Ability
.
allowed?
(
current_user
,
action
,
subject
)
end
private
def
render_with_default_locale
(
&
block
)
Gitlab
::
I18n
.
with_default_locale
(
&
block
)
end
def
default_sender_address
address
=
Mail
::
Address
.
new
(
Gitlab
.
config
.
gitlab
.
email_from
)
address
.
display_name
=
Gitlab
.
config
.
gitlab
.
email_display_name
address
end
def
default_reply_to_address
address
=
Mail
::
Address
.
new
(
Gitlab
.
config
.
gitlab
.
email_reply_to
)
address
.
display_name
=
Gitlab
.
config
.
gitlab
.
email_display_name
address
end
end
app/mailers/base_mailer.rb
deleted
100644 → 0
View file @
e2e9bc1f
# frozen_string_literal: true
class
BaseMailer
<
ActionMailer
::
Base
around_action
:render_with_default_locale
helper
ApplicationHelper
helper
MarkupHelper
attr_accessor
:current_user
helper_method
:current_user
,
:can?
default
from:
proc
{
default_sender_address
.
format
}
default
reply_to:
proc
{
default_reply_to_address
.
format
}
def
can?
Ability
.
allowed?
(
current_user
,
action
,
subject
)
end
private
def
render_with_default_locale
(
&
block
)
Gitlab
::
I18n
.
with_default_locale
(
&
block
)
end
def
default_sender_address
address
=
Mail
::
Address
.
new
(
Gitlab
.
config
.
gitlab
.
email_from
)
address
.
display_name
=
Gitlab
.
config
.
gitlab
.
email_display_name
address
end
def
default_reply_to_address
address
=
Mail
::
Address
.
new
(
Gitlab
.
config
.
gitlab
.
email_reply_to
)
address
.
display_name
=
Gitlab
.
config
.
gitlab
.
email_display_name
address
end
end
app/mailers/email_rejection_mailer.rb
View file @
f3a12bfb
# frozen_string_literal: true
class
EmailRejectionMailer
<
Base
Mailer
class
EmailRejectionMailer
<
Application
Mailer
layout
'empty_mailer'
helper
EmailsHelper
...
...
app/mailers/notify.rb
View file @
f3a12bfb
# frozen_string_literal: true
class
Notify
<
Base
Mailer
class
Notify
<
Application
Mailer
include
ActionDispatch
::
Routing
::
PolymorphicRoutes
include
GitlabRoutingHelper
include
EmailsHelper
...
...
app/mailers/repository_check_mailer.rb
View file @
f3a12bfb
# frozen_string_literal: true
class
RepositoryCheckMailer
<
Base
Mailer
class
RepositoryCheckMailer
<
Application
Mailer
# rubocop: disable CodeReuse/ActiveRecord
layout
'empty_mailer'
...
...
app/models/application_setting.rb
View file @
f3a12bfb
...
...
@@ -142,7 +142,7 @@
if: :auto_devops_enabled?
validates
:enabled_git_access_protocol
,
inclusion:
{
in:
%w(ssh http)
,
allow_blank:
true
,
allow_nil:
true
}
inclusion:
{
in:
%w(ssh http)
,
allow_blank:
true
}
validates
:domain_blacklist
,
presence:
{
message:
'Domain blacklist cannot be empty if Blacklist is enabled.'
},
...
...
app/models/clusters/applications/elastic_stack.rb
View file @
f3a12bfb
...
...
@@ -16,7 +16,7 @@
include
::
Gitlab
::
Utils
::
StrongMemoize
include
IgnorableColumns
ignore_column
:kibana_hostname
,
remove_with:
'12.
8
'
,
remove_after:
'2020-0
1
-22'
ignore_column
:kibana_hostname
,
remove_with:
'12.
9
'
,
remove_after:
'2020-0
2
-22'
default_value_for
:version
,
VERSION
...
...
app/models/concerns/relative_positioning.rb
View file @
f3a12bfb
...
...
@@ -237,8 +237,7 @@
relation
.
pluck
(
self
.
class
.
relative_positioning_parent_column
,
Arel
.
sql
(
"
#{
calculation
}
(relative_position) AS position"
))
.
first
&
.
last
.
first
&
.
last
end
def
scoped_items
...
...
app/models/concerns/resolvable_discussion.rb
View file @
f3a12bfb
...
...
@@ -63,7 +63,7 @@
return
unless
resolved?
strong_memoize
(
:last_resolved_note
)
do
resolved_notes
.
sort
_by
(
&
:resolved_at
)
.
last
resolved_notes
.
max
_by
(
&
:resolved_at
)
end
end
...
...
app/models/project.rb
View file @
f3a12bfb
...
...
@@ -397,6 +397,8 @@
scope
:sorted_by_stars_desc
,
->
{
reorder
(
star_count: :desc
)
}
scope
:sorted_by_stars_asc
,
->
{
reorder
(
star_count: :asc
)
}
scope
:sorted_by_name_asc_limited
,
->
(
limit
)
{
reorder
(
name: :asc
).
limit
(
limit
)
}
# Sometimes queries (e.g. using CTEs) require explicit disambiguation with table name
scope
:projects_order_id_desc
,
->
{
reorder
(
"
#{
table_name
}
.id DESC"
)
}
scope
:in_namespace
,
->
(
namespace_ids
)
{
where
(
namespace_id:
namespace_ids
)
}
scope
:personal
,
->
(
user
)
{
where
(
namespace_id:
user
.
namespace_id
)
}
...
...
@@ -543,6 +545,11 @@
)
end
def
self
.
wrap_authorized_projects_with_cte
(
collection
)
cte
=
Gitlab
::
SQL
::
CTE
.
new
(
:authorized_projects
,
collection
)
Project
.
with
(
cte
.
to_arel
).
from
(
cte
.
alias_to
(
Project
.
arel_table
))
end
scope
:active
,
->
{
joins
(
:issues
,
:notes
,
:merge_requests
).
order
(
'issues.created_at, notes.created_at, merge_requests.created_at DESC'
)
}
scope
:abandoned
,
->
{
where
(
'projects.last_activity_at < ?'
,
6
.
months
.
ago
)
}
...
...
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment