Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5d90377c
Commit
5d90377c
authored
Sep 01, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-09-01
parents
4584d760
f9b96bd2
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
164 additions
and
65 deletions
+164
-65
app/assets/javascripts/ide/components/repo_file.vue
app/assets/javascripts/ide/components/repo_file.vue
+7
-5
app/assets/stylesheets/framework/typography.scss
app/assets/stylesheets/framework/typography.scss
+1
-1
app/assets/stylesheets/framework/variables.scss
app/assets/stylesheets/framework/variables.scss
+1
-0
app/assets/stylesheets/page_bundles/ide.scss
app/assets/stylesheets/page_bundles/ide.scss
+1
-1
app/assets/stylesheets/pages/diff.scss
app/assets/stylesheets/pages/diff.scss
+0
-4
app/helpers/submodule_helper.rb
app/helpers/submodule_helper.rb
+20
-17
app/models/concerns/triggerable_hooks.rb
app/models/concerns/triggerable_hooks.rb
+1
-0
app/workers/background_migration_worker.rb
app/workers/background_migration_worker.rb
+1
-13
changelogs/unreleased/37356-relative-submodule-link.yml
changelogs/unreleased/37356-relative-submodule-link.yml
+5
-0
changelogs/unreleased/47765-group-visibility-error-due-to-string-conversion.yml
...47765-group-visibility-error-due-to-string-conversion.yml
+6
-0
changelogs/unreleased/ide-row-hover-scroll.yml
changelogs/unreleased/ide-row-hover-scroll.yml
+5
-0
changelogs/unreleased/remove-background-migration-worker-feature-flag.yml
...eased/remove-background-migration-worker-feature-flag.yml
+5
-0
changelogs/unreleased/sh-fix-confidential-note-option.yml
changelogs/unreleased/sh-fix-confidential-note-option.yml
+5
-0
changelogs/unreleased/update-padding-markdown.yml
changelogs/unreleased/update-padding-markdown.yml
+5
-0
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+6
-0
lib/gitlab/import_export/project_tree_restorer.rb
lib/gitlab/import_export/project_tree_restorer.rb
+4
-1
qa/qa/page/view.rb
qa/qa/page/view.rb
+3
-1
spec/controllers/projects/hooks_controller_spec.rb
spec/controllers/projects/hooks_controller_spec.rb
+1
-0
spec/helpers/submodule_helper_spec.rb
spec/helpers/submodule_helper_spec.rb
+55
-20
spec/javascripts/ide/components/repo_file_spec.js
spec/javascripts/ide/components/repo_file_spec.js
+21
-0
spec/lib/gitlab/import_export/importer_spec.rb
spec/lib/gitlab/import_export/importer_spec.rb
+10
-0
spec/spec_helper.rb
spec/spec_helper.rb
+1
-0
spec/support/rspec.rb
spec/support/rspec.rb
+0
-2
No files found.
app/assets/javascripts/ide/components/repo_file.vue
View file @
5d90377c
...
...
@@ -95,16 +95,18 @@ export default {
return
this
.
file
.
changed
||
this
.
file
.
tempFile
||
this
.
file
.
staged
;
},
},
watch
:
{
'
file.active
'
:
function
fileActiveWatch
(
active
)
{
if
(
this
.
file
.
type
===
'
blob
'
&&
active
)
{
this
.
scrollIntoView
();
}
},
},
mounted
()
{
if
(
this
.
hasPathAtCurrentRoute
())
{
this
.
scrollIntoView
(
true
);
}
},
updated
()
{
if
(
this
.
file
.
type
===
'
blob
'
&&
this
.
file
.
active
)
{
this
.
scrollIntoView
();
}
},
methods
:
{
...
mapActions
([
'
toggleTreeOpen
'
]),
clickFile
()
{
...
...
app/assets/stylesheets/framework/typography.scss
View file @
5d90377c
...
...
@@ -327,7 +327,7 @@ h6 {
pre
{
font-family
:
$monospace-font
;
display
:
block
;
padding
:
$gl-padding-8
;
padding
:
$gl-padding-8
$input-horizontal-padding
;
margin
:
0
0
$gl-padding-8
;
font-size
:
13px
;
word-break
:
break-all
;
...
...
app/assets/stylesheets/framework/variables.scss
View file @
5d90377c
...
...
@@ -237,6 +237,7 @@ $gl-vert-padding: 6px;
$gl-padding-top
:
10px
;
$gl-sidebar-padding
:
22px
;
$gl-bar-padding
:
3px
;
$input-horizontal-padding
:
12px
;
/*
* Misc
...
...
app/assets/stylesheets/page_bundles/ide.scss
View file @
5d90377c
...
...
@@ -1145,7 +1145,7 @@ $ide-tree-text-start: $ide-activity-bar-width + $ide-tree-padding;
}
.avatar-container
{
flex
:
initial
;
flex
:
0
0
auto
;
margin-right
:
0
;
}
...
...
app/assets/stylesheets/pages/diff.scss
View file @
5d90377c
...
...
@@ -25,10 +25,6 @@
color
:
$gl-text-color
;
border-radius
:
0
0
3px
3px
;
.code
{
padding
:
0
;
}
.unfold
{
cursor
:
pointer
;
}
...
...
app/helpers/submodule_helper.rb
View file @
5d90377c
...
...
@@ -64,8 +64,7 @@ module SubmoduleHelper
end
def
relative_self_url?
(
url
)
# (./)?(../repo.git) || (./)?(../../project/repo.git) )
url
=~
%r{
\A
((
\.
/)?(
\.\.
/))(?!(
\.\.
)|(.*/)).*(
\.
git)?
\z
}
||
url
=~
%r{
\A
((
\.
/)?(
\.\.
/){2})(?!(
\.\.
))([^/]*)/(?!(
\.\.
)|(.*/)).*(
\.
git)?
\z
}
url
.
start_with?
(
'../'
,
'./'
)
end
def
standard_links
(
host
,
namespace
,
project
,
commit
)
...
...
@@ -73,25 +72,29 @@ module SubmoduleHelper
[
base
,
[
base
,
'/tree/'
,
commit
].
join
(
''
)]
end
def
relative_self_links
(
url
,
commit
,
project
)
url
.
rstrip!
# Map relative links to a namespace and project
# For example:
# ../bar.git -> same namespace, repo bar
# ../foo/bar.git -> namespace foo, repo bar
# ../../foo/bar/baz.git -> namespace bar, repo baz
components
=
url
.
split
(
'/'
)
base
=
components
.
pop
.
gsub
(
/.git$/
,
''
)
namespace
=
components
.
pop
.
gsub
(
/^\.\.$/
,
''
)
if
namespace
.
empty?
namespace
=
project
.
namespace
.
full_path
def
relative_self_links
(
relative_path
,
commit
,
project
)
relative_path
.
rstrip!
absolute_project_path
=
"/"
+
project
.
full_path
# Resolve `relative_path` to target path
# Assuming `absolute_project_path` is `/g1/p1`:
# ../p2.git -> /g1/p2
# ../g2/p3.git -> /g1/g2/p3
# ../../g3/g4/p4.git -> /g3/g4/p4
submodule_project_path
=
File
.
absolute_path
(
relative_path
,
absolute_project_path
)
target_namespace_path
=
File
.
dirname
(
submodule_project_path
)
if
target_namespace_path
==
'/'
||
target_namespace_path
.
start_with?
(
absolute_project_path
)
return
[
nil
,
nil
]
end
target_namespace_path
.
sub!
(
%r{^/}
,
''
)
submodule_base
=
File
.
basename
(
submodule_project_path
,
'.git'
)
begin
[
namespace_project_path
(
namespace
,
base
),
namespace_project_tree_path
(
namespace
,
base
,
commit
)
namespace_project_path
(
target_namespace_path
,
submodule_
base
),
namespace_project_tree_path
(
target_namespace_path
,
submodule_
base
,
commit
)
]
rescue
ActionController
::
UrlGenerationError
[
nil
,
nil
]
...
...
app/models/concerns/triggerable_hooks.rb
View file @
5d90377c
...
...
@@ -6,6 +6,7 @@ module TriggerableHooks
push_hooks: :push_events
,
tag_push_hooks: :tag_push_events
,
issue_hooks: :issues_events
,
confidential_note_hooks: :confidential_note_events
,
confidential_issue_hooks: :confidential_issues_events
,
note_hooks: :note_events
,
merge_request_hooks: :merge_requests_events
,
...
...
app/workers/background_migration_worker.rb
View file @
5d90377c
...
...
@@ -10,17 +10,7 @@ class BackgroundMigrationWorker
# maintenance related tasks have plenty of time to clean up after a migration
# has been performed.
def
self
.
minimum_interval
if
enable_health_check?
2
.
minutes
.
to_i
else
5
.
minutes
.
to_i
end
end
def
self
.
enable_health_check?
Rails
.
env
.
development?
||
Rails
.
env
.
test?
||
Feature
.
enabled?
(
'background_migration_health_check'
)
2
.
minutes
.
to_i
end
# Performs the background migration.
...
...
@@ -86,8 +76,6 @@ class BackgroundMigrationWorker
# class_name - The name of the background migration that we might want to
# run.
def
healthy_database?
return
true
unless
self
.
class
.
enable_health_check?
return
true
unless
Gitlab
::
Database
.
postgresql?
!
Postgresql
::
ReplicationSlot
.
lag_too_great?
...
...
changelogs/unreleased/37356-relative-submodule-link.yml
0 → 100644
View file @
5d90377c
---
title
:
Fix git submodule link for subgroup projects with relative path
merge_request
:
21154
author
:
type
:
fixed
changelogs/unreleased/47765-group-visibility-error-due-to-string-conversion.yml
0 → 100644
View file @
5d90377c
---
title
:
Importing a project no longer fails when visibility level holds a string value
type
merge_request
:
21242
author
:
type
:
fixed
changelogs/unreleased/ide-row-hover-scroll.yml
0 → 100644
View file @
5d90377c
---
title
:
Fixed IDE file row scrolling into view when hovering
merge_request
:
author
:
type
:
fixed
changelogs/unreleased/remove-background-migration-worker-feature-flag.yml
0 → 100644
View file @
5d90377c
---
title
:
Remove health check feature flag in BackgroundMigrationWorker
merge_request
:
author
:
type
:
changed
changelogs/unreleased/sh-fix-confidential-note-option.yml
0 → 100644
View file @
5d90377c
---
title
:
Fix "Confidential comments" button not saving in project hooks
merge_request
:
21289
author
:
type
:
fixed
changelogs/unreleased/update-padding-markdown.yml
0 → 100644
View file @
5d90377c
---
title
:
Increase padding in code blocks
merge_request
:
author
:
type
:
fixed
lib/gitlab/git_access.rb
View file @
5d90377c
...
...
@@ -237,6 +237,8 @@ module Gitlab
end
elsif
user
# User access is verified in check_change_access!
elsif
authed_via_jwt?
# Authenticated via JWT
else
raise
UnauthorizedError
,
ERROR_MESSAGES
[
:upload
]
end
...
...
@@ -344,6 +346,10 @@ module Gitlab
!
Gitlab
.
config
.
gitlab_shell
.
receive_pack
end
def
authed_via_jwt?
false
end
protected
def
check_size_limit?
...
...
lib/gitlab/import_export/project_tree_restorer.rb
View file @
5d90377c
...
...
@@ -94,7 +94,10 @@ module Gitlab
end
def
restore_project
@project
.
update_columns
(
project_params
)
Gitlab
::
Timeless
.
timeless
(
@project
)
do
@project
.
update
(
project_params
)
end
@project
end
...
...
qa/qa/page/view.rb
View file @
5d90377c
require
'pathname'
module
QA
module
Page
class
View
...
...
@@ -9,7 +11,7 @@ module QA
end
def
pathname
@pathname
||=
Pathname
.
new
(
::
File
.
join
(
__dir__
,
'../../../'
,
@path
))
@pathname
||=
::
Pathname
.
new
(
::
File
.
join
(
__dir__
,
'../../../'
,
@path
))
.
cleanpath
.
expand_path
end
...
...
spec/controllers/projects/hooks_controller_spec.rb
View file @
5d90377c
...
...
@@ -30,6 +30,7 @@ describe Projects::HooksController do
tag_push_events:
true
,
merge_requests_events:
true
,
issues_events:
true
,
confidential_note_events:
true
,
confidential_issues_events:
true
,
note_events:
true
,
job_events:
true
,
...
...
spec/helpers/submodule_helper_spec.rb
View file @
5d90377c
...
...
@@ -162,42 +162,77 @@ describe SubmoduleHelper do
end
context
'submodules with relative links'
do
let
(
:group
)
{
create
(
:group
,
name:
"
Master Project"
,
path:
"master-project
"
)
}
let
(
:group
)
{
create
(
:group
,
name:
"
top group"
,
path:
"top-group
"
)
}
let
(
:project
)
{
create
(
:project
,
group:
group
)
}
let
(
:commit_id
)
{
sample_commit
[
:id
]
}
let
(
:repo
)
{
double
(
:repo
,
project:
project
)
}
def
expect_relative_link_to_resolve_to
(
relative_path
,
expected_path
)
allow
(
repo
).
to
receive
(
:submodule_url_for
).
and_return
(
relative_path
)
result
=
submodule_links
(
submodule_item
)
expect
(
result
).
to
eq
([
expected_path
,
"
#{
expected_path
}
/tree/
#{
submodule_item
.
id
}
"
])
end
it
'one level down'
do
result
=
relative_self_links
(
'../test.git'
,
commit_id
,
project
)
expect
(
result
).
to
eq
([
"/
#{
group
.
path
}
/test"
,
"/
#{
group
.
path
}
/test/tree/
#{
commit_id
}
"
])
it
'handles project under same group'
do
expect_relative_link_to_resolve_to
(
'../test.git'
,
"/
#{
group
.
path
}
/test"
)
end
it
'with trailing whitespace'
do
result
=
relative_self_links
(
'../test.git '
,
commit_id
,
project
)
expect
(
result
).
to
eq
([
"/
#{
group
.
path
}
/test"
,
"/
#{
group
.
path
}
/test/tree/
#{
commit_id
}
"
])
it
'handles trailing whitespace'
do
expect_relative_link_to_resolve_to
(
'../test.git '
,
"/
#{
group
.
path
}
/test"
)
end
it
'two levels down'
do
result
=
relative_self_links
(
'../../test.git'
,
commit_id
,
project
)
expect
(
result
).
to
eq
([
"/
#{
group
.
path
}
/test"
,
"/
#{
group
.
path
}
/test/tree/
#{
commit_id
}
"
])
it
'handles project under another top group'
do
expect_relative_link_to_resolve_to
(
'../../baz/test.git '
,
"/baz/test"
)
end
context
'repo path resolves to be located at root (namespace absent)'
do
it
'returns nil'
do
allow
(
repo
).
to
receive
(
:submodule_url_for
).
and_return
(
'../../test.git'
)
result
=
submodule_links
(
submodule_item
)
expect
(
result
).
to
eq
([
nil
,
nil
])
end
end
it
'one level down with namespace and repo'
do
result
=
relative_self_links
(
'../foobar/test.git'
,
commit_id
,
project
)
expect
(
result
).
to
eq
([
"/foobar/test"
,
"/foobar/test/tree/
#{
commit_id
}
"
])
context
'repo path resolves to be located underneath current project path'
do
it
'returns nil because it is not possible to have repo nested under another repo'
do
allow
(
repo
).
to
receive
(
:submodule_url_for
).
and_return
(
'./test.git'
)
result
=
submodule_links
(
submodule_item
)
expect
(
result
).
to
eq
([
nil
,
nil
])
end
end
it
'two levels down with namespace and repo'
do
result
=
relative_self_links
(
'../foobar/baz/test.git'
,
commit_id
,
project
)
expect
(
result
).
to
eq
([
"/baz/test"
,
"/baz/test/tree/
#{
commit_id
}
"
])
context
'subgroup'
do
let
(
:sub_group
)
{
create
(
:group
,
parent:
group
,
name:
"sub group"
,
path:
"sub-group"
)
}
let
(
:sub_project
)
{
create
(
:project
,
group:
sub_group
)
}
context
'project in sub group'
do
let
(
:project
)
{
sub_project
}
it
"handles referencing ancestor group's project"
do
expect_relative_link_to_resolve_to
(
'../../../top-group/test.git'
,
"/
#{
group
.
path
}
/test"
)
end
end
it
"handles referencing descendent group's project"
do
expect_relative_link_to_resolve_to
(
'../sub-group/test.git'
,
"/top-group/sub-group/test"
)
end
it
"handles referencing another top group's project"
do
expect_relative_link_to_resolve_to
(
'../../frontend/css/test.git'
,
"/frontend/css/test"
)
end
end
context
'personal project'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
it
'one level down with personal project'
do
result
=
relative_self_links
(
'../test.git'
,
commit_id
,
project
)
expect
(
result
).
to
eq
([
"/
#{
user
.
username
}
/test"
,
"/
#{
user
.
username
}
/test/tree/
#{
commit_id
}
"
])
it
'handles referencing another personal project'
do
expect_relative_link_to_resolve_to
(
'../test.git'
,
"/
#{
user
.
username
}
/test"
)
end
end
end
...
...
spec/javascripts/ide/components/repo_file_spec.js
View file @
5d90377c
...
...
@@ -121,4 +121,25 @@ describe('RepoFile', () => {
).
toContain
(
'
Locked by testuser
'
);
});
});
it
(
'
calls scrollIntoView if made active
'
,
done
=>
{
createComponent
({
file
:
{
...
file
(),
type
:
'
blob
'
,
active
:
false
,
},
level
:
0
,
});
spyOn
(
vm
,
'
scrollIntoView
'
);
vm
.
file
.
active
=
true
;
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
scrollIntoView
).
toHaveBeenCalled
();
done
();
});
});
});
spec/lib/gitlab/import_export/importer_spec.rb
View file @
5d90377c
...
...
@@ -63,6 +63,16 @@ describe Gitlab::ImportExport::Importer do
importer
.
execute
end
it
'sets the correct visibility_level when visibility level is a string'
do
project
.
create_or_update_import_data
(
data:
{
override_params:
{
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
.
to_s
}
}
)
importer
.
execute
expect
(
project
.
visibility_level
).
to
eq
(
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
end
context
'when project successfully restored'
do
...
...
spec/spec_helper.rb
View file @
5d90377c
...
...
@@ -44,6 +44,7 @@ Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
RSpec
.
configure
do
|
config
|
config
.
use_transactional_fixtures
=
false
config
.
use_instantiated_fixtures
=
false
config
.
fixture_path
=
Rails
.
root
config
.
verbose_retry
=
true
config
.
display_try_failure_messages
=
true
...
...
spec/support/rspec.rb
View file @
5d90377c
...
...
@@ -11,6 +11,4 @@ RSpec.configure do |config|
config
.
include
StubMetrics
config
.
include
StubObjectStorage
config
.
include
StubENV
config
.
fixture_path
=
Rails
.
root
if
defined?
(
Rails
)
end
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