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
aa0e2ccc4416
Commit
6d5482bf
authored
Jan 30, 2020
by
GitLab Bot
Browse files
Add latest changes from gitlab-org/gitlab@master
parent
fff40ee848ee
Changes
368
Hide whitespace changes
Inline
Side-by-side
app/assets/javascripts/lib/graphql.js
View file @
aa0e2ccc
...
...
@@ -5,6 +5,14 @@ import { ApolloLink } from 'apollo-link';
import
{
BatchHttpLink
}
from
'
apollo-link-batch-http
'
;
import
csrf
from
'
~/lib/utils/csrf
'
;
export
const
fetchPolicies
=
{
CACHE_FIRST
:
'
cache-first
'
,
CACHE_AND_NETWORK
:
'
cache-and-network
'
,
NETWORK_ONLY
:
'
network-only
'
,
NO_CACHE
:
'
no-cache
'
,
CACHE_ONLY
:
'
cache-only
'
,
};
export
default
(
resolvers
=
{},
config
=
{})
=>
{
let
uri
=
`
${
gon
.
relative_url_root
}
/api/graphql`
;
...
...
@@ -32,5 +40,10 @@ export default (resolvers = {}, config = {}) => {
}),
resolvers
,
assumeImmutableResults
:
config
.
assumeImmutableResults
,
defaultOptions
:
{
query
:
{
fetchPolicy
:
config
.
fetchPolicy
||
fetchPolicies
.
CACHE_FIRST
,
},
},
});
};
app/assets/javascripts/monitoring/stores/utils.js
View file @
aa0e2ccc
import
{
omit
}
from
'
lodash
'
;
import
createGqClient
from
'
~/lib/graphql
'
;
import
createGqClient
,
{
fetchPolicies
}
from
'
~/lib/graphql
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
export
const
gqClient
=
createGqClient
();
export
const
gqClient
=
createGqClient
(
{},
{
fetchPolicy
:
fetchPolicies
.
NO_CACHE
,
},
);
export
const
uniqMetricsId
=
metric
=>
`
${
metric
.
metric_id
}
_
${
metric
.
id
}
`
;
...
...
app/assets/stylesheets/pages/diff.scss
View file @
aa0e2ccc
...
...
@@ -63,11 +63,6 @@
background-color
:
$gray-normal
;
}
a
,
button
{
color
:
$gray-700
;
}
svg
{
vertical-align
:
middle
;
top
:
-1px
;
...
...
app/finders/projects/serverless/functions_finder.rb
View file @
aa0e2ccc
...
...
@@ -4,9 +4,15 @@ module Projects
module
Serverless
class
FunctionsFinder
include
Gitlab
::
Utils
::
StrongMemoize
include
ReactiveCaching
attr_reader
:project
self
.
reactive_cache_key
=
->
(
finder
)
{
finder
.
cache_key
}
self
.
reactive_cache_worker_finder
=
->
(
_id
,
*
args
)
{
from_cache
(
*
args
)
}
MAX_CLUSTERS
=
10
def
initialize
(
project
)
@project
=
project
end
...
...
@@ -15,8 +21,9 @@ def execute
knative_services
.
flatten
.
compact
end
# Possible return values: Clusters::KnativeServicesFinder::KNATIVE_STATE
def
knative_installed
return
knative_installed_from_cluster?
(
*
cache_key
)
if
available_environments
.
empty?
states
=
services_finders
.
map
do
|
finder
|
finder
.
knative_detected
.
tap
do
|
state
|
return
state
if
state
==
::
Clusters
::
KnativeServicesFinder
::
KNATIVE_STATES
[
'checking'
]
# rubocop:disable Cop/AvoidReturnFromBlocks
...
...
@@ -45,8 +52,41 @@ def has_prometheus?(environment_scope)
end
end
def
self
.
from_cache
(
project_id
)
project
=
Project
.
find
(
project_id
)
new
(
project
)
end
def
cache_key
(
*
args
)
[
project
.
id
]
end
def
calculate_reactive_cache
(
*
)
# rubocop: disable CodeReuse/ActiveRecord
project
.
all_clusters
.
enabled
.
take
(
MAX_CLUSTERS
).
any?
do
|
cluster
|
cluster
.
kubeclient
.
knative_client
.
discover
rescue
Kubeclient
::
ResourceNotFoundError
next
end
end
private
def
knative_installed_from_cluster?
(
*
cache_key
)
cached_data
=
with_reactive_cache_memoized
(
*
cache_key
)
{
|
data
|
data
}
return
::
Clusters
::
KnativeServicesFinder
::
KNATIVE_STATES
[
'checking'
]
if
cached_data
.
nil?
cached_data
?
true
:
false
end
def
with_reactive_cache_memoized
(
*
cache_key
)
strong_memoize
(
:reactive_cache
)
do
with_reactive_cache
(
*
cache_key
)
{
|
data
|
data
}
end
end
def
knative_service
(
environment_scope
,
name
)
finders_for_scope
(
environment_scope
).
map
do
|
finder
|
services
=
finder
...
...
@@ -95,6 +135,10 @@ def finders_for_scope(environment_scope)
environment_scope
==
finder
.
cluster
.
environment_scope
end
end
def
id
nil
end
end
end
end
app/helpers/explore_helper.rb
View file @
aa0e2ccc
...
...
@@ -19,6 +19,18 @@ def filter_projects_path(options = {})
request_path_with_options
(
options
)
end
def
filter_audit_path
(
options
=
{})
exist_opts
=
{
entity_type:
params
[
:entity_type
],
entity_id:
params
[
:entity_id
],
created_before:
params
[
:created_before
],
created_after:
params
[
:created_after
],
sort:
params
[
:sort
]
}
options
=
exist_opts
.
merge
(
options
).
delete_if
{
|
key
,
value
|
value
.
blank?
}
request_path_with_options
(
options
)
end
def
filter_groups_path
(
options
=
{})
request_path_with_options
(
options
)
end
...
...
app/helpers/sorting_helper.rb
View file @
aa0e2ccc
...
...
@@ -207,6 +207,13 @@ def issuable_reverse_sort_order_hash
}.
merge
(
issuable_sort_option_overrides
)
end
def
audit_logs_sort_order_hash
{
sort_value_recently_created
=>
sort_title_recently_created
,
sort_value_oldest_created
=>
sort_title_oldest_created
}
end
def
issuable_sort_option_title
(
sort_value
)
sort_value
=
issuable_sort_option_overrides
[
sort_value
]
||
sort_value
...
...
app/models/audit_event.rb
View file @
aa0e2ccc
...
...
@@ -13,6 +13,8 @@ class AuditEvent < ApplicationRecord
scope
:by_entity_type
,
->
(
entity_type
)
{
where
(
entity_type:
entity_type
)
}
scope
:by_entity_id
,
->
(
entity_id
)
{
where
(
entity_id:
entity_id
)
}
scope
:order_by_id_desc
,
->
{
order
(
id: :desc
)
}
scope
:order_by_id_asc
,
->
{
order
(
id: :asc
)
}
after_initialize
:initialize_details
...
...
app/models/clusters/applications/runner.rb
View file @
aa0e2ccc
...
...
@@ -3,7 +3,7 @@
module
Clusters
module
Applications
class
Runner
<
ApplicationRecord
VERSION
=
'0.13.
0
'
VERSION
=
'0.13.
1
'
self
.
table_name
=
'clusters_applications_runners'
...
...
app/services/akismet_service.rb
deleted
100644 → 0
View file @
fff40ee8
# frozen_string_literal: true
class
AkismetService
attr_accessor
:text
,
:options
def
initialize
(
owner_name
,
owner_email
,
text
,
options
=
{})
@owner_name
=
owner_name
@owner_email
=
owner_email
@text
=
text
@options
=
options
end
def
spam?
return
false
unless
akismet_enabled?
params
=
{
type:
'comment'
,
text:
text
,
created_at:
DateTime
.
now
,
author:
owner_name
,
author_email:
owner_email
,
referrer:
options
[
:referrer
]
}
begin
is_spam
,
is_blatant
=
akismet_client
.
check
(
options
[
:ip_address
],
options
[
:user_agent
],
params
)
is_spam
||
is_blatant
rescue
=>
e
Rails
.
logger
.
error
(
"Unable to connect to Akismet:
#{
e
}
, skipping check"
)
# rubocop:disable Gitlab/RailsLogger
false
end
end
def
submit_ham
submit
(
:ham
)
end
def
submit_spam
submit
(
:spam
)
end
private
attr_accessor
:owner_name
,
:owner_email
def
akismet_client
@akismet_client
||=
::
Akismet
::
Client
.
new
(
Gitlab
::
CurrentSettings
.
akismet_api_key
,
Gitlab
.
config
.
gitlab
.
url
)
end
def
akismet_enabled?
Gitlab
::
CurrentSettings
.
akismet_enabled
end
def
submit
(
type
)
return
false
unless
akismet_enabled?
params
=
{
type:
'comment'
,
text:
text
,
author:
owner_name
,
author_email:
owner_email
}
begin
akismet_client
.
public_send
(
type
,
options
[
:ip_address
],
options
[
:user_agent
],
params
)
# rubocop:disable GitlabSecurity/PublicSend
true
rescue
=>
e
Rails
.
logger
.
error
(
"Unable to connect to Akismet:
#{
e
}
, skipping!"
)
# rubocop:disable Gitlab/RailsLogger
false
end
end
end
app/services/concerns/akismet_methods.rb
View file @
aa0e2ccc
...
...
@@ -6,7 +6,7 @@ def spammable_owner
end
def
akismet
@akismet
||=
AkismetService
.
new
(
@akismet
||=
Spam
::
AkismetService
.
new
(
spammable_owner
.
name
,
spammable_owner
.
email
,
spammable
.
spammable_text
,
...
...
app/services/notes/update_service.rb
View file @
aa0e2ccc
...
...
@@ -3,7 +3,7 @@
module
Notes
class
UpdateService
<
BaseService
def
execute
(
note
)
return
note
unless
note
.
editable?
return
note
unless
note
.
editable?
&&
params
.
present?
old_mentioned_users
=
note
.
mentioned_users
(
current_user
).
to_a
...
...
app/services/spam/akismet_service.rb
0 → 100644
View file @
aa0e2ccc
# frozen_string_literal: true
module
Spam
class
AkismetService
attr_accessor
:text
,
:options
def
initialize
(
owner_name
,
owner_email
,
text
,
options
=
{})
@owner_name
=
owner_name
@owner_email
=
owner_email
@text
=
text
@options
=
options
end
def
spam?
return
false
unless
akismet_enabled?
params
=
{
type:
'comment'
,
text:
text
,
created_at:
DateTime
.
now
,
author:
owner_name
,
author_email:
owner_email
,
referrer:
options
[
:referrer
]
}
begin
is_spam
,
is_blatant
=
akismet_client
.
check
(
options
[
:ip_address
],
options
[
:user_agent
],
params
)
is_spam
||
is_blatant
rescue
=>
e
Rails
.
logger
.
error
(
"Unable to connect to Akismet:
#{
e
}
, skipping check"
)
# rubocop:disable Gitlab/RailsLogger
false
end
end
def
submit_ham
submit
(
:ham
)
end
def
submit_spam
submit
(
:spam
)
end
private
attr_accessor
:owner_name
,
:owner_email
def
akismet_client
@akismet_client
||=
::
Akismet
::
Client
.
new
(
Gitlab
::
CurrentSettings
.
akismet_api_key
,
Gitlab
.
config
.
gitlab
.
url
)
end
def
akismet_enabled?
Gitlab
::
CurrentSettings
.
akismet_enabled
end
def
submit
(
type
)
return
false
unless
akismet_enabled?
params
=
{
type:
'comment'
,
text:
text
,
author:
owner_name
,
author_email:
owner_email
}
begin
akismet_client
.
public_send
(
type
,
options
[
:ip_address
],
options
[
:user_agent
],
params
)
# rubocop:disable GitlabSecurity/PublicSend
true
rescue
=>
e
Rails
.
logger
.
error
(
"Unable to connect to Akismet:
#{
e
}
, skipping!"
)
# rubocop:disable Gitlab/RailsLogger
false
end
end
end
end
app/views/shared/boards/components/_board.html.haml
View file @
aa0e2ccc
...
...
@@ -22,7 +22,7 @@
%span
.board-title-main-text.block-truncated
{
"v-if"
:
"list.type !==
\"
label
\"
"
,
":title"
=>
'((list.label && list.label.description) || list.title || "")'
,
data:
{
container:
"body"
},
":class"
:
"{ 'has-tooltip': !['backlog', 'closed'].includes(list.type) }"
}
":class"
:
"{ 'has-tooltip': !['backlog', 'closed'].includes(list.type)
, 'd-block': list.type === 'milestone'
}"
}
{{ list.title }}
%span
.board-title-sub-text.prepend-left-5.has-tooltip
{
"v-if"
:
"list.type ===
\"
assignee
\"
"
,
...
...
changelogs/unreleased/197309-milestone-in-issue-boards-list-not-cropped-when-longer-than-board-.yml
0 → 100644
View file @
aa0e2ccc
---
title
:
Allow long milestone titles on board lists to be truncated
merge_request
:
author
:
type
:
fixed
changelogs/unreleased/198411-jira-http-error.yml
0 → 100644
View file @
aa0e2ccc
---
title
:
Fix JIRA::HTTPError initialize parameter
merge_request
:
24060
author
:
type
:
fixed
changelogs/unreleased/199526-new-mr-changes-tab-edit-file-button-ui-polish.yml
0 → 100644
View file @
aa0e2ccc
---
title
:
Remove gray color from diff buttons
merge_request
:
24041
author
:
type
:
fixed
changelogs/unreleased/refactoring-entities-file-5.yml
0 → 100644
View file @
aa0e2ccc
---
title
:
Add separate classes for project related classes
merge_request
:
23887
author
:
Rajendra Kadam
type
:
added
changelogs/unreleased/update-gitlab-runner-helm-chart-to-0-13-1.yml
0 → 100644
View file @
aa0e2ccc
---
title
:
Update GitLab Runner Helm Chart to 0.13.1 (GitLab Runner 12.7.1)
merge_request
:
23588
author
:
type
:
other
config/initializers/rails_host_authorization.rb
0 → 100644
View file @
aa0e2ccc
# frozen_string_literal: true
# This file requires config/initializers/1_settings.rb
if
Rails
.
env
.
development?
Rails
.
application
.
config
.
hosts
<<
Gitlab
.
config
.
gitlab
.
host
end
doc/administration/audit_events.md
View file @
aa0e2ccc
...
...
@@ -144,7 +144,7 @@ the steps bellow.
1.
Enter the Rails console:
```
sh
```
sh
ell
sudo
gitlab-rails console
```
...
...
Prev
1
2
3
4
5
…
19
Next
Write
Preview
Markdown
is supported
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