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
b39656f6
Commit
b39656f6
authored
Sep 27, 2019
by
Mathieu Parent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preserve custom .gitlab-ci.yml config path when forking
Fixes: #22875, #30242
parent
51eae761
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
app/services/projects/fork_service.rb
app/services/projects/fork_service.rb
+1
-0
changelogs/unreleased/fork_gitlab_ci.yml
changelogs/unreleased/fork_gitlab_ci.yml
+5
-0
spec/services/projects/fork_service_spec.rb
spec/services/projects/fork_service_spec.rb
+12
-9
No files found.
app/services/projects/fork_service.rb
View file @
b39656f6
...
...
@@ -43,6 +43,7 @@ module Projects
shared_runners_enabled:
@project
.
shared_runners_enabled
,
namespace_id:
target_namespace
.
id
,
fork_network:
fork_network
,
ci_config_path:
@project
.
ci_config_path
,
# We need to set ci_default_git_depth to 0 for the forked project when
# @project.ci_default_git_depth is nil in order to keep the same behaviour
# and not get ProjectCiCdSetting::DEFAULT_GIT_DEPTH set on create
...
...
changelogs/unreleased/fork_gitlab_ci.yml
0 → 100644
View file @
b39656f6
---
title
:
Preserve custom .gitlab-ci.yml config path when forking.
merge_request
:
17817
author
:
Mathieu Parent
type
:
added
spec/services/projects/fork_service_spec.rb
View file @
b39656f6
...
...
@@ -50,6 +50,7 @@ describe Projects::ForkService do
it
{
expect
(
to_project
.
star_count
).
to
be_zero
}
it
{
expect
(
to_project
.
description
).
to
eq
(
@from_project
.
description
)
}
it
{
expect
(
to_project
.
avatar
.
file
).
to
be_exists
}
it
{
expect
(
to_project
.
ci_config_path
).
to
eq
(
@from_project
.
ci_config_path
)
}
# This test is here because we had a bug where the from-project lost its
# avatar after being forked.
...
...
@@ -215,7 +216,8 @@ describe Projects::ForkService do
@project
=
create
(
:project
,
:repository
,
creator_id:
@group_owner
.
id
,
star_count:
777
,
description:
'Wow, such a cool project!'
)
description:
'Wow, such a cool project!'
,
ci_config_path:
'debian/salsa-ci.yml'
)
@group
=
create
(
:group
)
@group
.
add_user
(
@group_owner
,
GroupMember
::
OWNER
)
@group
.
add_user
(
@developer
,
GroupMember
::
DEVELOPER
)
...
...
@@ -228,14 +230,15 @@ describe Projects::ForkService do
it
'group owner successfully forks project into the group'
do
to_project
=
fork_project
(
@project
,
@group_owner
,
@opts
)
expect
(
to_project
).
to
be_persisted
expect
(
to_project
.
errors
).
to
be_empty
expect
(
to_project
.
owner
).
to
eq
(
@group
)
expect
(
to_project
.
namespace
).
to
eq
(
@group
)
expect
(
to_project
.
name
).
to
eq
(
@project
.
name
)
expect
(
to_project
.
path
).
to
eq
(
@project
.
path
)
expect
(
to_project
.
description
).
to
eq
(
@project
.
description
)
expect
(
to_project
.
star_count
).
to
be_zero
expect
(
to_project
).
to
be_persisted
expect
(
to_project
.
errors
).
to
be_empty
expect
(
to_project
.
owner
).
to
eq
(
@group
)
expect
(
to_project
.
namespace
).
to
eq
(
@group
)
expect
(
to_project
.
name
).
to
eq
(
@project
.
name
)
expect
(
to_project
.
path
).
to
eq
(
@project
.
path
)
expect
(
to_project
.
description
).
to
eq
(
@project
.
description
)
expect
(
to_project
.
ci_config_path
).
to
eq
(
@project
.
ci_config_path
)
expect
(
to_project
.
star_count
).
to
be_zero
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