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
dac6eea51648
Commit
0cb64389
authored
Oct 22, 2019
by
GitLab Bot
Browse files
Add latest changes from gitlab-org/gitlab@master
parent
2c5b6b1691a6
Changes
9
Hide whitespace changes
Inline
Side-by-side
app/services/metrics/dashboard/grafana_metric_embed_service.rb
View file @
dac6eea5
...
...
@@ -44,6 +44,9 @@ def get_dashboard
# Inherits the primary logic from the parent class and
# maintains the service's API while including ReactiveCache
def
calculate_reactive_cache
(
*
)
# This is called with explicit parentheses to prevent
# the params passed to #calculate_reactive_cache from
# being passed to #get_dashboard (which accepts none)
::
Metrics
::
Dashboard
::
BaseService
.
instance_method
(
:get_dashboard
)
.
bind
(
self
)
...
...
db/migrate/20191014025629_rename_design_management_version_user_to_author.rb
0 → 100644
View file @
dac6eea5
# frozen_string_literal: true
class
RenameDesignManagementVersionUserToAuthor
<
ActiveRecord
::
Migration
[
5.2
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
rename_column_concurrently
:design_management_versions
,
:user_id
,
:author_id
end
def
down
undo_rename_column_concurrently
:design_management_versions
,
:user_id
,
:author_id
end
end
db/migrate/20191014030730_add_author_index_to_design_management_versions.rb
0 → 100644
View file @
dac6eea5
# frozen_string_literal: true
class
AddAuthorIndexToDesignManagementVersions
<
ActiveRecord
::
Migration
[
5.2
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
:design_management_versions
,
:author_id
,
where:
'author_id IS NOT NULL'
end
def
down
remove_concurrent_index
:design_management_versions
,
:author_id
end
end
db/post_migrate/20191014030134_cleanup_design_management_version_user_to_author_rename.rb
0 → 100644
View file @
dac6eea5
# frozen_string_literal: true
class
CleanupDesignManagementVersionUserToAuthorRename
<
ActiveRecord
::
Migration
[
5.2
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
cleanup_concurrent_column_rename
:design_management_versions
,
:user_id
,
:author_id
end
def
down
undo_cleanup_concurrent_column_rename
:design_management_versions
,
:user_id
,
:author_id
end
end
db/schema.rb
View file @
dac6eea5
...
...
@@ -1301,11 +1301,11 @@
create_table
"design_management_versions"
,
force: :cascade
do
|
t
|
t
.
binary
"sha"
,
null:
false
t
.
bigint
"issue_id"
t
.
integer
"user_id"
t
.
datetime_with_timezone
"created_at"
t
.
integer
"author_id"
t
.
index
[
"author_id"
],
name:
"index_design_management_versions_on_author_id"
,
where:
"(author_id IS NOT NULL)"
t
.
index
[
"issue_id"
],
name:
"index_design_management_versions_on_issue_id"
t
.
index
[
"sha"
,
"issue_id"
],
name:
"index_design_management_versions_on_sha_and_issue_id"
,
unique:
true
t
.
index
[
"user_id"
],
name:
"index_design_management_versions_on_user_id"
,
where:
"(user_id IS NOT NULL)"
end
create_table
"draft_notes"
,
force: :cascade
do
|
t
|
...
...
@@ -4135,7 +4135,7 @@
add_foreign_key
"design_management_designs_versions"
,
"design_management_designs"
,
column:
"design_id"
,
name:
"fk_03c671965c"
,
on_delete: :cascade
add_foreign_key
"design_management_designs_versions"
,
"design_management_versions"
,
column:
"version_id"
,
name:
"fk_f4d25ba00c"
,
on_delete: :cascade
add_foreign_key
"design_management_versions"
,
"issues"
,
on_delete: :cascade
add_foreign_key
"design_management_versions"
,
"users"
,
name:
"fk_ee16b939e5
"
,
on_delete: :nullify
add_foreign_key
"design_management_versions"
,
"users"
,
column:
"author_id"
,
name:
"fk_c1440b4896
"
,
on_delete: :nullify
add_foreign_key
"draft_notes"
,
"merge_requests"
,
on_delete: :cascade
add_foreign_key
"draft_notes"
,
"users"
,
column:
"author_id"
,
on_delete: :cascade
add_foreign_key
"elasticsearch_indexed_namespaces"
,
"namespaces"
,
on_delete: :cascade
...
...
lib/gitlab/data_builder/push.rb
View file @
dac6eea5
...
...
@@ -19,12 +19,25 @@ module Push
user_email:
"john@example.com"
,
user_avatar:
"https://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=8://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=80"
,
project_id:
15
,
project:
{
id:
15
,
name:
"gitlab"
,
description:
""
,
web_url:
"http://test.example.com/gitlab/gitlab"
,
avatar_url:
"https://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=8://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=80"
,
git_ssh_url:
"git@test.example.com:gitlab/gitlab.git"
,
git_http_url:
"http://test.example.com/gitlab/gitlab.git"
,
namespace:
"gitlab"
,
visibility_level:
0
,
path_with_namespace:
"gitlab/gitlab"
,
default_branch:
"master"
},
commits:
[
{
id:
"c5feabde2d8cd023215af4d2ceeb7a64839fc428"
,
message:
"Add simple search to projects in public area"
,
timestamp:
"2013-05-13T18:18:08+00:00"
,
url:
"https://test.example.com/gitlab/gitlab
hq
/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428"
,
url:
"https://test.example.com/gitlab/gitlab/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428"
,
author:
{
name:
"Test User"
,
email:
"test@example.com"
...
...
@@ -45,7 +58,20 @@ module Push
# user_name: String,
# user_username: String,
# user_email: String
# project_id: String,
# project_id: Fixnum,
# project: {
# id: Fixnum,
# name: String,
# description: String,
# web_url: String,
# avatar_url: String,
# git_ssh_url: String,
# git_http_url: String,
# namespace: String,
# visibility_level: Fixnum,
# path_with_namespace: String,
# default_branch: String
# }
# repository: {
# name: String,
# url: String,
...
...
scripts/lint-doc.sh
View file @
dac6eea5
#!/usr/bin/env bash
cd
"
$(
dirname
"
$0
"
)
/.."
echo
"=> Linting documents at path
$(
pwd
)
as
$(
whoami
)
..."
# Use long options (e.g. --header instead of -H) for curl examples in documentation.
echo
'=> Checking for cURL short options...'
...
...
@@ -25,7 +26,7 @@ fi
# Make sure no files in doc/ are executable
EXEC_PERM_COUNT
=
$(
find doc/
-type
f
-perm
755 |
wc
-l
)
echo
'
=> Checking for executable permissions...
'
echo
"
=> Checking
$(
pwd
)
/doc
for executable permissions...
"
if
[
"
${
EXEC_PERM_COUNT
}
"
-ne
0
]
then
echo
'✖ ERROR: Executable permissions should not be used in documentation! Use `chmod 644` to the files in question:'
>
&2
...
...
spec/lib/gitlab/data_builder/push_spec.rb
View file @
dac6eea5
...
...
@@ -57,6 +57,32 @@
include_examples
'deprecated repository hook data'
end
describe
'.sample_data'
do
let
(
:data
)
{
described_class
.
sample_data
}
it
{
expect
(
data
).
to
be_a
(
Hash
)
}
it
{
expect
(
data
[
:before
]).
to
eq
(
'95790bf891e76fee5e1747ab589903a6a1f80f22'
)
}
it
{
expect
(
data
[
:after
]).
to
eq
(
'da1560886d4f094c3e6c9ef40349f7d38b5d27d7'
)
}
it
{
expect
(
data
[
:ref
]).
to
eq
(
'refs/heads/master'
)
}
it
{
expect
(
data
[
:project_id
]).
to
eq
(
15
)
}
it
{
expect
(
data
[
:commits
].
size
).
to
eq
(
1
)
}
it
{
expect
(
data
[
:total_commits_count
]).
to
eq
(
1
)
}
it
'contains project data'
do
expect
(
data
[
:project
]).
to
be_a
(
Hash
)
expect
(
data
[
:project
][
:id
]).
to
eq
(
15
)
expect
(
data
[
:project
][
:name
]).
to
eq
(
'gitlab'
)
expect
(
data
[
:project
][
:description
]).
to
eq
(
''
)
expect
(
data
[
:project
][
:web_url
]).
to
eq
(
'http://test.example.com/gitlab/gitlab'
)
expect
(
data
[
:project
][
:avatar_url
]).
to
eq
(
'https://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=8://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=80'
)
expect
(
data
[
:project
][
:git_http_url
]).
to
eq
(
'http://test.example.com/gitlab/gitlab.git'
)
expect
(
data
[
:project
][
:git_ssh_url
]).
to
eq
(
'git@test.example.com:gitlab/gitlab.git'
)
expect
(
data
[
:project
][
:namespace
]).
to
eq
(
'gitlab'
)
expect
(
data
[
:project
][
:visibility_level
]).
to
eq
(
0
)
expect
(
data
[
:project
][
:path_with_namespace
]).
to
eq
(
'gitlab/gitlab'
)
expect
(
data
[
:project
][
:default_branch
]).
to
eq
(
'master'
)
end
end
describe
'.build'
do
let
(
:data
)
do
described_class
.
build
(
...
...
spec/lib/gitlab/import_export/safe_model_attributes.yml
View file @
dac6eea5
...
...
@@ -752,4 +752,4 @@ DesignManagement::Version:
-
created_at
-
sha
-
issue_id
-
use
r_id
-
autho
r_id
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