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
1b9249eb
Commit
1b9249eb
authored
Mar 28, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into ce-to-ee-2018-03-28
parents
1fe04329
26ed2d2a
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
144 additions
and
31 deletions
+144
-31
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+13
-13
changelogs/unreleased/move-registry-after-cicd-project-nav-sidebar.yml
...released/move-registry-after-cicd-project-nav-sidebar.yml
+5
-0
doc/development/ee_features.md
doc/development/ee_features.md
+22
-1
ee/app/services/ee/projects/update_service.rb
ee/app/services/ee/projects/update_service.rb
+11
-2
ee/app/services/geo/base_sync_service.rb
ee/app/services/geo/base_sync_service.rb
+1
-1
ee/changelogs/unreleased/mk-geo-sync-reenabled-wikis.yml
ee/changelogs/unreleased/mk-geo-sync-reenabled-wikis.yml
+5
-0
ee/spec/services/projects/update_service_spec.rb
ee/spec/services/projects/update_service_spec.rb
+73
-0
lib/api/project_import.rb
lib/api/project_import.rb
+0
-0
qa/qa/ee/scenario/test/geo.rb
qa/qa/ee/scenario/test/geo.rb
+2
-2
qa/qa/scenario/bootable.rb
qa/qa/scenario/bootable.rb
+1
-1
qa/qa/scenario/test/instance.rb
qa/qa/scenario/test/instance.rb
+4
-4
qa/qa/scenario/test/integration/mattermost.rb
qa/qa/scenario/test/integration/mattermost.rb
+2
-2
qa/qa/specs/runner.rb
qa/qa/specs/runner.rb
+3
-3
qa/spec/scenario/test/instance_spec.rb
qa/spec/scenario/test/instance_spec.rb
+2
-2
spec/requests/api/project_import_spec.rb
spec/requests/api/project_import_spec.rb
+0
-0
No files found.
app/views/layouts/nav/sidebar/_project.html.haml
View file @
1b9249eb
...
...
@@ -85,19 +85,6 @@
=
link_to
project_path_locks_path
(
@project
)
do
#{
_
(
'Locked Files'
)
}
-
if
project_nav_tab?
:container_registry
=
nav_link
(
controller:
%w[projects/registry/repositories]
)
do
=
link_to
project_container_registry_index_path
(
@project
),
class:
'shortcuts-container-registry'
do
.nav-icon-container
=
sprite_icon
(
'disk'
)
%span
.nav-item-name
Registry
%ul
.sidebar-sub-level-items.is-fly-out-only
=
nav_link
(
controller:
%w[projects/registry/repositories]
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
link_to
project_container_registry_index_path
(
@project
)
do
%strong
.fly-out-top-item-name
#{
_
(
'Registry'
)
}
-
if
project_nav_tab?
:issues
=
nav_link
(
controller:
@project
.
issues_enabled?
?
[
:issues
,
:labels
,
:milestones
,
:boards
]
:
:issues
)
do
=
link_to
project_issues_path
(
@project
),
class:
'shortcuts-issues'
do
...
...
@@ -245,6 +232,19 @@
%span
Charts
-
if
project_nav_tab?
:container_registry
=
nav_link
(
controller:
%w[projects/registry/repositories]
)
do
=
link_to
project_container_registry_index_path
(
@project
),
class:
'shortcuts-container-registry'
do
.nav-icon-container
=
sprite_icon
(
'disk'
)
%span
.nav-item-name
Registry
%ul
.sidebar-sub-level-items.is-fly-out-only
=
nav_link
(
controller:
%w[projects/registry/repositories]
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
link_to
project_container_registry_index_path
(
@project
)
do
%strong
.fly-out-top-item-name
#{
_
(
'Registry'
)
}
-
if
project_nav_tab?
:wiki
=
nav_link
(
controller: :wikis
)
do
=
link_to
get_project_wiki_path
(
@project
),
class:
'shortcuts-wiki'
do
...
...
changelogs/unreleased/move-registry-after-cicd-project-nav-sidebar.yml
0 → 100644
View file @
1b9249eb
---
title
:
Move 'Registry' after 'CI/CD' in project navigation sidebar
merge_request
:
18018
author
:
Elias Werberich
type
:
changed
doc/development/ee_features.md
View file @
1b9249eb
...
...
@@ -33,6 +33,26 @@ rest of the code should be as close to the CE files as possible.
[
single code base
]:
https://gitlab.com/gitlab-org/gitlab-ee/issues/2952#note_41016454
### EE-specific comments
When complete separation can't be achieved with the
`ee/`
directory, you can wrap
code in EE specific comments to designate the difference from CE/EE and add
some context for someone resolving a conflict.
```
rb
# EE-specific start
stub_licensed_features
(
variable_environment_scope:
true
)
# EE specific end
```
```
haml
-# EE-specific start
=
render
'ci/variables/environment_scope'
,
form_field:
form_field
,
variable:
variable
-
# EE-specific end
```
EE-specific comments should not be backported to CE.
### Detection of EE-only files
For each commit (except on
`master`
), the
`ee-files-location-check`
CI job tries
...
...
@@ -405,12 +425,13 @@ to avoid conflicts during CE to EE merge.
}
}
/
* EE-specific styles */
/
/ EE-specific start
.section-body.ee-section-body
{
.section-title
{
background
:
$gl-header-color-cyan
;
}
}
// EE-specific end
```
## gitlab-svgs
...
...
ee/app/services/ee/projects/update_service.rb
View file @
1b9249eb
...
...
@@ -14,12 +14,17 @@ module EE
end
should_remove_old_approvers
=
params
.
delete
(
:remove_old_approvers
)
wiki_was_enabled
=
project
.
wiki_enabled?
result
=
super
cleanup_approvers
(
project
)
if
should_remove_old_approvers
&&
result
[
:status
]
==
:success
if
result
[
:status
]
==
:success
cleanup_approvers
(
project
)
if
should_remove_old_approvers
log_audit_events
if
result
[
:status
]
==
:success
log_audit_events
sync_wiki_on_enable
if
!
wiki_was_enabled
&&
project
.
wiki_enabled?
end
result
end
...
...
@@ -36,6 +41,10 @@ module EE
def
log_audit_events
EE
::
Audit
::
ProjectChangesAuditor
.
new
(
current_user
,
project
).
execute
end
def
sync_wiki_on_enable
::
Geo
::
RepositoryUpdatedService
.
new
(
project
,
source:
::
Geo
::
RepositoryUpdatedEvent
::
WIKI
).
execute
end
end
end
end
ee/app/services/geo/base_sync_service.rb
View file @
1b9249eb
...
...
@@ -178,7 +178,7 @@ module Geo
log_info
(
"Created temporary repository"
)
repository
.
clone
.
tap
{
|
repo
|
repo
.
disk_path
=
disk_path_temp
}
::
Repository
.
new
(
repository
.
full_path
,
repository
.
project
,
disk_path:
disk_path_temp
,
is_wiki:
repository
.
is_wiki
)
end
def
clean_up_temporary_repository
...
...
ee/changelogs/unreleased/mk-geo-sync-reenabled-wikis.yml
0 → 100644
View file @
1b9249eb
---
title
:
'
Geo:
Sync
wiki
when
it
is
enabled'
merge_request
:
5139
author
:
type
:
fixed
ee/spec/services/projects/update_service_spec.rb
View file @
1b9249eb
require
'spec_helper'
describe
Projects
::
UpdateService
,
'#execute'
do
include
EE
::
GeoHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
)
}
...
...
@@ -123,6 +125,77 @@ describe Projects::UpdateService, '#execute' do
end
end
context
'triggering wiki Geo syncs'
,
:geo
do
context
'on a Geo primary'
do
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
before
do
stub_current_geo_node
(
primary
)
end
context
'when enabling a wiki'
do
it
'creates a RepositoryUpdatedEvent'
do
project
.
project_feature
.
update
(
wiki_access_level:
ProjectFeature
::
DISABLED
)
project
.
reload
expect
do
result
=
update_project
(
project
,
user
,
project_feature_attributes:
{
wiki_access_level:
ProjectFeature
::
ENABLED
})
expect
(
result
).
to
eq
({
status: :success
})
end
.
to
change
{
Geo
::
RepositoryUpdatedEvent
.
count
}.
by
(
1
)
expect
(
project
.
wiki_enabled?
).
to
be
true
end
end
context
'when we update project but not enabling a wiki'
do
context
'when the wiki is disabled'
do
it
'does not create a RepositoryUpdatedEvent'
do
project
.
project_feature
.
update
(
wiki_access_level:
ProjectFeature
::
DISABLED
)
expect
do
result
=
update_project
(
project
,
user
,
{
name:
'test1'
})
expect
(
result
).
to
eq
({
status: :success
})
end
.
not_to
change
{
Geo
::
RepositoryUpdatedEvent
.
count
}
expect
(
project
.
wiki_enabled?
).
to
be
false
end
end
context
'when the wiki was already enabled'
do
it
'does not create a RepositoryUpdatedEvent'
do
project
.
project_feature
.
update
(
wiki_access_level:
ProjectFeature
::
ENABLED
)
expect
do
result
=
update_project
(
project
,
user
,
{
name:
'test1'
})
expect
(
result
).
to
eq
({
status: :success
})
end
.
not_to
change
{
Geo
::
RepositoryUpdatedEvent
.
count
}
expect
(
project
.
wiki_enabled?
).
to
be
true
end
end
end
end
context
'not on a Geo node'
do
before
do
allow
(
::
Gitlab
::
Geo
).
to
receive
(
:current_node
).
and_return
(
nil
)
end
it
'does not create a RepositoryUpdatedEvent when enabling a wiki'
do
project
.
project_feature
.
update
(
wiki_access_level:
ProjectFeature
::
DISABLED
)
project
.
reload
expect
do
result
=
update_project
(
project
,
user
,
project_feature_attributes:
{
wiki_access_level:
ProjectFeature
::
ENABLED
})
expect
(
result
).
to
eq
({
status: :success
})
end
.
not_to
change
{
Geo
::
RepositoryUpdatedEvent
.
count
}
expect
(
project
.
wiki_enabled?
).
to
be
true
end
end
end
def
update_project
(
project
,
user
,
opts
)
Projects
::
UpdateService
.
new
(
project
,
user
,
opts
).
execute
end
...
...
ee/
lib/api/project_import.rb
→
lib/api/project_import.rb
View file @
1b9249eb
File moved
qa/qa/ee/scenario/test/geo.rb
View file @
1b9249eb
...
...
@@ -11,8 +11,8 @@ module QA
attribute
:geo_secondary_name
,
'--secondary-name SECONDARY_NAME'
attribute
:geo_skip_setup?
,
'--without-setup'
def
perform
(
**
arg
s
)
unless
arg
s
[
:geo_skip_setup?
]
def
perform
(
options
,
*
file
s
)
unless
option
s
[
:geo_skip_setup?
]
Geo
::
Primary
.
act
do
add_license
enable_hashed_storage
...
...
qa/qa/scenario/bootable.rb
View file @
1b9249eb
...
...
@@ -23,7 +23,7 @@ module QA
arguments
.
parse!
(
argv
)
self
.
perform
(
**
Runtime
::
Scenario
.
attributes
)
self
.
perform
(
Runtime
::
Scenario
.
attributes
,
*
arguments
.
default_argv
)
end
private
...
...
qa/qa/scenario/test/instance.rb
View file @
1b9249eb
...
...
@@ -11,7 +11,7 @@ module QA
tags
:core
def
perform
(
address
,
*
file
s
)
def
perform
(
address
,
*
rspec_option
s
)
Runtime
::
Scenario
.
define
(
:gitlab_address
,
address
)
##
...
...
@@ -22,9 +22,9 @@ module QA
Specs
::
Runner
.
perform
do
|
specs
|
specs
.
tty
=
true
specs
.
tags
=
self
.
class
.
focus
specs
.
file
s
=
if
file
s
.
any?
file
s
specs
.
option
s
=
if
rspec_option
s
.
any?
rspec_option
s
else
File
.
expand_path
(
'../../specs/features'
,
__dir__
)
end
...
...
qa/qa/scenario/test/integration/mattermost.rb
View file @
1b9249eb
...
...
@@ -9,10 +9,10 @@ module QA
class
Mattermost
<
Test
::
Instance
tags
:core
,
:mattermost
def
perform
(
address
,
mattermost
,
*
file
s
)
def
perform
(
address
,
mattermost
,
*
rspec_option
s
)
Runtime
::
Scenario
.
define
(
:mattermost_address
,
mattermost
)
super
(
address
,
*
file
s
)
super
(
address
,
*
rspec_option
s
)
end
end
end
...
...
qa/qa/specs/runner.rb
View file @
1b9249eb
...
...
@@ -3,19 +3,19 @@ require 'rspec/core'
module
QA
module
Specs
class
Runner
<
Scenario
::
Template
attr_accessor
:tty
,
:tags
,
:
file
s
attr_accessor
:tty
,
:tags
,
:
option
s
def
initialize
@tty
=
false
@tags
=
[]
@
file
s
=
[
File
.
expand_path
(
'./features'
,
__dir__
)]
@
option
s
=
[
File
.
expand_path
(
'./features'
,
__dir__
)]
end
def
perform
args
=
[]
args
.
push
(
'--tty'
)
if
tty
tags
.
to_a
.
each
{
|
tag
|
args
.
push
([
'-t'
,
tag
.
to_s
])
}
args
.
push
(
file
s
)
args
.
push
(
option
s
)
Runtime
::
Browser
.
configure!
...
...
qa/spec/scenario/test/instance_spec.rb
View file @
1b9249eb
...
...
@@ -29,7 +29,7 @@ describe QA::Scenario::Test::Instance do
it
'should call runner with default arguments'
do
subject
.
perform
(
"test"
)
expect
(
runner
).
to
have_received
(
:
file
s
=
)
expect
(
runner
).
to
have_received
(
:
option
s
=
)
.
with
(
File
.
expand_path
(
'../../../qa/specs/features'
,
__dir__
))
end
end
...
...
@@ -38,7 +38,7 @@ describe QA::Scenario::Test::Instance do
it
'should call runner with paths'
do
subject
.
perform
(
'test'
,
'path1'
,
'path2'
)
expect
(
runner
).
to
have_received
(
:
file
s
=
).
with
(
%w[path1 path2]
)
expect
(
runner
).
to
have_received
(
:
option
s
=
).
with
(
%w[path1 path2]
)
end
end
end
...
...
ee/
spec/requests/api/project_import_spec.rb
→
spec/requests/api/project_import_spec.rb
View file @
1b9249eb
File moved
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