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
0544672e2aa9
Commit
e5374926
authored
Feb 11, 2020
by
GitLab Bot
Browse files
Add latest changes from gitlab-org/gitlab@master
parent
9b1c05634a51
Changes
19
Hide whitespace changes
Inline
Side-by-side
app/models/repository.rb
View file @
0544672e
...
...
@@ -1130,6 +1130,12 @@ def create_if_not_exists
true
end
def
create_from_bundle
(
bundle_path
)
raw
.
create_from_bundle
(
bundle_path
).
tap
do
|
result
|
after_create
if
result
end
end
def
blobs_metadata
(
paths
,
ref
=
'HEAD'
)
references
=
Array
.
wrap
(
paths
).
map
{
|
path
|
[
ref
,
path
]
}
...
...
changelogs/unreleased/refactoring-entities-file-14.yml
0 → 100644
View file @
0544672e
---
title
:
Separate 5 classes into own entities files
merge_request
:
24745
author
:
Rajendra Kadam
type
:
added
changelogs/unreleased/sh-squelch-snowplow-tracker-messages.yml
0 → 100644
View file @
0544672e
---
title
:
Squelch Snowplow tracker log messages
merge_request
:
24809
author
:
type
:
fixed
config/initializers/snowplow_tracker.rb
View file @
0544672e
...
...
@@ -3,21 +3,12 @@
# Gitlab.com uses Snowplow for identifying users and events.
# https://gitlab.com/gitlab-org/gitlab/issues/6329
#
# SnowplowTracker write log
in
to STDERR
# SnowplowTracker write
s
log
s
to STDERR
:
# https://github.com/snowplow/snowplow-ruby-tracker/blob/39fcfa2be793f2e25e73087a9700abc93f43b5e8/lib/snowplow-tracker/emitters.rb#L23
# `LOGGER = Logger.new(STDERR)`
#
# In puma.rb, if `stdout_redirect` specify stderr, Puma will overwrite STDERR in:
# https://github.com/puma/puma/blob/b41205f5cacbc2ad0060472bdce68ba636f42175/lib/puma/runner.rb#L134
# `STDERR.reopen stderr, (append ? "a" : "w")`
# As a result, SnowplowTracker will log into Puma stderr, when Puma enabled.
#
# By default, SnowplowTracker uses default log formatter.
# When enable Puma, SnowplowTracker log is expected to be JSON format, as part of puma_stderr.log.
# Hence overwrite ::SnowplowTracker::LOGGER.formatter to JSON formatter
if
defined?
(
::
Puma
)
&&
defined?
(
::
SnowplowTracker
::
LOGGER
)
::
SnowplowTracker
::
LOGGER
.
formatter
=
proc
do
|
severity
,
datetime
,
progname
,
msg
|
{
severity:
severity
,
timestamp:
datetime
.
utc
.
iso8601
(
3
),
pid:
$$
,
progname:
progname
,
message:
msg
}.
to_json
<<
"
\n
"
end
if
defined?
(
::
SnowplowTracker
::
LOGGER
)
# This squelches the output of the logger since it doesn't really
# provide useful information.
# https://github.com/snowplow/snowplow-ruby-tracker/pull/109
# would make it possible to configure this logger directly.
::
SnowplowTracker
::
LOGGER
.
level
=
Logger
::
FATAL
end
doc/administration/troubleshooting/group_saml_scim.md
View file @
0544672e
...
...
@@ -55,3 +55,23 @@ Adding a user:
SSO settings:

## ADFS
Setup SAML SSO URL:

Configure Assertions:

Configure NameID:

Determine Certificate Fingerprint:
| Via UI | Via Shell |
|--------|-----------|
| !
[
ADFS Determine Token Signing Certificate Fingerprint
](
img/ADFS-determine-token-signing-certificate-fingerprint.png
)
| !
[
ADFS Determine Token Signing Fingerprint From Shell
](
img/ADFS-determine-token-signing-fingerprint-from-shell.png
)
|
doc/administration/troubleshooting/img/ADFS-configure-NameID.png
0 → 100644
View file @
0544672e
22 KB
doc/administration/troubleshooting/img/ADFS-configure-assertions.png
0 → 100644
View file @
0544672e
10.3 KB
doc/administration/troubleshooting/img/ADFS-determine-token-signing-certificate-fingerprint.png
0 → 100644
View file @
0544672e
48.6 KB
doc/administration/troubleshooting/img/ADFS-determine-token-signing-fingerprint-from-shell.png
0 → 100644
View file @
0544672e
28.3 KB
doc/administration/troubleshooting/img/ADFS-saml-setup-sso-url.png
0 → 100644
View file @
0544672e
29.6 KB
doc/api/api_resources.md
View file @
0544672e
...
...
@@ -131,7 +131,7 @@ The following API resources are available outside of project and group contexts
|
[
Projects
](
projects.md
)
|
`/users/:id/projects`
(also available for projects) |
|
[
Runners
](
runners.md
)
|
`/runners`
(also available for projects) |
|
[
Search
](
search.md
)
|
`/search`
(also available for groups and projects) |
|
[
Settings
](
settings.md
)
|
`/application/settings`
|
|
[
Settings
](
settings.md
)
**(CORE ONLY)**
|
`/application/settings`
|
|
[
Statistics
](
statistics.md
)
|
`/application/statistics`
|
|
[
Sidekiq metrics
](
sidekiq_metrics.md
)
|
`/sidekiq`
|
|
[
Suggestions
](
suggestions.md
)
|
`/suggestions`
|
...
...
doc/api/settings.md
View file @
0544672e
# Application settings API
# Application settings API
**(CORE ONLY)**
These API calls allow you to read and modify GitLab instance
[
application settings
](
#list-of-settings-that-can-be-accessed-via-api-calls
)
...
...
lib/api/entities.rb
View file @
0544672e
...
...
@@ -129,86 +129,6 @@ def self.forks_counting_projects(projects_relation)
end
end
class
PushEventPayload
<
Grape
::
Entity
expose
:commit_count
,
:action
,
:ref_type
,
:commit_from
,
:commit_to
,
:ref
,
:commit_title
,
:ref_count
end
class
Event
<
Grape
::
Entity
expose
:project_id
,
:action_name
expose
:target_id
,
:target_iid
,
:target_type
,
:author_id
expose
:target_title
expose
:created_at
expose
:note
,
using:
Entities
::
Note
,
if:
->
(
event
,
options
)
{
event
.
note?
}
expose
:author
,
using:
Entities
::
UserBasic
,
if:
->
(
event
,
options
)
{
event
.
author
}
expose
:push_event_payload
,
as: :push_data
,
using:
PushEventPayload
,
if:
->
(
event
,
_
)
{
event
.
push_action?
}
expose
:author_username
do
|
event
,
options
|
event
.
author
&
.
username
end
end
class
ProjectGroupLink
<
Grape
::
Entity
expose
:id
,
:project_id
,
:group_id
,
:group_access
,
:expires_at
end
class
Todo
<
Grape
::
Entity
expose
:id
expose
:project
,
using:
Entities
::
ProjectIdentity
,
if:
->
(
todo
,
_
)
{
todo
.
project_id
}
expose
:group
,
using:
'API::Entities::NamespaceBasic'
,
if:
->
(
todo
,
_
)
{
todo
.
group_id
}
expose
:author
,
using:
Entities
::
UserBasic
expose
:action_name
expose
:target_type
expose
:target
do
|
todo
,
options
|
todo_options
=
options
.
fetch
(
todo
.
target_type
,
{})
todo_target_class
(
todo
.
target_type
).
represent
(
todo
.
target
,
todo_options
)
end
expose
:target_url
do
|
todo
,
options
|
todo_target_url
(
todo
)
end
expose
:body
expose
:state
expose
:created_at
def
todo_target_class
(
target_type
)
# false as second argument prevents looking up in module hierarchy
# see also https://gitlab.com/gitlab-org/gitlab-foss/issues/59719
::
API
::
Entities
.
const_get
(
target_type
,
false
)
end
def
todo_target_url
(
todo
)
target_type
=
todo
.
target_type
.
underscore
target_url
=
"
#{
todo
.
resource_parent
.
class
.
to_s
.
underscore
}
_
#{
target_type
}
_url"
Gitlab
::
Routing
.
url_helpers
.
public_send
(
target_url
,
todo
.
resource_parent
,
todo
.
target
,
anchor:
todo_target_anchor
(
todo
))
# rubocop:disable GitlabSecurity/PublicSend
end
def
todo_target_anchor
(
todo
)
"note_
#{
todo
.
note_id
}
"
if
todo
.
note_id?
end
end
class
NamespaceBasic
<
Grape
::
Entity
expose
:id
,
:name
,
:path
,
:kind
,
:full_path
,
:parent_id
,
:avatar_url
expose
:web_url
do
|
namespace
|
if
namespace
.
user?
Gitlab
::
Routing
.
url_helpers
.
user_url
(
namespace
.
owner
)
else
namespace
.
web_url
end
end
end
class
Namespace
<
NamespaceBasic
expose
:members_count_with_descendants
,
if:
->
(
namespace
,
opts
)
{
expose_members_count_with_descendants?
(
namespace
,
opts
)
}
do
|
namespace
,
_
|
namespace
.
users_with_descendants
.
count
...
...
lib/api/entities/event.rb
0 → 100644
View file @
0544672e
# frozen_string_literal: true
module
API
module
Entities
class
Event
<
Grape
::
Entity
expose
:project_id
,
:action_name
expose
:target_id
,
:target_iid
,
:target_type
,
:author_id
expose
:target_title
expose
:created_at
expose
:note
,
using:
Entities
::
Note
,
if:
->
(
event
,
options
)
{
event
.
note?
}
expose
:author
,
using:
Entities
::
UserBasic
,
if:
->
(
event
,
options
)
{
event
.
author
}
expose
:push_event_payload
,
as: :push_data
,
using:
Entities
::
PushEventPayload
,
if:
->
(
event
,
_
)
{
event
.
push_action?
}
expose
:author_username
do
|
event
,
options
|
event
.
author
&
.
username
end
end
end
end
lib/api/entities/namespace_basic.rb
0 → 100644
View file @
0544672e
# frozen_string_literal: true
module
API
module
Entities
class
NamespaceBasic
<
Grape
::
Entity
expose
:id
,
:name
,
:path
,
:kind
,
:full_path
,
:parent_id
,
:avatar_url
expose
:web_url
do
|
namespace
|
if
namespace
.
user?
Gitlab
::
Routing
.
url_helpers
.
user_url
(
namespace
.
owner
)
else
namespace
.
web_url
end
end
end
end
end
lib/api/entities/project_group_link.rb
0 → 100644
View file @
0544672e
# frozen_string_literal: true
module
API
module
Entities
class
ProjectGroupLink
<
Grape
::
Entity
expose
:id
,
:project_id
,
:group_id
,
:group_access
,
:expires_at
end
end
end
lib/api/entities/push_event_payload.rb
0 → 100644
View file @
0544672e
# frozen_string_literal: true
module
API
module
Entities
class
PushEventPayload
<
Grape
::
Entity
expose
:commit_count
,
:action
,
:ref_type
,
:commit_from
,
:commit_to
,
:ref
,
:commit_title
,
:ref_count
end
end
end
lib/api/entities/todo.rb
0 → 100644
View file @
0544672e
# frozen_string_literal: true
module
API
module
Entities
class
Todo
<
Grape
::
Entity
expose
:id
expose
:project
,
using:
Entities
::
ProjectIdentity
,
if:
->
(
todo
,
_
)
{
todo
.
project_id
}
expose
:group
,
using:
'API::Entities::NamespaceBasic'
,
if:
->
(
todo
,
_
)
{
todo
.
group_id
}
expose
:author
,
using:
Entities
::
UserBasic
expose
:action_name
expose
:target_type
expose
:target
do
|
todo
,
options
|
todo_options
=
options
.
fetch
(
todo
.
target_type
,
{})
todo_target_class
(
todo
.
target_type
).
represent
(
todo
.
target
,
todo_options
)
end
expose
:target_url
do
|
todo
,
options
|
todo_target_url
(
todo
)
end
expose
:body
expose
:state
expose
:created_at
def
todo_target_class
(
target_type
)
# false as second argument prevents looking up in module hierarchy
# see also https://gitlab.com/gitlab-org/gitlab-foss/issues/59719
::
API
::
Entities
.
const_get
(
target_type
,
false
)
end
def
todo_target_url
(
todo
)
target_type
=
todo
.
target_type
.
underscore
target_url
=
"
#{
todo
.
resource_parent
.
class
.
to_s
.
underscore
}
_
#{
target_type
}
_url"
Gitlab
::
Routing
.
url_helpers
.
public_send
(
target_url
,
todo
.
resource_parent
,
todo
.
target
,
anchor:
todo_target_anchor
(
todo
))
# rubocop:disable GitlabSecurity/PublicSend
end
def
todo_target_anchor
(
todo
)
"note_
#{
todo
.
note_id
}
"
if
todo
.
note_id?
end
end
end
end
spec/models/repository_spec.rb
View file @
0544672e
...
...
@@ -2781,6 +2781,45 @@ def expect_contributors(*contributors)
end
end
describe
'#create_from_bundle'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:repository
)
{
project
.
repository
}
let
(
:valid_bundle_path
)
{
File
.
join
(
Dir
.
tmpdir
,
"repo-
#{
SecureRandom
.
hex
}
.bundle"
)
}
let
(
:raw_repository
)
{
repository
.
raw
}
before
do
allow
(
raw_repository
).
to
receive
(
:create_from_bundle
).
and_return
({})
end
after
do
FileUtils
.
rm_rf
(
valid_bundle_path
)
end
it
'calls out to the raw_repository to create a repo from bundle'
do
expect
(
raw_repository
).
to
receive
(
:create_from_bundle
)
repository
.
create_from_bundle
(
valid_bundle_path
)
end
it
'calls after_create'
do
expect
(
repository
).
to
receive
(
:after_create
)
repository
.
create_from_bundle
(
valid_bundle_path
)
end
context
'when exception is raised'
do
before
do
allow
(
raw_repository
).
to
receive
(
:create_from_bundle
).
and_raise
(
::
Gitlab
::
Git
::
BundleFile
::
InvalidBundleError
)
end
it
'after_create is not executed'
do
expect
(
repository
).
not_to
receive
(
:after_create
)
expect
{
repository
.
create_from_bundle
(
valid_bundle_path
)}.
to
raise_error
(
::
Gitlab
::
Git
::
BundleFile
::
InvalidBundleError
)
end
end
end
describe
"#blobs_metadata"
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:repository
)
{
project
.
repository
}
...
...
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