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
6202c551
Commit
6202c551
authored
Jun 30, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/security/gitlab@13-12-stable-ee
parent
64ed8e1d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
app/services/projects/fork_service.rb
app/services/projects/fork_service.rb
+3
-2
spec/services/projects/fork_service_spec.rb
spec/services/projects/fork_service_spec.rb
+13
-8
No files found.
app/services/projects/fork_service.rb
View file @
6202c551
...
...
@@ -34,8 +34,9 @@ module Projects
new_project
=
CreateService
.
new
(
current_user
,
new_fork_params
).
execute
return
new_project
unless
new_project
.
persisted?
builds_access_level
=
@project
.
project_feature
.
builds_access_level
new_project
.
project_feature
.
update
(
builds_access_level:
builds_access_level
)
new_project
.
project_feature
.
update!
(
@project
.
project_feature
.
slice
(
ProjectFeature
::
FEATURES
.
map
{
|
f
|
"
#{
f
}
_access_level"
})
)
new_project
end
...
...
spec/services/projects/fork_service_spec.rb
View file @
6202c551
...
...
@@ -184,14 +184,6 @@ RSpec.describe Projects::ForkService do
end
end
context
'GitLab CI is enabled'
do
it
"forks and enables CI for fork"
do
@from_project
.
enable_ci
@to_project
=
fork_project
(
@from_project
,
@to_user
,
using_service:
true
)
expect
(
@to_project
.
builds_enabled?
).
to
be_truthy
end
end
context
"CI/CD settings"
do
let
(
:to_project
)
{
fork_project
(
@from_project
,
@to_user
,
using_service:
true
)
}
...
...
@@ -366,6 +358,19 @@ RSpec.describe Projects::ForkService do
expect
(
forked_project
.
visibility_level
).
to
eq
(
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
it
'copies project features visibility settings to the fork'
,
:aggregate_failures
do
attrs
=
ProjectFeature
::
FEATURES
.
to_h
do
|
f
|
[
"
#{
f
}
_access_level"
,
ProjectFeature
::
PRIVATE
]
end
public_project
.
project_feature
.
update!
(
attrs
)
user
=
create
(
:user
,
developer_projects:
[
public_project
])
forked_project
=
described_class
.
new
(
public_project
,
user
).
execute
expect
(
forked_project
.
project_feature
.
slice
(
attrs
.
keys
)).
to
eq
(
attrs
)
end
end
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